222333
', 1, 0, '', '2021-01-13 05:24:52', '', '2021-01-13 05:25:01', b'1'); +INSERT INTO `sys_notice` VALUES (1, '温馨提醒:2018-07-01 若依新版本发布啦', '新版本内容', 2, 0, 'admin', '2021-01-05 17:03:48', '', '2021-12-15 05:02:23', b'0', 1); +INSERT INTO `sys_notice` VALUES (2, '维护通知:2018-07-01 若依系统凌晨维护', '维护内容', 1, 0, 'admin', '2021-01-05 17:03:48', '', '2021-12-15 05:02:22', b'0', 1); +INSERT INTO `sys_notice` VALUES (3, '1133', '222333
', 1, 0, '', '2021-01-13 05:24:52', '', '2021-12-15 05:02:21', b'1', 1); COMMIT; -- ---------------------------- @@ -1913,40 +1279,37 @@ COMMIT; DROP TABLE IF EXISTS `sys_operate_log`; CREATE TABLE `sys_operate_log` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '日志主键', - `trace_id` varchar(64) NOT NULL DEFAULT '' COMMENT '链路追踪编号', + `trace_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '链路追踪编号', `user_id` bigint NOT NULL COMMENT '用户编号', - `module` varchar(50) NOT NULL COMMENT '模块标题', - `name` varchar(50) NOT NULL COMMENT '操作名', + `module` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模块标题', + `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '操作名', `operate_type` bigint NOT NULL DEFAULT '0' COMMENT '操作分类', - `content` varchar(2000) NOT NULL DEFAULT '' COMMENT '操作内容', - `exts` varchar(512) NOT NULL DEFAULT '' COMMENT '拓展字段', - `request_method` varchar(16) DEFAULT '' COMMENT '请求方法名', - `request_url` varchar(255) DEFAULT '' COMMENT '请求地址', - `user_ip` varchar(50) DEFAULT NULL COMMENT '用户 IP', - `user_agent` varchar(200) DEFAULT NULL COMMENT '浏览器 UA', - `java_method` varchar(512) NOT NULL DEFAULT '' COMMENT 'Java 方法名', - `java_method_args` varchar(8000) DEFAULT '' COMMENT 'Java 方法的参数', + `content` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '操作内容', + `exts` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '拓展字段', + `request_method` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '请求方法名', + `request_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '请求地址', + `user_ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '用户 IP', + `user_agent` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '浏览器 UA', + `java_method` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Java 方法名', + `java_method_args` varchar(8000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Java 方法的参数', `start_time` datetime NOT NULL COMMENT '操作时间', `duration` int NOT NULL COMMENT '执行时长', `result_code` int NOT NULL DEFAULT '0' COMMENT '结果码', - `result_msg` varchar(512) DEFAULT '' COMMENT '结果提示', - `result_data` varchar(4000) DEFAULT '' COMMENT '结果数据', - `creator` varchar(64) DEFAULT '' COMMENT '创建者', + `result_msg` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '结果提示', + `result_data` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '结果数据', + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `updater` varchar(64) DEFAULT '' COMMENT '更新者', + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + `tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=62 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='操作日志记录'; +) ENGINE=InnoDB AUTO_INCREMENT=85 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='操作日志记录'; -- ---------------------------- -- Records of sys_operate_log -- ---------------------------- BEGIN; -INSERT INTO `sys_operate_log` VALUES (58, '', 1, '定时任务', '创建定时任务', 2, '', '', 'POST', '/api/infra/job/create', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36', 'CommonResult cn.iocoder.yudao.adminserver.modules.infra.controller.job.InfJobController.createJob(InfJobCreateReqVO)', '{\"createReqVO\":{\"name\":\"payNotifyJob\",\"handlerParam\":null,\"cronExpression\":\"* * * * * ?\",\"retryCount\":0,\"retryInterval\":0,\"monitorTimeout\":null,\"handlerName\":\"支付通知 Job\"}}', '2021-10-27 08:33:35', 57, 0, '', '4', NULL, '2021-10-27 08:33:35', NULL, '2021-10-27 08:33:35', b'0'); -INSERT INTO `sys_operate_log` VALUES (59, '', 1, '定时任务', '触发定时任务', 3, '', '', 'PUT', '/api/infra/job/trigger', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36', 'CommonResult cn.iocoder.yudao.adminserver.modules.infra.controller.job.InfJobController.triggerJob(Long)', '{\"id\":3}', '2021-10-27 08:33:59', 35, 0, '', 'true', NULL, '2021-10-27 08:33:59', NULL, '2021-10-27 08:33:59', b'0'); -INSERT INTO `sys_operate_log` VALUES (60, '', 1, '定时任务', '删除定时任务', 4, '', '', 'DELETE', '/api/infra/job/delete', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36', 'CommonResult cn.iocoder.yudao.adminserver.modules.infra.controller.job.InfJobController.deleteJob(Long)', '{\"id\":4}', '2021-10-27 08:34:15', 50, 0, '', 'true', NULL, '2021-10-27 08:34:15', NULL, '2021-10-27 08:34:15', b'0'); -INSERT INTO `sys_operate_log` VALUES (61, '', 1, '定时任务', '创建定时任务', 2, '', '', 'POST', '/api/infra/job/create', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36', 'CommonResult cn.iocoder.yudao.adminserver.modules.infra.controller.job.InfJobController.createJob(InfJobCreateReqVO)', '{\"createReqVO\":{\"name\":\"支付通知 Job\",\"handlerParam\":null,\"cronExpression\":\"* * * * * ?\",\"retryCount\":0,\"retryInterval\":0,\"monitorTimeout\":null,\"handlerName\":\"payNotifyJob\"}}', '2021-10-27 08:34:42', 51, 0, '', '5', NULL, '2021-10-27 08:34:42', NULL, '2021-10-27 08:34:42', b'0'); COMMIT; -- ---------------------------- @@ -1955,28 +1318,29 @@ COMMIT; DROP TABLE IF EXISTS `sys_post`; CREATE TABLE `sys_post` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '岗位ID', - `code` varchar(64) NOT NULL COMMENT '岗位编码', - `name` varchar(50) NOT NULL COMMENT '岗位名称', + `code` varchar(64) COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位编码', + `name` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位名称', `sort` int NOT NULL COMMENT '显示顺序', `status` tinyint NOT NULL COMMENT '状态(0正常 1停用)', - `remark` varchar(500) DEFAULT NULL COMMENT '备注', - `creator` varchar(64) DEFAULT '' COMMENT '创建者', + `remark` varchar(500) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注', + `creator` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `updater` varchar(64) DEFAULT '' COMMENT '更新者', + `updater` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + `tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='岗位信息表'; +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='岗位信息表'; -- ---------------------------- -- Records of sys_post -- ---------------------------- BEGIN; -INSERT INTO `sys_post` VALUES (1, 'ceo', '董事长', 1, 0, '', 'admin', '2021-01-05 17:03:48', '1', '2021-03-14 20:39:03', b'0'); -INSERT INTO `sys_post` VALUES (2, 'se', '项目经理', 2, 0, '', 'admin', '2021-01-05 17:03:48', '1', '2021-03-14 20:39:05', b'0'); -INSERT INTO `sys_post` VALUES (3, 'hr', '人力资源', 3, 0, '', 'admin', '2021-01-05 17:03:48', '', '2021-01-05 17:03:48', b'0'); -INSERT INTO `sys_post` VALUES (4, 'user', '普通员工', 4, 0, '', 'admin', '2021-01-05 17:03:48', '', '2021-01-05 17:03:48', b'0'); -INSERT INTO `sys_post` VALUES (5, 'test', '测试岗位', 0, 1, '132', '', '2021-01-07 15:07:44', '', '2021-01-07 15:10:35', b'1'); +INSERT INTO `sys_post` VALUES (1, 'ceo', '董事长', 1, 0, '', 'admin', '2021-01-05 17:03:48', '1', '2021-12-12 10:47:45', b'0', 1); +INSERT INTO `sys_post` VALUES (2, 'se', '项目经理', 2, 0, '', 'admin', '2021-01-05 17:03:48', '1', '2021-12-12 10:47:47', b'0', 1); +INSERT INTO `sys_post` VALUES (3, 'hr', '人力资源', 3, 0, '', 'admin', '2021-01-05 17:03:48', '', '2021-12-12 10:47:50', b'0', 1); +INSERT INTO `sys_post` VALUES (4, 'user', '普通员工', 4, 0, '', 'admin', '2021-01-05 17:03:48', '', '2021-12-12 10:47:51', b'0', 1); +INSERT INTO `sys_post` VALUES (5, 'test', '测试岗位', 0, 1, '132', '', '2021-01-07 15:07:44', '', '2021-12-12 10:47:53', b'1', 1); COMMIT; -- ---------------------------- @@ -1985,27 +1349,27 @@ COMMIT; DROP TABLE IF EXISTS `sys_role`; CREATE TABLE `sys_role` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '角色ID', - `name` varchar(30) NOT NULL COMMENT '角色名称', - `code` varchar(100) NOT NULL COMMENT '角色权限字符串', + `name` varchar(30) COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色名称', + `code` varchar(100) COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色权限字符串', `sort` int NOT NULL COMMENT '显示顺序', `data_scope` tinyint NOT NULL DEFAULT '1' COMMENT '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)', - `data_scope_dept_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '数据范围(指定部门数组)', + `data_scope_dept_ids` varchar(500) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '数据范围(指定部门数组)', `status` tinyint NOT NULL COMMENT '角色状态(0正常 1停用)', `type` tinyint NOT NULL COMMENT '角色类型', - `remark` varchar(500) DEFAULT NULL COMMENT '备注', - `creator` varchar(64) DEFAULT '' COMMENT '创建者', + `remark` varchar(500) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注', + `creator` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `updater` varchar(64) DEFAULT '' COMMENT '更新者', + `updater` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色信息表'; +) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='角色信息表'; -- ---------------------------- -- Records of sys_role -- ---------------------------- BEGIN; -INSERT INTO `sys_role` VALUES (1, '超级管理员', 'admin', 1, 1, '', 0, 1, '超级管理员', 'admin', '2021-01-05 17:03:48', '', '2021-01-06 12:40:20', b'0'); +INSERT INTO `sys_role` VALUES (1, '超级管理员', 'admin', 1, 1, '', 0, 1, '超级管理员', 'admin', '2021-01-05 17:03:48', '', '2021-12-15 04:52:44', b'0'); INSERT INTO `sys_role` VALUES (2, '普通角色', 'common', 2, 2, '', 0, 1, '普通角色', 'admin', '2021-01-05 17:03:48', '', '2021-01-06 11:46:58', b'0'); INSERT INTO `sys_role` VALUES (101, '测试账号', 'test', 0, 2, '[104]', 0, 2, '132', '', '2021-01-06 13:49:35', '1', '2021-03-14 22:17:20', b'0'); COMMIT; @@ -2018,13 +1382,13 @@ CREATE TABLE `sys_role_menu` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增编号', `role_id` bigint NOT NULL COMMENT '角色ID', `menu_id` bigint NOT NULL COMMENT '菜单ID', - `creator` varchar(64) DEFAULT '' COMMENT '创建者', + `creator` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `updater` varchar(64) DEFAULT '' COMMENT '更新者', + `updater` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=239 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色和菜单关联表'; +) ENGINE=InnoDB AUTO_INCREMENT=239 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='角色和菜单关联表'; -- ---------------------------- -- Records of sys_role_menu @@ -2192,20 +1556,20 @@ COMMIT; DROP TABLE IF EXISTS `sys_sms_channel`; CREATE TABLE `sys_sms_channel` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', - `signature` varchar(10) NOT NULL COMMENT '短信签名', - `code` varchar(63) NOT NULL COMMENT '渠道编码', + `signature` varchar(10) COLLATE utf8mb4_general_ci NOT NULL COMMENT '短信签名', + `code` varchar(63) COLLATE utf8mb4_general_ci NOT NULL COMMENT '渠道编码', `status` tinyint NOT NULL COMMENT '开启状态', - `remark` varchar(255) DEFAULT NULL COMMENT '备注', - `api_key` varchar(128) NOT NULL COMMENT '短信 API 的账号', - `api_secret` varchar(128) DEFAULT NULL COMMENT '短信 API 的秘钥', - `callback_url` varchar(255) DEFAULT NULL COMMENT '短信发送回调 URL', - `creator` varchar(64) DEFAULT '' COMMENT '创建者', + `remark` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注', + `api_key` varchar(128) COLLATE utf8mb4_general_ci NOT NULL COMMENT '短信 API 的账号', + `api_secret` varchar(128) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '短信 API 的秘钥', + `callback_url` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '短信发送回调 URL', + `creator` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `updater` varchar(64) DEFAULT '' COMMENT '更新者', + `updater` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='短信渠道'; +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='短信渠道'; -- ---------------------------- -- Records of sys_sms_channel @@ -2223,22 +1587,22 @@ COMMIT; DROP TABLE IF EXISTS `sys_sms_code`; CREATE TABLE `sys_sms_code` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', - `mobile` varchar(11) NOT NULL COMMENT '手机号', - `code` varchar(6) NOT NULL COMMENT '验证码', - `create_ip` varchar(15) NOT NULL COMMENT '创建 IP', + `mobile` varchar(11) COLLATE utf8mb4_general_ci NOT NULL COMMENT '手机号', + `code` varchar(6) COLLATE utf8mb4_general_ci NOT NULL COMMENT '验证码', + `create_ip` varchar(15) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建 IP', `scene` tinyint NOT NULL COMMENT '发送场景', `today_index` tinyint NOT NULL COMMENT '今日发送的第几条', `used` tinyint NOT NULL COMMENT '是否使用', `used_time` datetime DEFAULT NULL COMMENT '使用时间', - `used_ip` varchar(255) DEFAULT NULL COMMENT '使用 IP', - `creator` varchar(64) DEFAULT '' COMMENT '创建者', + `used_ip` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '使用 IP', + `creator` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `updater` varchar(64) DEFAULT '' COMMENT '更新者', + `updater` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', PRIMARY KEY (`id`) USING BTREE, KEY `idx_mobile` (`mobile`) USING BTREE COMMENT '手机号' -) ENGINE=InnoDB AUTO_INCREMENT=453 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='手机验证码'; +) ENGINE=InnoDB AUTO_INCREMENT=462 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='手机验证码'; -- ---------------------------- -- Records of sys_sms_code @@ -2252,6 +1616,15 @@ INSERT INTO `sys_sms_code` VALUES (449, '15601691300', '9999', '127.0.0.1', 1, 5 INSERT INTO `sys_sms_code` VALUES (450, '15601691301', '9999', '127.0.0.1', 1, 1, 1, '2021-10-10 22:36:27', '127.0.0.1', NULL, '2021-10-10 22:34:12', NULL, '2021-10-10 22:36:27', b'0'); INSERT INTO `sys_sms_code` VALUES (451, '15601691399', '9999', '127.0.0.1', 1, 1, 0, NULL, NULL, NULL, '2021-10-12 08:29:09', NULL, '2021-10-12 08:29:09', b'0'); INSERT INTO `sys_sms_code` VALUES (452, '15601691399', '9999', '127.0.0.1', 1, 2, 0, NULL, NULL, NULL, '2021-10-12 08:42:16', NULL, '2021-10-12 08:42:16', b'0'); +INSERT INTO `sys_sms_code` VALUES (453, '15601691300', '9999', '127.0.0.1', 1, 6, 0, NULL, NULL, NULL, '2021-11-28 20:29:24', NULL, '2021-11-28 20:29:24', b'0'); +INSERT INTO `sys_sms_code` VALUES (454, '15601691300', '9999', '127.0.0.1', 1, 7, 0, NULL, NULL, NULL, '2021-11-28 20:30:33', NULL, '2021-11-28 20:30:33', b'0'); +INSERT INTO `sys_sms_code` VALUES (455, '15601691300', '9999', '127.0.0.1', 1, 8, 0, NULL, NULL, NULL, '2021-11-28 20:31:49', NULL, '2021-11-28 20:31:49', b'0'); +INSERT INTO `sys_sms_code` VALUES (456, '15601691301', '9999', '127.0.0.1', 1, 2, 0, NULL, NULL, NULL, '2021-11-28 20:32:22', NULL, '2021-11-28 20:32:22', b'0'); +INSERT INTO `sys_sms_code` VALUES (457, '15601691302', '9999', '127.0.0.1', 1, 1, 0, NULL, NULL, NULL, '2021-11-28 20:33:04', NULL, '2021-11-28 20:33:04', b'0'); +INSERT INTO `sys_sms_code` VALUES (458, '15601691322', '9999', '127.0.0.1', 1, 1, 0, NULL, NULL, NULL, '2021-11-28 20:33:24', NULL, '2021-11-28 20:33:24', b'0'); +INSERT INTO `sys_sms_code` VALUES (459, '15601691322', '9999', '127.0.0.1', 1, 2, 0, NULL, NULL, NULL, '2021-11-28 20:34:48', NULL, '2021-11-28 20:34:48', b'0'); +INSERT INTO `sys_sms_code` VALUES (460, '15601691300', '9999', '127.0.0.1', 1, 9, 1, '2021-11-28 20:37:02', '127.0.0.1', NULL, '2021-11-28 20:36:59', NULL, '2021-11-28 20:37:02', b'0'); +INSERT INTO `sys_sms_code` VALUES (461, '15601691300', '9999', '127.0.0.1', 1, 10, 1, '2021-11-28 20:47:51', '127.0.0.1', '245', '2021-11-28 20:47:49', '245', '2021-11-28 20:47:51', b'0'); COMMIT; -- ---------------------------- @@ -2261,35 +1634,35 @@ DROP TABLE IF EXISTS `sys_sms_log`; CREATE TABLE `sys_sms_log` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', `channel_id` bigint NOT NULL COMMENT '短信渠道编号', - `channel_code` varchar(63) NOT NULL COMMENT '短信渠道编码', + `channel_code` varchar(63) COLLATE utf8mb4_general_ci NOT NULL COMMENT '短信渠道编码', `template_id` bigint NOT NULL COMMENT '模板编号', - `template_code` varchar(63) NOT NULL COMMENT '模板编码', + `template_code` varchar(63) COLLATE utf8mb4_general_ci NOT NULL COMMENT '模板编码', `template_type` tinyint NOT NULL COMMENT '短信类型', - `template_content` varchar(255) NOT NULL COMMENT '短信内容', - `template_params` varchar(255) NOT NULL COMMENT '短信参数', - `api_template_id` varchar(63) NOT NULL COMMENT '短信 API 的模板编号', - `mobile` varchar(11) NOT NULL COMMENT '手机号', + `template_content` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '短信内容', + `template_params` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '短信参数', + `api_template_id` varchar(63) COLLATE utf8mb4_general_ci NOT NULL COMMENT '短信 API 的模板编号', + `mobile` varchar(11) COLLATE utf8mb4_general_ci NOT NULL COMMENT '手机号', `user_id` bigint DEFAULT NULL COMMENT '用户编号', `user_type` tinyint DEFAULT NULL COMMENT '用户类型', `send_status` tinyint NOT NULL DEFAULT '0' COMMENT '发送状态', `send_time` datetime DEFAULT NULL COMMENT '发送时间', `send_code` int DEFAULT NULL COMMENT '发送结果的编码', - `send_msg` varchar(255) DEFAULT NULL COMMENT '发送结果的提示', - `api_send_code` varchar(63) DEFAULT NULL COMMENT '短信 API 发送结果的编码', - `api_send_msg` varchar(255) DEFAULT NULL COMMENT '短信 API 发送失败的提示', - `api_request_id` varchar(255) DEFAULT NULL COMMENT '短信 API 发送返回的唯一请求 ID', - `api_serial_no` varchar(255) DEFAULT NULL COMMENT '短信 API 发送返回的序号', + `send_msg` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '发送结果的提示', + `api_send_code` varchar(63) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '短信 API 发送结果的编码', + `api_send_msg` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '短信 API 发送失败的提示', + `api_request_id` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '短信 API 发送返回的唯一请求 ID', + `api_serial_no` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '短信 API 发送返回的序号', `receive_status` tinyint NOT NULL DEFAULT '0' COMMENT '接收状态', `receive_time` datetime DEFAULT NULL COMMENT '接收时间', - `api_receive_code` varchar(63) DEFAULT NULL COMMENT 'API 接收结果的编码', - `api_receive_msg` varchar(255) DEFAULT NULL COMMENT 'API 接收结果的说明', - `creator` varchar(64) DEFAULT '' COMMENT '创建者', + `api_receive_code` varchar(63) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'API 接收结果的编码', + `api_receive_msg` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'API 接收结果的说明', + `creator` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `updater` varchar(64) DEFAULT '' COMMENT '更新者', + `updater` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='短信日志'; +) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='短信日志'; -- ---------------------------- -- Records of sys_sms_log @@ -2305,21 +1678,21 @@ CREATE TABLE `sys_sms_template` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', `type` tinyint NOT NULL COMMENT '短信签名', `status` tinyint NOT NULL COMMENT '开启状态', - `code` varchar(63) NOT NULL COMMENT '模板编码', - `name` varchar(63) NOT NULL COMMENT '模板名称', - `content` varchar(255) NOT NULL COMMENT '模板内容', - `params` varchar(255) NOT NULL COMMENT '参数数组', - `remark` varchar(255) DEFAULT NULL COMMENT '备注', - `api_template_id` varchar(63) NOT NULL COMMENT '短信 API 的模板编号', + `code` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模板编码', + `name` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模板名称', + `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模板内容', + `params` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '参数数组', + `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注', + `api_template_id` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '短信 API 的模板编号', `channel_id` bigint NOT NULL COMMENT '短信渠道编号', - `channel_code` varchar(63) NOT NULL COMMENT '短信渠道编码', - `creator` varchar(64) DEFAULT '' COMMENT '创建者', + `channel_code` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '短信渠道编码', + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `updater` varchar(64) DEFAULT '' COMMENT '更新者', + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='短信模板'; +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='短信模板'; -- ---------------------------- -- Records of sys_sms_template @@ -2343,26 +1716,54 @@ CREATE TABLE `sys_social_user` ( `user_id` bigint NOT NULL COMMENT '关联的用户编号', `user_type` tinyint NOT NULL DEFAULT '0' COMMENT '用户类型', `type` tinyint NOT NULL COMMENT '社交平台的类型', - `openid` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '社交 openid', + `openid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '社交 openid', `token` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '社交 token', - `union_id` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '社交的全局编号', - `raw_token_info` varchar(1024) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '原始 Token 数据,一般是 JSON 格式', - `nickname` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户昵称', - `avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户头像', - `raw_user_info` varchar(1024) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '原始用户数据,一般是 JSON 格式', + `union_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '社交的全局编号', + `raw_token_info` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '原始 Token 数据,一般是 JSON 格式', + `nickname` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户昵称', + `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户头像', + `raw_user_info` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '原始用户数据,一般是 JSON 格式', `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='社交用户'; +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='社交用户'; -- ---------------------------- -- Records of sys_social_user -- ---------------------------- BEGIN; INSERT INTO `sys_social_user` VALUES (4, 1, 2, 20, 'IPRmJ0wvBptiPIlGEZiPewGwiEiE', NULL, 'IPRmJ0wvBptiPIlGEZiPewGwiEiE', '{\"accessToken\":null,\"expireIn\":0,\"refreshToken\":null,\"refreshTokenExpireIn\":0,\"uid\":null,\"openId\":\"0TvabQWZs9g6UedEWZKSegiEiE\",\"accessCode\":null,\"unionId\":\"IPRmJ0wvBptiPIlGEZiPewGwiEiE\",\"scope\":null,\"tokenType\":null,\"idToken\":null,\"macAlgorithm\":null,\"macKey\":null,\"code\":null,\"oauthToken\":null,\"oauthTokenSecret\":null,\"userId\":null,\"screenName\":null,\"oauthCallbackConfirmed\":null}', '王文斌(芋艿)(正在输出)', NULL, '{\"nick\":\"王文斌(芋艿)(正在输出)\",\"unionid\":\"IPRmJ0wvBptiPIlGEZiPewGwiEiE\",\"dingId\":\"$:LWCP_v1:$r28ct/waSBPp5Gk7a6kDXA==\",\"openid\":\"0TvabQWZs9g6UedEWZKSegiEiE\",\"main_org_auth_high_level\":false}', NULL, '2021-10-06 00:43:17', NULL, '2021-10-06 00:43:34', b'0'); +INSERT INTO `sys_social_user` VALUES (5, 245, 1, 33, 'osFZg6JVT_mbOOXfeCSxmRv-Cs_4', NULL, 'osFZg6JVT_mbOOXfeCSxmRv-Cs_4', '{\"accessToken\":null,\"expireIn\":0,\"refreshToken\":null,\"refreshTokenExpireIn\":0,\"uid\":null,\"openId\":\"osFZg6JVT_mbOOXfeCSxmRv-Cs_4\",\"accessCode\":null,\"unionId\":null,\"scope\":null,\"tokenType\":null,\"idToken\":null,\"macAlgorithm\":null,\"macKey\":null,\"code\":null,\"oauthToken\":null,\"oauthTokenSecret\":null,\"userId\":null,\"screenName\":null,\"oauthCallbackConfirmed\":null,\"miniSessionKey\":\"7BK7xtyJleOWEXTHhW6eDg==\"}', '', '', 'null', NULL, '2021-10-30 10:08:42', NULL, '2021-10-30 10:08:42', b'0'); +COMMIT; + +-- ---------------------------- +-- Table structure for sys_tenant +-- ---------------------------- +DROP TABLE IF EXISTS `sys_tenant`; +CREATE TABLE `sys_tenant` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '租户编号', + `name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '租户名', + `contact_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '联系人', + `contact_mobile` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '联系手机', + `status` tinyint NOT NULL DEFAULT '0' COMMENT '租户状态(0正常 1停用)', + `creator` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updater` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=109 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='租户表'; + +-- ---------------------------- +-- Records of sys_tenant +-- ---------------------------- +BEGIN; +INSERT INTO `sys_tenant` VALUES (1, '芋道源码', '芋艿', '17321315478', 0, 'admin', '2021-01-05 17:03:47', NULL, '2021-12-05 02:22:26', b'0'); +INSERT INTO `sys_tenant` VALUES (107, '测试租户', '秃头', '15601691300', 1, '1', '2021-12-14 20:49:44', '1', '2021-12-14 20:49:49', b'0'); +INSERT INTO `sys_tenant` VALUES (108, '测试', '测试', '15601691300', 1, '1', '2021-12-14 21:02:09', '1', '2021-12-14 21:02:09', b'0'); COMMIT; -- ---------------------------- @@ -2371,37 +1772,39 @@ COMMIT; DROP TABLE IF EXISTS `sys_user`; CREATE TABLE `sys_user` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '用户ID', - `username` varchar(30) NOT NULL COMMENT '用户账号', - `password` varchar(100) NOT NULL DEFAULT '' COMMENT '密码', - `nickname` varchar(30) NOT NULL COMMENT '用户昵称', - `remark` varchar(500) DEFAULT NULL COMMENT '备注', + `username` varchar(30) COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户账号', + `password` varchar(100) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '密码', + `nickname` varchar(30) COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户昵称', + `remark` varchar(500) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注', `dept_id` bigint DEFAULT NULL COMMENT '部门ID', - `post_ids` varchar(255) DEFAULT NULL COMMENT '岗位编号数组', - `email` varchar(50) DEFAULT '' COMMENT '用户邮箱', - `mobile` varchar(11) DEFAULT '' COMMENT '手机号码', + `post_ids` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '岗位编号数组', + `email` varchar(50) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '用户邮箱', + `mobile` varchar(11) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '手机号码', `sex` tinyint DEFAULT '0' COMMENT '用户性别', - `avatar` varchar(100) DEFAULT '' COMMENT '头像地址', + `avatar` varchar(100) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '头像地址', `status` tinyint NOT NULL DEFAULT '0' COMMENT '帐号状态(0正常 1停用)', - `login_ip` varchar(50) DEFAULT '' COMMENT '最后登录IP', + `login_ip` varchar(50) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '最后登录IP', `login_date` datetime DEFAULT NULL COMMENT '最后登录时间', - `creator` varchar(64) DEFAULT '' COMMENT '创建者', + `creator` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `updater` varchar(64) DEFAULT '' COMMENT '更新者', + `updater` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + `tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=107 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户信息表'; +) ENGINE=InnoDB AUTO_INCREMENT=107 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用户信息表'; -- ---------------------------- -- Records of sys_user -- ---------------------------- BEGIN; -INSERT INTO `sys_user` VALUES (1, 'admin', '$2a$10$0acJOIk2D25/oC87nyclE..0lzeu9DtQ/n3geP4fkun/zIVRhHJIO', '芋道源码', '管理员', 103, '[1]', 'aoteman@126.com', '15612345678', 1, 'http://127.0.0.1:48080/api/infra/file/get/7e7ed694-2242-46cf-9ac9-0709debcc22f', 0, '127.0.0.1', '2021-10-27 08:30:10', 'admin', '2021-01-05 17:03:47', NULL, '2021-10-27 08:30:10', b'0'); -INSERT INTO `sys_user` VALUES (2, 'ry', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '若依', '测试员', 105, '[2]', 'ry@qq.com', '15666666666', 1, '', 0, '127.0.0.1', '2021-01-05 17:03:47', 'admin', '2021-01-05 17:03:47', '', '2021-04-01 04:50:36', b'1'); -INSERT INTO `sys_user` VALUES (100, 'yudao', '$2a$10$11U48RhyJ5pSBYWSn12AD./ld671.ycSzJHbyrtpeoMeYiw31eo8a', '芋道', '不要吓我', 100, '[1]', 'yudao@iocoder.cn', '15601691300', 1, '', 1, '', NULL, '', '2021-01-07 09:07:17', '1', '2021-03-14 22:35:17', b'0'); -INSERT INTO `sys_user` VALUES (103, 'yuanma', '', '源码', NULL, 100, NULL, 'yuanma@iocoder.cn', '15601701300', 0, '', 0, '', NULL, '', '2021-01-13 23:50:35', '', '2021-01-13 23:50:35', b'0'); -INSERT INTO `sys_user` VALUES (104, 'test', '$2a$10$.TOFpaIiI3PzEwkGrNq0Eu6Cc3rOqJMxTb1DqeSEM8StxaGPBRKoi', '测试号', NULL, 100, '[]', '', '15601691200', 1, '', 0, '', NULL, '', '2021-01-21 02:13:53', '1', '2021-03-14 22:36:38', b'0'); -INSERT INTO `sys_user` VALUES (106, 'zhijiantianya', '$2a$10$Y0hSfV2udA8quqMeWukhTuHEoKpQ5tDhclG8WUWSOH7o/MGw185Ti', '芋道源码', '', NULL, NULL, '', '', 3, 'https://portrait.gitee.com/uploads/avatars/user/0/176_zhijiantianya_1578913741.png', 0, '', NULL, NULL, '2021-09-28 09:40:59', NULL, '2021-09-28 09:40:59', b'0'); +INSERT INTO `sys_user` VALUES (1, 'admin', '$2a$10$0acJOIk2D25/oC87nyclE..0lzeu9DtQ/n3geP4fkun/zIVRhHJIO', '芋道源码', '管理员', 103, '[1]', 'aoteman@126.com', '15612345678', 1, 'http://127.0.0.1:48080/api/infra/file/get/7e7ed694-2242-46cf-9ac9-0709debcc22f', 0, '127.0.0.1', '2021-12-15 12:33:21', 'admin', '2021-01-05 17:03:47', NULL, '2021-12-15 12:33:21', b'0', 1); +INSERT INTO `sys_user` VALUES (2, 'ry', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '若依', '测试员', 103, '[2]', 'ry@qq.com', '15666666666', 1, '', 0, '127.0.0.1', '2021-01-05 17:03:47', 'admin', '2021-01-05 17:03:47', '', '2021-12-13 01:26:34', b'1', 1); +INSERT INTO `sys_user` VALUES (100, 'yudao', '$2a$10$11U48RhyJ5pSBYWSn12AD./ld671.ycSzJHbyrtpeoMeYiw31eo8a', '芋道', '不要吓我', 103, '[1]', 'yudao@iocoder.cn', '15601691300', 1, '', 1, '', NULL, '', '2021-01-07 09:07:17', '1', '2021-12-13 01:26:55', b'0', 1); +INSERT INTO `sys_user` VALUES (103, 'yuanma', '', '源码', NULL, 100, NULL, 'yuanma@iocoder.cn', '15601701300', 0, '', 0, '', NULL, '', '2021-01-13 23:50:35', '', '2021-12-05 02:22:01', b'0', 1); +INSERT INTO `sys_user` VALUES (104, 'test', '$2a$10$.TOFpaIiI3PzEwkGrNq0Eu6Cc3rOqJMxTb1DqeSEM8StxaGPBRKoi', '测试号', NULL, 100, '[]', '', '15601691200', 1, '', 0, '127.0.0.1', '2021-12-13 07:41:55', '', '2021-01-21 02:13:53', NULL, '2021-12-13 07:41:55', b'0', 1); +INSERT INTO `sys_user` VALUES (105, 'hradmin', '$2a$10$JEhJOL25X1eMnFfR3PILo.MoAljf29YukpL2w6H9GvVGjmqOCuh.O', 'hr-mgr', 'hr 管理员', 100, '[3]', '', '', 1, '', 0, '127.0.0.1', '2021-10-30 21:19:36', '1', '2021-09-25 16:50:41', NULL, '2021-12-05 02:22:03', b'0', 1); +INSERT INTO `sys_user` VALUES (106, 'zhijiantianya', '$2a$10$Y0hSfV2udA8quqMeWukhTuHEoKpQ5tDhclG8WUWSOH7o/MGw185Ti', '芋道源码', '', NULL, NULL, '', '', 3, 'https://portrait.gitee.com/uploads/avatars/user/0/176_zhijiantianya_1578913741.png', 0, '', NULL, NULL, '2021-09-28 09:40:59', NULL, '2021-12-05 02:22:04', b'0', 1); COMMIT; -- ---------------------------- @@ -2412,26 +1815,28 @@ CREATE TABLE `sys_user_role` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增编号', `user_id` bigint NOT NULL COMMENT '用户ID', `role_id` bigint NOT NULL COMMENT '角色ID', - `creator` varchar(64) DEFAULT '' COMMENT '创建者', + `creator` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者', `create_time` datetime DEFAULT NULL COMMENT '创建时间', - `updater` varchar(64) DEFAULT '' COMMENT '更新者', + `updater` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者', `update_time` datetime DEFAULT NULL COMMENT '更新时间', `deleted` bit(1) DEFAULT b'0' COMMENT '是否删除', + `tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户和角色关联表'; +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用户和角色关联表'; -- ---------------------------- -- Records of sys_user_role -- ---------------------------- BEGIN; -INSERT INTO `sys_user_role` VALUES (1, 1, 1, '', NULL, '', NULL, b'0'); -INSERT INTO `sys_user_role` VALUES (2, 2, 2, '', NULL, '', NULL, b'0'); -INSERT INTO `sys_user_role` VALUES (3, 100, 1, '', NULL, '', NULL, b'1'); -INSERT INTO `sys_user_role` VALUES (4, 100, 101, '', NULL, '', NULL, b'0'); -INSERT INTO `sys_user_role` VALUES (5, 100, 1, '', NULL, '', NULL, b'0'); -INSERT INTO `sys_user_role` VALUES (6, 100, 2, '', NULL, '', NULL, b'0'); -INSERT INTO `sys_user_role` VALUES (7, 104, 101, '', NULL, '', NULL, b'0'); -INSERT INTO `sys_user_role` VALUES (8, 106, 1, NULL, '2021-09-28 09:40:59', NULL, '2021-09-28 09:40:59', b'0'); +INSERT INTO `sys_user_role` VALUES (1, 1, 1, '', NULL, '', NULL, b'0', 0); +INSERT INTO `sys_user_role` VALUES (2, 2, 2, '', NULL, '', NULL, b'0', 0); +INSERT INTO `sys_user_role` VALUES (3, 100, 1, '', NULL, '', NULL, b'1', 0); +INSERT INTO `sys_user_role` VALUES (4, 100, 101, '', NULL, '', NULL, b'0', 0); +INSERT INTO `sys_user_role` VALUES (5, 100, 1, '', NULL, '', NULL, b'0', 0); +INSERT INTO `sys_user_role` VALUES (6, 100, 2, '', NULL, '', NULL, b'0', 0); +INSERT INTO `sys_user_role` VALUES (7, 104, 101, '', NULL, '', NULL, b'0', 0); +INSERT INTO `sys_user_role` VALUES (8, 106, 1, NULL, '2021-09-28 09:40:59', NULL, '2021-09-28 09:40:59', b'0', 0); +INSERT INTO `sys_user_role` VALUES (9, 105, 1, '1', '2021-10-30 13:40:48', '1', '2021-10-30 13:40:48', b'0', 0); COMMIT; -- ---------------------------- @@ -2439,37 +1844,26 @@ COMMIT; -- ---------------------------- DROP TABLE IF EXISTS `sys_user_session`; CREATE TABLE `sys_user_session` ( - `id` varchar(32) NOT NULL COMMENT '会话编号', + `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '会话编号', `user_id` bigint NOT NULL COMMENT '用户编号', `user_type` tinyint NOT NULL DEFAULT '0' COMMENT '用户类型', `session_timeout` datetime NOT NULL COMMENT '会话超时时间', - `username` varchar(30) NOT NULL COMMENT '用户账号', - `user_ip` varchar(50) NOT NULL COMMENT '用户 IP', - `user_agent` varchar(512) NOT NULL COMMENT '浏览器 UA', - `creator` varchar(64) DEFAULT '' COMMENT '创建者', + `username` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户账号', + `user_ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户 IP', + `user_agent` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '浏览器 UA', + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `updater` varchar(64) DEFAULT '' COMMENT '更新者', + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', + `tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户在线 Session'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用户在线 Session'; -- ---------------------------- -- Records of sys_user_session -- ---------------------------- BEGIN; -INSERT INTO `sys_user_session` VALUES ('02f40128d6ae47caae7ebe1eac9300b6', 245, 1, '2021-10-10 18:50:20', '15601691300', '127.0.0.1', 'Apache-HttpClient/4.5.13 (Java/11.0.11)', NULL, '2021-10-10 18:20:20', NULL, '2021-10-10 14:47:27', b'1'); -INSERT INTO `sys_user_session` VALUES ('112ac5cf97a34607b13ad0a5831df9af', 1, 2, '2021-10-12 09:34:24', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36', NULL, '2021-10-12 08:20:37', NULL, '2021-10-12 01:37:21', b'1'); -INSERT INTO `sys_user_session` VALUES ('549f940264cc4edf8ed78a9a0bafd7db', 245, 1, '2021-10-10 17:25:06', '15601691300', '127.0.0.1', 'Apache-HttpClient/4.5.13 (Java/11.0.11)', NULL, '2021-10-10 16:55:06', NULL, '2021-10-10 10:17:26', b'1'); -INSERT INTO `sys_user_session` VALUES ('5c8f2bb378aa4f8b92ef5b52a6ab282b', 245, 1, '2021-10-10 18:50:07', '15601691300', '127.0.0.1', 'Apache-HttpClient/4.5.13 (Java/11.0.11)', NULL, '2021-10-10 18:20:07', NULL, '2021-10-10 14:47:27', b'1'); -INSERT INTO `sys_user_session` VALUES ('5efe7272e0414d38be45f26228be6dfd', 1, 2, '2021-10-27 09:00:10', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36', NULL, '2021-10-27 08:30:10', NULL, '2021-10-27 08:30:10', b'0'); -INSERT INTO `sys_user_session` VALUES ('78c34a300fe449e391d8187a61164b6e', 1, 2, '2021-10-11 08:35:34', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36', NULL, '2021-10-11 07:55:00', NULL, '2021-10-12 00:19:28', b'1'); -INSERT INTO `sys_user_session` VALUES ('8f4d894746394901bcf7dcf6d4321868', 245, 1, '2021-10-10 23:04:03', '15601691300', '127.0.0.1', 'Apache-HttpClient/4.5.13 (Java/11.0.11)', NULL, '2021-10-10 22:34:03', NULL, '2021-10-10 23:50:42', b'1'); -INSERT INTO `sys_user_session` VALUES ('9ddb53d391f9413cbd460ec2461ceeb0', 1, 2, '2021-10-12 10:07:20', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36', NULL, '2021-10-12 09:22:43', NULL, '2021-10-27 00:29:48', b'1'); -INSERT INTO `sys_user_session` VALUES ('c1b76bdaf2c146c581caa4d7fd81ee66', 246, 1, '2021-10-10 23:06:27', '15601691301', '127.0.0.1', 'Apache-HttpClient/4.5.13 (Java/11.0.11)', NULL, '2021-10-10 22:36:27', NULL, '2021-10-10 14:50:05', b'1'); -INSERT INTO `sys_user_session` VALUES ('dcb1de2e2ef14e37bca3e64f5bbb603f', 245, 1, '2021-10-10 18:55:16', '15601691300', '127.0.0.1', 'Apache-HttpClient/4.5.13 (Java/11.0.11)', NULL, '2021-10-10 18:25:16', NULL, '2021-10-10 14:47:27', b'1'); -INSERT INTO `sys_user_session` VALUES ('e206ac2498054d0c822392e599f6151a', 1, 2, '2021-10-10 00:17:31', 'admin', '127.0.0.1', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36', NULL, '2021-10-09 23:47:31', NULL, '2021-10-10 10:17:26', b'1'); -INSERT INTO `sys_user_session` VALUES ('e24b67872cfb4c698aa727006820eafc', 245, 1, '2021-10-10 18:49:55', '15601691300', '127.0.0.1', 'Apache-HttpClient/4.5.13 (Java/11.0.11)', NULL, '2021-10-10 18:19:55', NULL, '2021-10-10 14:47:27', b'1'); COMMIT; -- ---------------------------- @@ -2479,30 +1873,30 @@ DROP TABLE IF EXISTS `tool_codegen_column`; CREATE TABLE `tool_codegen_column` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', `table_id` bigint NOT NULL COMMENT '表编号', - `column_name` varchar(200) NOT NULL COMMENT '字段名', - `column_type` varchar(100) NOT NULL COMMENT '字段类型', - `column_comment` varchar(500) NOT NULL COMMENT '字段描述', + `column_name` varchar(200) COLLATE utf8mb4_general_ci NOT NULL COMMENT '字段名', + `column_type` varchar(100) COLLATE utf8mb4_general_ci NOT NULL COMMENT '字段类型', + `column_comment` varchar(500) COLLATE utf8mb4_general_ci NOT NULL COMMENT '字段描述', `nullable` bit(1) NOT NULL COMMENT '是否允许为空', `primary_key` bit(1) NOT NULL COMMENT '是否主键', - `auto_Increment` char(1) NOT NULL COMMENT '是否自增', + `auto_Increment` char(1) COLLATE utf8mb4_general_ci NOT NULL COMMENT '是否自增', `ordinal_position` int NOT NULL COMMENT '排序', - `java_type` varchar(32) NOT NULL COMMENT 'Java 属性类型', - `java_field` varchar(64) NOT NULL COMMENT 'Java 属性名', - `dict_type` varchar(200) DEFAULT '' COMMENT '字典类型', - `example` varchar(64) DEFAULT NULL COMMENT '数据示例', + `java_type` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Java 属性类型', + `java_field` varchar(64) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Java 属性名', + `dict_type` varchar(200) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '字典类型', + `example` varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '数据示例', `create_operation` bit(1) NOT NULL COMMENT '是否为 Create 创建操作的字段', `update_operation` bit(1) NOT NULL COMMENT '是否为 Update 更新操作的字段', `list_operation` bit(1) NOT NULL COMMENT '是否为 List 查询操作的字段', - `list_operation_condition` varchar(32) NOT NULL DEFAULT '=' COMMENT 'List 查询操作的条件类型', + `list_operation_condition` varchar(32) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '=' COMMENT 'List 查询操作的条件类型', `list_operation_result` bit(1) NOT NULL COMMENT '是否为 List 查询操作的返回字段', - `html_type` varchar(32) NOT NULL COMMENT '显示类型', - `creator` varchar(64) DEFAULT '' COMMENT '创建者', + `html_type` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '显示类型', + `creator` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `updater` varchar(64) DEFAULT '' COMMENT '更新者', + `updater` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=469 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='代码生成表字段定义'; +) ENGINE=InnoDB AUTO_INCREMENT=479 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='代码生成表字段定义'; -- ---------------------------- -- Records of tool_codegen_column @@ -2710,6 +2104,16 @@ INSERT INTO `tool_codegen_column` VALUES (465, 38, 'create_time', 'datetime', ' INSERT INTO `tool_codegen_column` VALUES (466, 38, 'updater', 'varchar(64)', '更新者', b'1', b'0', '0', 9, 'String', 'updater', '', NULL, b'0', b'0', b'0', '=', b'0', 'input', '1', '2021-05-03 00:10:11', '1', '2021-05-03 00:45:45', b'0'); INSERT INTO `tool_codegen_column` VALUES (467, 38, 'update_time', 'datetime', '更新时间', b'0', b'0', '0', 10, 'Date', 'updateTime', '', NULL, b'0', b'0', b'0', 'BETWEEN', b'0', 'datetime', '1', '2021-05-03 00:10:11', '1', '2021-05-03 00:45:45', b'0'); INSERT INTO `tool_codegen_column` VALUES (468, 38, 'deleted', 'bit(1)', '是否删除', b'0', b'0', '0', 11, 'Boolean', 'deleted', '', NULL, b'0', b'0', b'0', '=', b'0', 'radio', '1', '2021-05-03 00:10:11', '1', '2021-05-03 00:45:45', b'0'); +INSERT INTO `tool_codegen_column` VALUES (469, 39, 'id', 'bigint', '租户编号', b'0', b'1', '1', 1, 'Long', 'id', '', '1024', b'0', b'1', b'0', '=', b'1', 'input', '1', '2021-12-14 09:51:12', '1', '2021-12-14 10:02:12', b'0'); +INSERT INTO `tool_codegen_column` VALUES (470, 39, 'name', 'varchar(30)', '租户名', b'0', b'0', '0', 2, 'String', 'name', '', '芋道', b'1', b'1', b'1', 'LIKE', b'1', 'input', '1', '2021-12-14 09:51:12', '1', '2021-12-14 10:02:12', b'0'); +INSERT INTO `tool_codegen_column` VALUES (471, 39, 'contact_name', 'varchar(30)', '联系人', b'0', b'0', '0', 3, 'String', 'contactName', '', '芋艿', b'1', b'1', b'1', 'LIKE', b'1', 'input', '1', '2021-12-14 09:51:12', '1', '2021-12-14 10:02:12', b'0'); +INSERT INTO `tool_codegen_column` VALUES (472, 39, 'contact_mobile', 'varchar(500)', '联系手机', b'1', b'0', '0', 4, 'String', 'contactMobile', '', '15601691300', b'1', b'1', b'1', 'LIKE', b'1', 'input', '1', '2021-12-14 09:51:12', '1', '2021-12-14 10:02:12', b'0'); +INSERT INTO `tool_codegen_column` VALUES (473, 39, 'status', 'tinyint', '租户状态(0正常 1停用)', b'0', b'0', '0', 5, 'Integer', 'status', 'sys_common_status', '1', b'1', b'1', b'1', '=', b'1', 'radio', '1', '2021-12-14 09:51:12', '1', '2021-12-14 10:02:12', b'0'); +INSERT INTO `tool_codegen_column` VALUES (474, 39, 'creator', 'varchar(64)', '创建者', b'1', b'0', '0', 6, 'String', 'creator', '', NULL, b'0', b'0', b'0', '=', b'0', 'input', '1', '2021-12-14 09:51:12', '1', '2021-12-14 10:02:12', b'0'); +INSERT INTO `tool_codegen_column` VALUES (475, 39, 'create_time', 'datetime', '创建时间', b'0', b'0', '0', 7, 'Date', 'createTime', '', NULL, b'0', b'0', b'1', 'BETWEEN', b'1', 'datetime', '1', '2021-12-14 09:51:12', '1', '2021-12-14 10:02:12', b'0'); +INSERT INTO `tool_codegen_column` VALUES (476, 39, 'updater', 'varchar(64)', '更新者', b'1', b'0', '0', 8, 'String', 'updater', '', NULL, b'0', b'0', b'0', '=', b'0', 'input', '1', '2021-12-14 09:51:12', '1', '2021-12-14 10:02:12', b'0'); +INSERT INTO `tool_codegen_column` VALUES (477, 39, 'update_time', 'datetime', '更新时间', b'0', b'0', '0', 9, 'Date', 'updateTime', '', NULL, b'0', b'0', b'0', 'BETWEEN', b'0', 'datetime', '1', '2021-12-14 09:51:12', '1', '2021-12-14 10:02:12', b'0'); +INSERT INTO `tool_codegen_column` VALUES (478, 39, 'deleted', 'bit(1)', '是否删除', b'0', b'0', '0', 10, 'Boolean', 'deleted', '', NULL, b'0', b'0', b'0', '=', b'0', 'radio', '1', '2021-12-14 09:51:12', '1', '2021-12-14 10:02:12', b'0'); COMMIT; -- ---------------------------- @@ -2719,23 +2123,23 @@ DROP TABLE IF EXISTS `tool_codegen_table`; CREATE TABLE `tool_codegen_table` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', `import_type` tinyint NOT NULL DEFAULT '1' COMMENT '导入类型', - `table_name` varchar(200) NOT NULL DEFAULT '' COMMENT '表名称', - `table_comment` varchar(500) NOT NULL DEFAULT '' COMMENT '表描述', - `remark` varchar(500) DEFAULT NULL COMMENT '备注', - `module_name` varchar(30) NOT NULL COMMENT '模块名', - `business_name` varchar(30) NOT NULL COMMENT '业务名', - `class_name` varchar(100) NOT NULL DEFAULT '' COMMENT '类名称', - `class_comment` varchar(50) NOT NULL COMMENT '类描述', - `author` varchar(50) NOT NULL COMMENT '作者', + `table_name` varchar(200) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '表名称', + `table_comment` varchar(500) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '表描述', + `remark` varchar(500) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注', + `module_name` varchar(30) COLLATE utf8mb4_general_ci NOT NULL COMMENT '模块名', + `business_name` varchar(30) COLLATE utf8mb4_general_ci NOT NULL COMMENT '业务名', + `class_name` varchar(100) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '类名称', + `class_comment` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '类描述', + `author` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '作者', `template_type` tinyint NOT NULL DEFAULT '1' COMMENT '模板类型', `parent_menu_id` bigint DEFAULT NULL COMMENT '父菜单编号', - `creator` varchar(64) DEFAULT '' COMMENT '创建者', + `creator` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `updater` varchar(64) DEFAULT '' COMMENT '更新者', + `updater` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='代码生成表定义'; +) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='代码生成表定义'; -- ---------------------------- -- Records of tool_codegen_table @@ -2755,6 +2159,7 @@ INSERT INTO `tool_codegen_table` VALUES (35, 1, 'sys_sms_template', '短信模 INSERT INTO `tool_codegen_table` VALUES (36, 1, 'sys_sms_log', '短信日志', NULL, 'system', 'sms', 'SysSmsLog', '短信日志', '芋道源码', 1, 1093, '1', '2021-04-11 01:12:57', '1', '2021-04-11 20:33:54', b'0'); INSERT INTO `tool_codegen_table` VALUES (37, 1, 'inf_error_code', '错误码表', NULL, 'infra', 'errorcode', 'InfErrorCode', '错误码', '芋道源码', 1, 2, '1', '2021-04-20 15:27:45', '1', '2021-04-21 00:55:37', b'0'); INSERT INTO `tool_codegen_table` VALUES (38, 1, 'tool_test_demo', '字典类型表', NULL, 'tool', 'test', 'ToolTestDemo', '字典类型', '芋艿', 1, NULL, '1', '2021-04-26 12:25:51', '1', '2021-05-03 00:45:45', b'0'); +INSERT INTO `tool_codegen_table` VALUES (39, 1, 'sys_tenant', '租户表', NULL, 'system', 'tenant', 'SysTenant', '租户', '芋道源码', 1, 1, '1', '2021-12-05 01:04:21', '1', '2021-12-14 10:02:12', b'0'); COMMIT; -- ---------------------------- @@ -2763,18 +2168,18 @@ COMMIT; DROP TABLE IF EXISTS `tool_test_demo`; CREATE TABLE `tool_test_demo` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', - `name` varchar(100) NOT NULL DEFAULT '' COMMENT '名字', + `name` varchar(100) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '名字', `status` tinyint NOT NULL DEFAULT '0' COMMENT '状态', `type` tinyint NOT NULL COMMENT '类型', `category` tinyint NOT NULL COMMENT '分类', - `remark` varchar(500) DEFAULT NULL COMMENT '备注', - `creator` varchar(64) DEFAULT '' COMMENT '创建者', + `remark` varchar(500) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注', + `creator` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `updater` varchar(64) DEFAULT '' COMMENT '更新者', + `updater` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=108 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='字典类型表'; +) ENGINE=InnoDB AUTO_INCREMENT=108 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='字典类型表'; -- ---------------------------- -- Records of tool_test_demo diff --git a/yudao-admin-server/pom.xml b/yudao-admin-server/pom.xml index 9200eb771..847e626a0 100644 --- a/yudao-admin-server/pom.xml +++ b/yudao-admin-server/pom.xml @@ -35,6 +35,19 @@+ * 支持如下: + * 1. in + * 2. = + * 3. > + * 4. < + * 5. >= + * 6. <= + * 7. <> + * 8. EXISTS + * 9. NOT EXISTS + *
+ * 前提条件: + * 1. 子查询必须放在小括号中 + * 2. 子查询一般放在比较操作符的右边 + * + * @param where where 条件 + */ + protected void processWhereSubSelect(Expression where) { + if (where == null) { + return; + } + if (where instanceof FromItem) { + processFromItem((FromItem) where); + return; + } + if (where.toString().indexOf("SELECT") > 0) { + // 有子查询 + if (where instanceof BinaryExpression) { + // 比较符号 , and , or , 等等 + BinaryExpression expression = (BinaryExpression) where; + processWhereSubSelect(expression.getLeftExpression()); + processWhereSubSelect(expression.getRightExpression()); + } else if (where instanceof InExpression) { + // in + InExpression expression = (InExpression) where; + ItemsList itemsList = expression.getRightItemsList(); + if (itemsList instanceof SubSelect) { + processSelectBody(((SubSelect) itemsList).getSelectBody()); + } + } else if (where instanceof ExistsExpression) { + // exists + ExistsExpression expression = (ExistsExpression) where; + processWhereSubSelect(expression.getRightExpression()); + } else if (where instanceof NotExpression) { + // not exists + NotExpression expression = (NotExpression) where; + processWhereSubSelect(expression.getExpression()); + } else if (where instanceof Parenthesis) { + Parenthesis expression = (Parenthesis) where; + processWhereSubSelect(expression.getExpression()); + } + } + } + + protected void processSelectItem(SelectItem selectItem) { + if (selectItem instanceof SelectExpressionItem) { + SelectExpressionItem selectExpressionItem = (SelectExpressionItem) selectItem; + if (selectExpressionItem.getExpression() instanceof SubSelect) { + processSelectBody(((SubSelect) selectExpressionItem.getExpression()).getSelectBody()); + } else if (selectExpressionItem.getExpression() instanceof Function) { + processFunction((Function) selectExpressionItem.getExpression()); + } + } + } + + /** + * 处理函数 + *
支持: 1. select fun(args..) 2. select fun1(fun2(args..),args..)
+ *
fixed gitee pulls/141
+ * + * @param function 函数 + */ + protected void processFunction(Function function) { + ExpressionList parameters = function.getParameters(); + if (parameters != null) { + parameters.getExpressions().forEach(expression -> { + if (expression instanceof SubSelect) { + processSelectBody(((SubSelect) expression).getSelectBody()); + } else if (expression instanceof Function) { + processFunction((Function) expression); + } + }); + } + } + + /** + * 处理子查询等 + */ + protected void processFromItem(FromItem fromItem) { + if (fromItem instanceof SubJoin) { + SubJoin subJoin = (SubJoin) fromItem; + if (subJoin.getJoinList() != null) { + processJoins(subJoin.getJoinList()); + } + if (subJoin.getLeft() != null) { + processFromItem(subJoin.getLeft()); + } + } else if (fromItem instanceof SubSelect) { + SubSelect subSelect = (SubSelect) fromItem; + if (subSelect.getSelectBody() != null) { + processSelectBody(subSelect.getSelectBody()); + } + } else if (fromItem instanceof ValuesList) { + logger.debug("Perform a subquery, if you do not give us feedback"); + } else if (fromItem instanceof LateralSubSelect) { + LateralSubSelect lateralSubSelect = (LateralSubSelect) fromItem; + if (lateralSubSelect.getSubSelect() != null) { + SubSelect subSelect = lateralSubSelect.getSubSelect(); + if (subSelect.getSelectBody() != null) { + processSelectBody(subSelect.getSelectBody()); + } + } + } + } + + /** + * 处理 joins + * + * @param joins join 集合 + */ + private void processJoins(List