【更新】更新不同数据库配置案例,更新sql,去除druid监控密码,修复编辑空字段在不同数据库下的bug

This commit is contained in:
xuyuxiang 2021-04-15 17:14:52 +08:00
parent 7e35e1629a
commit 0db90164d4
19 changed files with 3646 additions and 3254 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
/*
Navicat Premium Data Transfer
Source Server :
Source Server : mysql本地数据
Source Server Type : MySQL
Source Server Version : 80022
Source Host : localhost:3306
@ -11,7 +11,7 @@
Target Server Version : 80022
File Encoding : 65001
Date: 09/04/2021 12:31:21
Date: 15/04/2021 16:54:55
*/
SET NAMES utf8mb4;
@ -65,7 +65,6 @@ CREATE TABLE `sys_code_generate` (
-- ----------------------------
-- Records of sys_code_generate
-- ----------------------------
INSERT INTO `sys_code_generate` VALUES (1362310959781744641, 'yubaoshan、xuyuxiang、dongxiayu', 'CodeGenTest', 'Y', '2', 'xn_code_gen_test', 'vip.xiaonuo', 'codegentest', '测试', 1265476890672672808, '2021-02-18 16:00:18', NULL, NULL);
-- ----------------------------
-- Table structure for sys_code_generate_config
@ -100,18 +99,6 @@ CREATE TABLE `sys_code_generate_config` (
-- ----------------------------
-- Records of sys_code_generate_config
-- ----------------------------
INSERT INTO `sys_code_generate_config` VALUES (1362310959903379458, 1362310959781744641, 'id', 'id', 'bigint', '主键', 'Long', 'input', NULL, 'N', 'N', 'N', 'N', 'N', 'eq', 'PRI', 'Id', 'N', '2021-02-18 16:00:18', 1265476890672672808, '2021-02-18 16:02:31', 1265476890672672808);
INSERT INTO `sys_code_generate_config` VALUES (1362310959941128193, 1362310959781744641, 'name', 'name', 'varchar', '姓名', 'String', 'input', NULL, 'Y', 'Y', 'N', 'Y', 'Y', 'like', '', 'Name', 'N', '2021-02-18 16:00:18', 1265476890672672808, '2021-02-18 16:02:31', 1265476890672672808);
INSERT INTO `sys_code_generate_config` VALUES (1362310959978876929, 1362310959781744641, 'age', 'age', 'int', '年龄', 'Integer', 'input', NULL, 'Y', 'Y', 'N', 'Y', 'Y', 'eq', '', 'Age', 'N', '2021-02-18 16:00:18', 1265476890672672808, '2021-02-18 16:02:31', 1265476890672672808);
INSERT INTO `sys_code_generate_config` VALUES (1362310960008237058, 1362310959781744641, 'interest', 'interest', 'varchar', '兴趣', 'String', 'checkbox', 'sex', 'Y', 'Y', 'N', 'Y', 'N', 'eq', '', 'Interest', 'N', '2021-02-18 16:00:18', 1265476890672672808, '2021-02-18 16:02:31', 1265476890672672808);
INSERT INTO `sys_code_generate_config` VALUES (1362310960033402881, 1362310959781744641, 'switchTest', 'switchtest', 'varchar', '开关', 'String', 'radio', 'yes_or_no', 'Y', 'Y', 'N', 'Y', 'Y', 'eq', '', 'Switchtest', 'N', '2021-02-18 16:00:18', 1265476890672672808, '2021-02-18 16:02:31', 1265476890672672808);
INSERT INTO `sys_code_generate_config` VALUES (1362310960062763009, 1362310959781744641, 'birthday', 'birthday', 'date', '日期', 'Date', 'datepicker', NULL, 'Y', 'Y', 'N', 'Y', 'Y', 'eq', '', 'Birthday', 'N', '2021-02-18 16:00:18', 1265476890672672808, '2021-02-18 16:02:31', 1265476890672672808);
INSERT INTO `sys_code_generate_config` VALUES (1362310960096317442, 1362310959781744641, 'whether', 'whether', 'varchar', '是否已婚', 'String', 'select', 'yes_or_no', 'Y', 'Y', 'N', 'Y', 'Y', 'eq', '', 'Whether', 'N', '2021-02-18 16:00:18', 1265476890672672808, '2021-02-18 16:02:31', 1265476890672672808);
INSERT INTO `sys_code_generate_config` VALUES (1362310960121483266, 1362310959781744641, 'explainTest', 'explaintest', 'varchar', '简介', 'String', 'textarea', NULL, 'N', 'Y', 'N', 'Y', 'Y', 'eq', '', 'Explain', 'N', '2021-02-18 16:00:18', 1265476890672672808, '2021-02-18 16:02:31', 1265476890672672808);
INSERT INTO `sys_code_generate_config` VALUES (1362310960150843393, 1362310959781744641, 'create_time', 'createTime', 'datetime', '创建时间', 'Date', 'datepicker', NULL, 'N', 'N', 'N', 'N', 'N', 'eq', '', 'CreateTime', 'Y', '2021-02-18 16:00:18', 1265476890672672808, '2021-02-18 16:02:31', 1265476890672672808);
INSERT INTO `sys_code_generate_config` VALUES (1362310960176009218, 1362310959781744641, 'create_user', 'createUser', 'bigint', '', 'Long', 'input', NULL, 'N', 'N', 'N', 'N', 'N', 'eq', '', 'CreateUser', 'Y', '2021-02-18 16:00:18', 1265476890672672808, '2021-02-18 16:02:31', 1265476890672672808);
INSERT INTO `sys_code_generate_config` VALUES (1362310960201175041, 1362310959781744641, 'update_time', 'updateTime', 'datetime', '', 'Date', 'datepicker', NULL, 'N', 'N', 'N', 'N', 'N', 'eq', '', 'UpdateTime', 'Y', '2021-02-18 16:00:18', 1265476890672672808, '2021-02-18 16:02:31', 1265476890672672808);
INSERT INTO `sys_code_generate_config` VALUES (1362310960234729473, 1362310959781744641, 'update_user', 'updateUser', 'bigint', '', 'Long', 'input', NULL, 'N', 'N', 'N', 'N', 'N', 'eq', '', 'UpdateUser', 'Y', '2021-02-18 16:00:18', 1265476890672672808, '2021-02-18 16:02:31', 1265476890672672808);
-- ----------------------------
-- Table structure for sys_config
@ -161,8 +148,6 @@ INSERT INTO `sys_config` VALUES (1270380786649982740, 'Snowy演示环境', 'SNOW
INSERT INTO `sys_config` VALUES (1270380786649982741, 'Snowy放开XSS过滤的接口', 'SNOWY_UN_XSS_FILTER_URL', '/demo/xssfilter,/demo/unxss', 'Y', '多个url可以用英文逗号隔开', 0, 'DEFAULT', '2020-06-09 23:42:37', 1265476890672672808, NULL, NULL);
INSERT INTO `sys_config` VALUES (1270380786649982742, '单用户登陆的开关', 'SNOWY_ENABLE_SINGLE_LOGIN', 'false', 'Y', '单用户登陆的开关true-打开false-关闭,如果一个人登录两次,就会将上一次登陆挤下去', 0, 'DEFAULT', '2020-06-09 23:42:37', 1265476890672672808, NULL, NULL);
INSERT INTO `sys_config` VALUES (1270380786649982743, '登录验证码的开关', 'SNOWY_CAPTCHA_OPEN', 'true', 'Y', '登录验证码的开关true-打开false-关闭', 0, 'DEFAULT', '2020-06-09 23:42:37', 1265476890672672808, NULL, NULL);
INSERT INTO `sys_config` VALUES (1280694183769792514, 'druid监控登录账号', 'SNOWY_DRUID_USERNAME', 'superAdmin', 'Y', 'druid监控登录账号', 0, 'DEFAULT', '2020-07-08 10:44:22', 1265476890672672808, NULL, NULL);
INSERT INTO `sys_config` VALUES (1280694281648070658, 'druid监控界面登录密码', 'SNOWY_DRUID_PASSWORD', '123456', 'Y', 'druid监控登录密码', 0, 'DEFAULT', '2020-07-08 10:44:46', 1265476890672672808, NULL, NULL);
INSERT INTO `sys_config` VALUES (1280694281648070659, '阿里云定位api接口地址', 'SNOWY_IP_GEO_API', 'http://api01.aliyun.venuscn.com/ip?ip=%s', 'Y', '阿里云定位api接口地址', 0, 'DEFAULT', '2020-07-20 10:44:46', 1265476890672672808, NULL, NULL);
INSERT INTO `sys_config` VALUES (1280694281648070660, '阿里云定位appCode', 'SNOWY_IP_GEO_APP_CODE', '461535aabeae4f34861884d392f5d452', 'Y', '阿里云定位appCode', 0, 'DEFAULT', '2020-07-20 10:44:46', 1265476890672672808, NULL, NULL);
INSERT INTO `sys_config` VALUES (1288309751255412737, 'Oauth用户登录的开关', 'SNOWY_ENABLE_OAUTH_LOGIN', 'true', 'Y', 'Oauth用户登录的开关', 0, 'OAUTH', '2020-07-29 11:05:55', 1265476890672672808, NULL, NULL);
@ -548,7 +533,7 @@ INSERT INTO `sys_menu` VALUES (1264622039642256371, 1264622039642256361, '[0],[1
INSERT INTO `sys_menu` VALUES (1264622039642256381, 1264622039642256351, '[0],[1264622039642256351],', '在线用户', 'sys_monitor_mgr_online_user', 1, NULL, '/onlineUser', 'system/onlineUser/index', NULL, 'system', 1, 'Y', NULL, NULL, 1, 17, NULL, 0, '2020-06-05 16:01:55', 1265476890672672808, NULL, NULL);
INSERT INTO `sys_menu` VALUES (1264622039642256391, 1264622039642256381, '[0],[1264622039642256351],[1264622039642256381],', '在线用户列表', 'sys_monitor_mgr_online_user_list', 2, NULL, NULL, NULL, 'sysOnlineUser:list', 'system', 0, 'Y', NULL, NULL, 1, 100, NULL, 0, '2020-06-05 16:03:46', 1265476890672672808, NULL, NULL);
INSERT INTO `sys_menu` VALUES (1264622039642256401, 1264622039642256381, '[0],[1264622039642256351],[1264622039642256381],', '在线用户强退', 'sys_monitor_mgr_online_user_force_exist', 2, NULL, NULL, NULL, 'sysOnlineUser:forceExist', 'system', 0, 'Y', NULL, NULL, 1, 100, NULL, 0, '2020-06-05 16:04:16', 1265476890672672808, NULL, NULL);
INSERT INTO `sys_menu` VALUES (1264622039642256411, 1264622039642256351, '[0],[1264622039642256351],', '数据监控', 'sys_monitor_mgr_druid', 1, NULL, '/druid', 'Iframe', NULL, 'system', 2, 'Y', 'http://localhost:82/druid/login.html', NULL, 1, 18, NULL, 0, '2020-06-28 16:15:07', 1265476890672672808, '2020-09-13 09:39:10', 1265476890672672808);
INSERT INTO `sys_menu` VALUES (1264622039642256411, 1264622039642256351, '[0],[1264622039642256351],', '数据监控', 'sys_monitor_mgr_druid', 1, NULL, '/druid', 'Iframe', NULL, 'system', 2, 'Y', 'http://localhost:82/druid', NULL, 1, 18, NULL, 0, '2020-06-28 16:15:07', 1265476890672672808, '2020-09-13 09:39:10', 1265476890672672808);
INSERT INTO `sys_menu` VALUES (1264622039642256421, 0, '[0],', '通知公告', 'sys_notice', 0, 'sound', '/notice', 'PageView', NULL, 'system', 1, 'Y', NULL, NULL, 1, 7, NULL, 0, '2020-06-29 15:41:53', 1265476890672672808, NULL, NULL);
INSERT INTO `sys_menu` VALUES (1264622039642256431, 1264622039642256421, '[0],[1264622039642256421],', '公告管理', 'sys_notice_mgr', 1, NULL, '/notice', 'system/notice/index', NULL, 'system', 1, 'Y', NULL, NULL, 1, 19, NULL, 0, '2020-06-29 15:44:24', 1265476890672672808, NULL, NULL);
INSERT INTO `sys_menu` VALUES (1264622039642256441, 1264622039642256431, '[0],[1264622039642256421],[1264622039642256431],', '公告查询', 'sys_notice_mgr_page', 2, NULL, NULL, NULL, 'sysNotice:page', 'system', 0, 'Y', NULL, NULL, 1, 100, NULL, 0, '2020-06-29 15:45:30', 1265476890672672808, NULL, NULL);
@ -604,6 +589,10 @@ CREATE TABLE `sys_notice` (
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '通知表' ROW_FORMAT = Compact;
-- ----------------------------
-- Records of sys_notice
-- ----------------------------
-- ----------------------------
-- Table structure for sys_notice_user
-- ----------------------------
@ -617,6 +606,10 @@ CREATE TABLE `sys_notice_user` (
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统用户数据范围表' ROW_FORMAT = Compact;
-- ----------------------------
-- Records of sys_notice_user
-- ----------------------------
-- ----------------------------
-- Table structure for sys_oauth_user
-- ----------------------------
@ -1091,28 +1084,4 @@ CREATE TABLE `sys_vis_log` (
-- Records of sys_vis_log
-- ----------------------------
-- ----------------------------
-- Table structure for xn_code_gen_test
-- ----------------------------
DROP TABLE IF EXISTS `xn_code_gen_test`;
CREATE TABLE `xn_code_gen_test` (
`id` bigint(0) NOT NULL COMMENT '主键',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '姓名',
`age` int(0) NULL DEFAULT NULL COMMENT '年龄',
`interest` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '兴趣',
`switchTest` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '开关',
`birthday` date NULL DEFAULT NULL COMMENT '日期',
`whether` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否已婚',
`explain_test` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '简介',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`create_user` bigint(0) NULL DEFAULT NULL,
`update_time` datetime(0) NULL DEFAULT NULL,
`update_user` bigint(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '测试' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of xn_code_gen_test
-- ----------------------------
SET FOREIGN_KEY_CHECKS = 1;

View File

@ -62,26 +62,6 @@ public class ConstantContextHolder {
return getSysConfigWithDefault("SNOWY_TENANT_OPEN", Boolean.class, false);
}
/**
* 获取druid监控的密码
*
* @author yubaoshan
* @date 2020/7/8 9:53
*/
public static String getDruidMonitorPassword() {
return getSysConfigWithDefault("SNOWY_DRUID_PASSWORD", String.class, RandomUtil.randomString(10));
}
/**
* 获取druid的账号
*
* @author yubaoshan
* @date 2020/7/8 9:53
*/
public static String getDruidMonitorUsername() {
return getSysConfigWithDefault("SNOWY_DRUID_USERNAME", String.class, RandomUtil.randomString(10));
}
/**
* 获取放开xss过滤的接口
*

View File

@ -96,7 +96,7 @@ public class DruidProperties {
private Integer maxPoolPreparedStatementPerConnectionSize = 20;
private String filters = "stat,wall";
private String filters = "stat,slf4j";
private String dataSourceName;

View File

@ -52,12 +52,9 @@ public class DataSourceConfig {
@Bean
public ServletRegistrationBean<StatViewServlet> druidServletRegistration() {
// 设置servelet的参数
// 设置servlet的参数
HashMap<String, String> statViewServletParams = CollectionUtil.newHashMap();
statViewServletParams.put("resetEnable", "true");
statViewServletParams.put("loginUsername", ConstantContextHolder.getDruidMonitorUsername());
statViewServletParams.put("loginPassword", ConstantContextHolder.getDruidMonitorPassword());
ServletRegistrationBean<StatViewServlet> registration = new ServletRegistrationBean<>(new StatViewServlet());
registration.addUrlMappings("/druid/*");
registration.setInitParameters(statViewServletParams);

View File

@ -71,7 +71,7 @@ public class SysConfig extends BaseEntity {
/**
* 备注
*/
@TableField(insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)
@TableField(insertStrategy = FieldStrategy.IGNORED)
private String remark;
/**

View File

@ -69,7 +69,7 @@ public class SysDictData extends BaseEntity {
/**
* 备注
*/
@TableField(insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)
@TableField(insertStrategy = FieldStrategy.IGNORED)
private String remark;
/**

View File

@ -64,7 +64,7 @@ public class SysDictType extends BaseEntity {
/**
* 备注
*/
@TableField(insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)
@TableField(insertStrategy = FieldStrategy.IGNORED)
private String remark;
/**

View File

@ -132,7 +132,7 @@ public class SysMenu extends BaseEntity implements BaseTreeNode {
/**
* 备注
*/
@TableField(insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)
@TableField(insertStrategy = FieldStrategy.IGNORED)
private String remark;
/**

View File

@ -74,7 +74,7 @@ public class SysOrg extends BaseEntity {
/**
* 备注
*/
@TableField(insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)
@TableField(insertStrategy = FieldStrategy.IGNORED)
private String remark;
/**

View File

@ -64,7 +64,7 @@ public class SysPos extends BaseEntity {
/**
* 备注
*/
@TableField(insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)
@TableField(insertStrategy = FieldStrategy.IGNORED)
private String remark;
/**

View File

@ -69,7 +69,7 @@ public class SysRole extends BaseEntity {
/**
* 备注
*/
@TableField(insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)
@TableField(insertStrategy = FieldStrategy.IGNORED)
private String remark;
/**

View File

@ -80,7 +80,7 @@ public class SysUser extends BaseEntity {
/**
* 生日
*/
@TableField(insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)
@TableField(insertStrategy = FieldStrategy.IGNORED)
@Excel(name = "生日", databaseFormat = "yyyy-MM-dd HH:mm:ss", format = "yyyy-MM-dd", width = 20)
private Date birthday;

View File

@ -5,33 +5,27 @@ spring:
url: jdbc:mysql://localhost:3306/snowy-pub?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true
username: root
password: 123456
# 连接池大小根据实际情况调整
max-active: 20
max-pool-prepared-statement-per-connection-size: 20
# Oracle数据库
#spring:
# datasource:
# driver-class-name: oracle.jdbc.OracleDriver
# url: jdbc:oracle:thin:@localhost:1521:snowy-pub-oracle
# username: snowy-pub-oracle
# url: jdbc:oracle:thin:@localhost:1521:xe
# username: SNOWY-PUB-ORACLE
# password: 123456
# filters: wall,mergeStat
# SQLServer配置
#spring:
# datasource:
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://localhost:1433;DatabaseName=snowy-pub-mssql
# username: snowy-pub-mssql
# username: sa
# password: 123456
# filters: wall,mergeStat
# PostgreSQL配置
#spring:
# datasource:
# driverClassName: org.postgresql.Driver
# url: jdbc:postgresql://127.0.0.1:5432/snowy-pub-postgresql
# username: snowy-pub-postgresql
# password: 123456
# filters: wall,mergeStat
# username: postgres
# password: 123456

View File

@ -5,33 +5,27 @@ spring:
url: jdbc:mysql://localhost:3306/snowy-pub?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true
username: root
password: 123456
# 连接池大小根据实际情况调整
max-active: 20
max-pool-prepared-statement-per-connection-size: 20
# Oracle数据库
#spring:
# datasource:
# driver-class-name: oracle.jdbc.OracleDriver
# url: jdbc:oracle:thin:@localhost:1521:snowy-pub-oracle
# username: snowy-pub-oracle
# url: jdbc:oracle:thin:@localhost:1521:xe
# username: SNOWY-PUB-ORACLE
# password: 123456
# filters: wall,mergeStat
# SQLServer配置
#spring:
# datasource:
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://localhost:1433;DatabaseName=snowy-pub-mssql
# username: snowy-pub-mssql
# username: sa
# password: 123456
# filters: wall,mergeStat
# PostgreSQL配置
#spring:
# datasource:
# driverClassName: org.postgresql.Driver
# url: jdbc:postgresql://127.0.0.1:5432/snowy-pub-postgresql
# username: snowy-pub-postgresql
# password: 123456
# filters: wall,mergeStat
# username: postgres
# password: 123456

View File

@ -5,33 +5,27 @@ spring:
url: jdbc:mysql://localhost:3306/snowy-pub?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true
username: root
password: 123456
# 连接池大小根据实际情况调整
max-active: 20
max-pool-prepared-statement-per-connection-size: 20
# Oracle数据库
#spring:
# datasource:
# driver-class-name: oracle.jdbc.OracleDriver
# url: jdbc:oracle:thin:@localhost:1521:snowy-pub-oracle
# username: snowy-pub-oracle
# url: jdbc:oracle:thin:@localhost:1521:xe
# username: SNOWY-PUB-ORACLE
# password: 123456
# filters: wall,mergeStat
# SQLServer配置
#spring:
# datasource:
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://localhost:1433;DatabaseName=snowy-pub-mssql
# username: snowy-pub-mssql
# username: sa
# password: 123456
# filters: wall,mergeStat
# PostgreSQL配置
#spring:
# datasource:
# driverClassName: org.postgresql.Driver
# url: jdbc:postgresql://127.0.0.1:5432/snowy-pub-postgresql
# username: snowy-pub-postgresql
# password: 123456
# filters: wall,mergeStat
# username: postgres
# password: 123456

View File

@ -36,8 +36,10 @@ mybatis-plus:
enable-sql-runner: true
configuration-properties:
prefix:
#如果数据库为postgresql则需要配置为blobType: BINARY
blobType: BLOB
boolValue: TRUE
#如果数据库为oracle或mssql则需要配置为boolValue: 1
boolValue: true
#libreoffice文档在线预览配置
# CentOS 下安装 libreoffice