youlai_boot.sql 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. /*
  2. * youlai_boot 权限系统数据库(MySQL5.x)
  3. * @author youlai
  4. * @date 2024/06/24
  5. */
  6. -- ----------------------------
  7. -- 1. 创建数据库
  8. -- ----------------------------
  9. CREATE DATABASE IF NOT EXISTS youlai_boot DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  10. -- ----------------------------
  11. -- 2. 创建表 && 数据初始化
  12. -- ----------------------------
  13. use youlai_boot;
  14. SET NAMES utf8;
  15. SET FOREIGN_KEY_CHECKS = 0;
  16. -- 开启事务
  17. START TRANSACTION;
  18. -- ----------------------------
  19. -- Table structure for sys_config
  20. -- ----------------------------
  21. DROP TABLE IF EXISTS `sys_config`;
  22. CREATE TABLE `sys_config` (
  23. `id` bigint NOT NULL AUTO_INCREMENT,
  24. `config_name` varchar(50) NOT NULL COMMENT '配置名称',
  25. `config_key` varchar(50) NOT NULL COMMENT '配置key',
  26. `config_value` varchar(100) NOT NULL COMMENT '配置值',
  27. `remark` varchar(200) DEFAULT NULL COMMENT '描述、备注',
  28. `create_time` datetime NOT NULL COMMENT '创建时间',
  29. `create_by` bigint NOT NULL COMMENT '创建人ID',
  30. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  31. `update_by` bigint DEFAULT NULL COMMENT '更新人ID',
  32. `is_deleted` tinyint(1) NOT NULL COMMENT '逻辑删除标识(0-未删除 1-已删除)',
  33. PRIMARY KEY (`id`)
  34. ) ENGINE=InnoDB COMMENT='系统配置';
  35. -- ----------------------------
  36. -- Table structure for sys_dept
  37. -- ----------------------------
  38. DROP TABLE IF EXISTS `sys_dept`;
  39. CREATE TABLE `sys_dept` (
  40. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  41. `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '部门名称',
  42. `code` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '部门编号',
  43. `parent_id` bigint NOT NULL DEFAULT 0 COMMENT '父节点id',
  44. `tree_path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '父节点id路径',
  45. `sort` smallint NULL DEFAULT 0 COMMENT '显示顺序',
  46. `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态(1-正常 0-禁用)',
  47. `create_by` bigint NULL DEFAULT NULL COMMENT '创建人ID',
  48. `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  49. `update_by` bigint NULL DEFAULT NULL COMMENT '修改人ID',
  50. `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  51. `is_deleted` tinyint NOT NULL DEFAULT 0 COMMENT '逻辑删除标识(1-已删除 0-未删除)',
  52. PRIMARY KEY (`id`) USING BTREE,
  53. UNIQUE INDEX `uk_code`(`code` ASC) USING BTREE COMMENT '部门编号唯一索引'
  54. ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '部门表' ROW_FORMAT = DYNAMIC;
  55. -- ----------------------------
  56. -- Records of sys_dept
  57. -- ----------------------------
  58. INSERT INTO `sys_dept` VALUES (1, '有来技术', 'YOULAI', 0, '0', 1, 1, 1, NULL, 1, '2024-06-24 23:48:59', 0);
  59. INSERT INTO `sys_dept` VALUES (2, '研发部门', 'RD001', 1, '0,1', 1, 1, 2, NULL, 2, '2022-04-19 12:46:37', 0);
  60. INSERT INTO `sys_dept` VALUES (3, '测试部门', 'QA001', 1, '0,1', 1, 1, 2, NULL, 2, '2022-04-19 12:46:37', 0);
  61. -- ----------------------------
  62. -- Table structure for sys_dict
  63. -- ----------------------------
  64. DROP TABLE IF EXISTS `sys_dict`;
  65. CREATE TABLE `sys_dict` (
  66. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键 ',
  67. `dict_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '字典编码',
  68. `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '类型编码',
  69. `status` tinyint(1) DEFAULT '0' COMMENT '状态(0:正常,1:禁用)',
  70. `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  71. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  72. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  73. `is_deleted` tinyint DEFAULT '0' COMMENT '是否删除(0:未删除,1:已删除)',
  74. PRIMARY KEY (`id`) USING BTREE
  75. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC COMMENT='系统字典表';
  76. -- ----------------------------
  77. -- Records of sys_dict
  78. -- ----------------------------
  79. INSERT INTO `sys_dict` VALUES (1, 'gender', '性别', 1, NULL, now() , now(), 0);
  80. INSERT INTO `sys_dict` VALUES (2, 'notice_type', '通知类型', 1, NULL, now(), now(), 0);
  81. INSERT INTO `sys_dict` VALUES (3, 'notice_level', '通知级别', 1, NULL, now(), now(), 0);
  82. -- ----------------------------
  83. -- Table structure for sys_dict_data
  84. -- ----------------------------
  85. DROP TABLE IF EXISTS `sys_dict_data`;
  86. CREATE TABLE `sys_dict_data` (
  87. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  88. `dict_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '关联字典编码,与sys_dict表中的dict_code对应',
  89. `value` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '字典项值',
  90. `label` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '字典项标签',
  91. `tag_type` varchar(50) COLLATE utf8_general_ci DEFAULT NULL COMMENT '标签类型,用于前端样式展示(如success、warning等)',
  92. `status` tinyint DEFAULT '0' COMMENT '状态(1-正常,0-禁用)',
  93. `sort` int DEFAULT '0' COMMENT '排序',
  94. `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '备注',
  95. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  96. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  97. PRIMARY KEY (`id`) USING BTREE
  98. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC COMMENT='字典数据表';
  99. -- ----------------------------
  100. -- Records of sys_dict_data
  101. -- ----------------------------
  102. INSERT INTO `sys_dict_data` VALUES (1, 'gender', '1', '男', 'primary', 1, 1, NULL, now(), now());
  103. INSERT INTO `sys_dict_data` VALUES (2, 'gender', '2', '女', 'danger', 1, 2, NULL, now(), now());
  104. INSERT INTO `sys_dict_data` VALUES (3, 'gender', '0', '保密', 'info', 1, 3, NULL, now(), now());
  105. INSERT INTO `sys_dict_data` VALUES (4, 'notice_type', '1', '系统升级', 'success', 1, 1, '', now(), now());
  106. INSERT INTO `sys_dict_data` VALUES (5, 'notice_type', '2', '系统维护', 'primary', 1, 2, '', now(), now());
  107. INSERT INTO `sys_dict_data` VALUES (6, 'notice_type', '3', '安全警告', 'danger', 1, 3, '', now(), now());
  108. INSERT INTO `sys_dict_data` VALUES (7, 'notice_type', '4', '假期通知', 'success', 1, 4, '', now(), now());
  109. INSERT INTO `sys_dict_data` VALUES (8, 'notice_type', '5', '公司新闻', 'primary', 1, 5, '', now(), now());
  110. INSERT INTO `sys_dict_data` VALUES (9, 'notice_type', '99', '其他', 'info', 1, 99, '', now(), now());
  111. INSERT INTO `sys_dict_data` VALUES (10, 'notice_level', 'L', '低', 'info', 1, 1, '', now(), now());
  112. INSERT INTO `sys_dict_data` VALUES (11, 'notice_level', 'M', '中', 'warning', 1, 2, '', now(), now());
  113. INSERT INTO `sys_dict_data` VALUES (12, 'notice_level', 'H', '高', 'danger', 1, 3, '', now(), now());
  114. -- ----------------------------
  115. -- Table structure for sys_log
  116. -- ----------------------------
  117. DROP TABLE IF EXISTS `sys_log`;
  118. CREATE TABLE `sys_log` (
  119. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  120. `type` tinyint NULL DEFAULT NULL COMMENT '日志类型(1-操作日志 2-登录日志)',
  121. `title` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '日志标题',
  122. `ip` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'IP地址',
  123. `content` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '日志内容',
  124. `create_by` bigint NULL DEFAULT NULL COMMENT '创建人ID',
  125. `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  126. `update_by` bigint NULL DEFAULT NULL COMMENT '修改人ID',
  127. `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  128. `is_deleted` tinyint NOT NULL DEFAULT 0 COMMENT '逻辑删除标识(1-已删除 0-未删除)',
  129. PRIMARY KEY (`id`) USING BTREE
  130. ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统日志' ROW_FORMAT = DYNAMIC;
  131. -- ----------------------------
  132. -- Records of sys_log
  133. -- ----------------------------
  134. -- ----------------------------
  135. -- Table structure for sys_menu
  136. -- ----------------------------
  137. DROP TABLE IF EXISTS `sys_menu`;
  138. CREATE TABLE `sys_menu` (
  139. `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
  140. `parent_id` bigint NOT NULL COMMENT '父菜单ID',
  141. `tree_path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '父节点ID路径',
  142. `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '菜单名称',
  143. `type` tinyint NOT NULL COMMENT '菜单类型(1-菜单 2-目录 3-外链 4-按钮)',
  144. `route_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '路由名称(Vue Router 中用于命名路由)',
  145. `route_path` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '路由路径(Vue Router 中定义的 URL 路径)',
  146. `component` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组件路径(组件页面完整路径,相对于 src/views/,缺省后缀 .vue)',
  147. `perm` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '【按钮】权限标识',
  148. `always_show` tinyint NULL DEFAULT 0 COMMENT '【目录】只有一个子路由是否始终显示(1-是 0-否)',
  149. `keep_alive` tinyint NULL DEFAULT 0 COMMENT '【菜单】是否开启页面缓存(1-是 0-否)',
  150. `visible` tinyint(1) NOT NULL DEFAULT 1 COMMENT '显示状态(1-显示 0-隐藏)',
  151. `sort` int NULL DEFAULT 0 COMMENT '排序',
  152. `icon` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '菜单图标',
  153. `redirect` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '跳转路径',
  154. `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  155. `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  156. `params` json NULL COMMENT '路由参数',
  157. PRIMARY KEY (`id`) USING BTREE
  158. ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '菜单管理' ROW_FORMAT = DYNAMIC;
  159. -- ----------------------------
  160. -- Records of sys_menu
  161. -- ----------------------------
  162. INSERT INTO `sys_menu` VALUES (1, 0, '0', '系统管理', 2, '', '/system', 'Layout', NULL, NULL, NULL, 1, 1, 'system', '/system/user', now(), now(), NULL);
  163. INSERT INTO `sys_menu` VALUES (2, 1, '0,1', '用户管理', 1, 'User', 'user', 'system/user/index', NULL, NULL, 1, 1, 1, 'el-icon-User', NULL, now(), now(), NULL);
  164. INSERT INTO `sys_menu` VALUES (3, 1, '0,1', '角色管理', 1, 'Role', 'role', 'system/role/index', NULL, NULL, 1, 1, 2, 'role', NULL, now(), now(), NULL);
  165. INSERT INTO `sys_menu` VALUES (4, 1, '0,1', '菜单管理', 1, 'Menu', 'menu', 'system/menu/index', NULL, NULL, 1, 1, 3, 'menu', NULL, now(), now(), NULL);
  166. INSERT INTO `sys_menu` VALUES (5, 1, '0,1', '部门管理', 1, 'Dept', 'dept', 'system/dept/index', NULL, NULL, 1, 1, 4, 'tree', NULL, now(), now(), NULL);
  167. INSERT INTO `sys_menu` VALUES (6, 1, '0,1', '字典管理', 1, 'Dict', 'dict', 'system/dict/index', NULL, NULL, 1, 1, 5, 'dict', NULL, now(), now(), NULL);
  168. INSERT INTO `sys_menu` VALUES (20, 0, '0', '多级菜单', 2, NULL, '/multi-level', 'Layout', NULL, 1, NULL, 1, 9, 'cascader', '', now(), now(), NULL);
  169. INSERT INTO `sys_menu` VALUES (21, 20, '0,20', '菜单一级', 1, NULL, 'multi-level1', 'demo/multi-level/level1', NULL, 1, NULL, 1, 1, '', '', now(), now(), NULL);
  170. INSERT INTO `sys_menu` VALUES (22, 21, '0,20,21', '菜单二级', 1, NULL, 'multi-level2', 'demo/multi-level/children/level2', NULL, 0, NULL, 1, 1, '', NULL, now(), now(), NULL);
  171. INSERT INTO `sys_menu` VALUES (23, 22, '0,20,21,22', '菜单三级-1', 1, NULL, 'multi-level3-1', 'demo/multi-level/children/children/level3-1', NULL, 0, 1, 1, 1, '', '', now(), now(), NULL);
  172. INSERT INTO `sys_menu` VALUES (24, 22, '0,20,21,22', '菜单三级-2', 1, NULL, 'multi-level3-2', 'demo/multi-level/children/children/level3-2', NULL, 0, 1, 1, 2, '', '', now(), now(), NULL);
  173. INSERT INTO `sys_menu` VALUES (26, 0, '0', '平台文档', 2, NULL, '/doc', 'Layout', NULL, NULL, NULL, 1, 8, 'document', 'https://juejin.cn/post/7228990409909108793', now(), now(), NULL);
  174. INSERT INTO `sys_menu` VALUES (30, 26, '0,26', '平台文档(外链)', 3, NULL, 'https://juejin.cn/post/7228990409909108793', '', NULL, NULL, NULL, 1, 2, 'link', '', now(), now(), NULL);
  175. INSERT INTO `sys_menu` VALUES (31, 2, '0,1,2', '用户新增', 4, NULL, '', NULL, 'sys:user:add', NULL, NULL, 1, 1, '', '', now(), now(), NULL);
  176. INSERT INTO `sys_menu` VALUES (32, 2, '0,1,2', '用户编辑', 4, NULL, '', NULL, 'sys:user:edit', NULL, NULL, 1, 2, '', '', now(), now(), NULL);
  177. INSERT INTO `sys_menu` VALUES (33, 2, '0,1,2', '用户删除', 4, NULL, '', NULL, 'sys:user:delete', NULL, NULL, 1, 3, '', '', now(), now(), NULL);
  178. INSERT INTO `sys_menu` VALUES (36, 0, '0', '组件封装', 2, NULL, '/component', 'Layout', NULL, NULL, NULL, 1, 10, 'menu', '', now(), now(), NULL);
  179. INSERT INTO `sys_menu` VALUES (37, 36, '0,36', '富文本编辑器', 1, NULL, 'wang-editor', 'demo/wang-editor', NULL, NULL, 1, 1, 2, '', '', NULL, NULL, NULL);
  180. INSERT INTO `sys_menu` VALUES (38, 36, '0,36', '图片上传', 1, NULL, 'upload', 'demo/upload', NULL, NULL, 1, 1, 3, '', '', now(), now(), NULL);
  181. INSERT INTO `sys_menu` VALUES (39, 36, '0,36', '图标选择器', 1, NULL, 'icon-selector', 'demo/icon-selector', NULL, NULL, 1, 1, 4, '', '', now(), now(), NULL);
  182. INSERT INTO `sys_menu` VALUES (40, 0, '0', '接口文档', 2, NULL, '/api', 'Layout', NULL, 1, NULL, 1, 7, 'api', '', now(), now(), NULL);
  183. INSERT INTO `sys_menu` VALUES (41, 40, '0,40', 'Apifox', 1, NULL, 'apifox', 'demo/api/apifox', NULL, NULL, 1, 1, 1, 'api', '', now(), now(), NULL);
  184. INSERT INTO `sys_menu` VALUES (70, 3, '0,1,3', '角色新增', 4, NULL, '', NULL, 'sys:role:add', NULL, NULL, 1, 1, '', NULL, now(), now(), NULL);
  185. INSERT INTO `sys_menu` VALUES (71, 3, '0,1,3', '角色编辑', 4, NULL, '', NULL, 'sys:role:edit', NULL, NULL, 1, 2, '', NULL, now(), now(), NULL);
  186. INSERT INTO `sys_menu` VALUES (72, 3, '0,1,3', '角色删除', 4, NULL, '', NULL, 'sys:role:delete', NULL, NULL, 1, 3, '', NULL, now(), now(), NULL);
  187. INSERT INTO `sys_menu` VALUES (73, 4, '0,1,4', '菜单新增', 4, NULL, '', NULL, 'sys:menu:add', NULL, NULL, 1, 1, '', NULL, now(), now(), NULL);
  188. INSERT INTO `sys_menu` VALUES (74, 4, '0,1,4', '菜单编辑', 4, NULL, '', NULL, 'sys:menu:edit', NULL, NULL, 1, 3, '', NULL, now(), now(), NULL);
  189. INSERT INTO `sys_menu` VALUES (75, 4, '0,1,4', '菜单删除', 4, NULL, '', NULL, 'sys:menu:delete', NULL, NULL, 1, 3, '', NULL, now(), now(), NULL);
  190. INSERT INTO `sys_menu` VALUES (76, 5, '0,1,5', '部门新增', 4, NULL, '', NULL, 'sys:dept:add', NULL, NULL, 1, 1, '', NULL, now(), now(), NULL);
  191. INSERT INTO `sys_menu` VALUES (77, 5, '0,1,5', '部门编辑', 4, NULL, '', NULL, 'sys:dept:edit', NULL, NULL, 1, 2, '', NULL, now(), now(), NULL);
  192. INSERT INTO `sys_menu` VALUES (78, 5, '0,1,5', '部门删除', 4, NULL, '', NULL, 'sys:dept:delete', NULL, NULL, 1, 3, '', NULL, now(), now(), NULL);
  193. INSERT INTO `sys_menu` VALUES (79, 6, '0,1,6', '字典新增', 4, NULL, '', NULL, 'sys:dict:add', NULL, NULL, 1, 1, '', NULL,now(),now(), NULL);
  194. INSERT INTO `sys_menu` VALUES (81, 6, '0,1,6', '字典编辑', 4, NULL, '', NULL, 'sys:dict:edit', NULL, NULL, 1, 2, '', NULL, now(), now(), NULL);
  195. INSERT INTO `sys_menu` VALUES (84, 6, '0,1,6', '字典删除', 4, NULL, '', NULL, 'sys:dict:delete', NULL, NULL, 1, 3, '', NULL,now(),now(), NULL);
  196. INSERT INTO `sys_menu` VALUES (88, 2, '0,1,2', '重置密码', 4, NULL, '', NULL, 'sys:user:password:reset', NULL, NULL, 1, 4, '', NULL, now(), now(), NULL);
  197. INSERT INTO `sys_menu` VALUES (89, 0, '0', '功能演示', 2, NULL, '/function', 'Layout', NULL, NULL, NULL, 1, 12, 'menu', '', now(), now(), NULL);
  198. INSERT INTO `sys_menu` VALUES (90, 89, '0,89', 'Websocket', 1, NULL, '/function/websocket', 'demo/websocket', NULL, NULL, 1, 1, 3, '', '', now(), now(), NULL);
  199. INSERT INTO `sys_menu` VALUES (91, 89, '0,89', '敬请期待...', 2, NULL, 'other/:id', 'demo/other', NULL, NULL, NULL, 1, 4, '', '', now(), now(), NULL);
  200. INSERT INTO `sys_menu` VALUES (95, 36, '0,36', '字典组件', 1, NULL, 'dict-demo', 'demo/dict', NULL, NULL, 1, 1, 4, '', '', now(), now(), NULL);
  201. INSERT INTO `sys_menu` VALUES (97, 89, '0,89', 'Icons', 1, NULL, 'icon-demo', 'demo/icons', NULL, NULL, 1, 1, 2, 'el-icon-Notification', '', now(), now(), NULL);
  202. INSERT INTO `sys_menu` VALUES (102, 26, '0,26', '平台文档(内嵌)', 3, NULL, 'internal-doc', 'demo/internal-doc', NULL, NULL, NULL, 1, 1, 'document', '', now(), now(), NULL);
  203. INSERT INTO `sys_menu` VALUES (105, 2, '0,1,2', '用户查询', 4, NULL, '', NULL, 'sys:user:query', 0, 0, 1, 0, '', NULL, now(), now(), NULL);
  204. INSERT INTO `sys_menu` VALUES (106, 2, '0,1,2', '用户导入', 4, NULL, '', NULL, 'sys:user:import', NULL, NULL, 1, 5, '', NULL, now(), now(), NULL);
  205. INSERT INTO `sys_menu` VALUES (107, 2, '0,1,2', '用户导出', 4, NULL, '', NULL, 'sys:user:export', NULL, NULL, 1, 6, '', NULL, now(), now(), NULL);
  206. INSERT INTO `sys_menu` VALUES (108, 36, '0,36', '增删改查', 1, NULL, 'curd', 'demo/curd/index', NULL, NULL, 1, 1, 0, '', '', NULL, NULL, NULL);
  207. INSERT INTO `sys_menu` VALUES (109, 36, '0,36', '列表选择器', 1, NULL, 'table-select', 'demo/table-select/index', NULL, NULL, 1, 1, 1, '', '', NULL, NULL, NULL);
  208. INSERT INTO `sys_menu` VALUES (110, 0, '0', '路由参数', 2, NULL, '/route-param', 'Layout', NULL, 1, 1, 1, 11, 'el-icon-ElementPlus', NULL, now(), now(), NULL);
  209. INSERT INTO `sys_menu` VALUES (111, 110, '0,110', '参数(type=1)', 1, NULL, 'route-param-type1', 'demo/route-param', NULL, 0, 1, 1, 1, 'el-icon-Star', NULL, now(), now(), '{\"type\": \"1\"}');
  210. INSERT INTO `sys_menu` VALUES (112, 110, '0,110', '参数(type=2)', 1, NULL, 'route-param-type2', 'demo/route-param', NULL, 0, 1, 1, 2, 'el-icon-StarFilled', NULL, now(), now(), '{\"type\": \"2\"}');
  211. INSERT INTO `sys_menu` VALUES (117, 1, '0,1', '系统日志', 1, 'Log', 'log', 'system/log/index', NULL, 0, 1, 1, 6, 'document', NULL, now(), now(),NULL);
  212. INSERT INTO `sys_menu` VALUES (118, 0, '0', '系统工具', 2, NULL, '/codegen', 'Layout', NULL, 0, 1, 1, 2, 'menu', NULL,now(),now(), NULL);
  213. INSERT INTO `sys_menu` VALUES (119, 118, '0,118', '代码生成', 1, 'Codegen', 'codegen', 'codegen/index', NULL, 0, 1, 1, 1, 'code', NULL, now(), now(), NULL);
  214. INSERT INTO `sys_menu` VALUES (120,1,'0,1','系统配置',1,'Config','config','system/config/index',NULL,0,1,1,7,'setting',NULL,now(),now(),NULL);
  215. INSERT INTO `sys_menu` VALUES (121,120,'0,1,120','查询系统配置',4,NULL,'',NULL,'sys:config:query',0,1,1,1,'',NULL,now(),now(),NULL);
  216. INSERT INTO `sys_menu` VALUES (122,120,'0,1,120','新增系统配置',4,NULL,'',NULL,'sys:config:add',0,1,1,2,'',NULL,now(),now(),NULL);
  217. INSERT INTO `sys_menu` VALUES (123,120,'0,1,120','修改系统配置',4,NULL,'',NULL,'sys:config:update',0,1,1,3,'',NULL,now(),now(),NULL);
  218. INSERT INTO `sys_menu` VALUES (124,120,'0,1,120','删除系统配置',4,NULL,'',NULL,'sys:config:delete',0,1,1,4,'',NULL,now(),now(),NULL);
  219. INSERT INTO `sys_menu` VALUES (125,120,'0,1,120','刷新系统配置',4,NULL,'',NULL,'sys:config:refresh',0,1,1,5,'',NULL,now(),now(),NULL);
  220. INSERT INTO `sys_menu` VALUES (126,1,'0,1','通知公告',1,'Notice','notice','system/notice/index',NULL,NULL,NULL,1,9,'',NULL,now(),now(),NULL);
  221. INSERT INTO `sys_menu` VALUES (127,126,'0,1,126','查询',4,NULL,'',NULL,'sys:notice:query',NULL,NULL,1,1,'',NULL,now(),now(),NULL);
  222. INSERT INTO `sys_menu` VALUES (128,126,'0,1,126','新增',4,NULL,'',NULL,'sys:notice:add',NULL,NULL,1,2,'',NULL,now(),now(),NULL);
  223. INSERT INTO `sys_menu` VALUES (129,126,'0,1,126','编辑',4,NULL,'',NULL,'sys:notice:edit',NULL,NULL,1,3,'',NULL,now(),now(),NULL);
  224. INSERT INTO `sys_menu` VALUES (130,126,'0,1,126','删除',4,NULL,'',NULL,'sys:notice:delete',NULL,NULL,1,4,'',NULL,now(),now(),NULL);
  225. INSERT INTO `sys_menu` VALUES (133,126,'0,1,126','发布',4,NULL,'',NULL,'sys:notice:publish',0,1,1,5,'',NULL,now(),now(),NULL);
  226. INSERT INTO `sys_menu` VALUES (134,126,'0,1,126','撤回',4,NULL,'',NULL,'sys:notice:revoke',0,1,1,6,'',NULL,now(),now(),NULL);
  227. INSERT INTO `sys_menu` VALUES (135, 1, '0,1', '字典数据', 1, 'DictData', 'dict-data', 'system/dict/data', NULL, 0, 1, 0, 6, '', NULL, now(), now(), NULL);
  228. INSERT INTO `sys_menu` VALUES (136, 135, '0,1,135', '字典数据新增', 4, NULL, '', NULL, 'sys:dict:add', NULL, NULL, 1, 4, '', NULL, now(), now(), NULL);
  229. INSERT INTO `sys_menu` VALUES (137, 135, '0,1,135', '字典数据编辑', 4, NULL, '', NULL, 'sys:dict:edit', NULL, NULL, 1, 5, '', NULL, now(), now(), NULL);
  230. INSERT INTO `sys_menu` VALUES (138, 135, '0,1,135', '字典数据删除', 4, NULL, '', NULL, 'sys:dict:delete', NULL, NULL, 1, 6, '', NULL, now(), now(), NULL);
  231. -- ----------------------------
  232. -- Table structure for sys_message
  233. -- ----------------------------
  234. DROP TABLE IF EXISTS `sys_message`;
  235. CREATE TABLE `sys_message` (
  236. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  237. `create_by` bigint NULL DEFAULT NULL COMMENT '创建人ID',
  238. `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  239. `update_by` bigint NULL DEFAULT NULL COMMENT '修改人ID',
  240. `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  241. `is_deleted` tinyint NOT NULL DEFAULT 0 COMMENT '逻辑删除标识(1-已删除 0-未删除)',
  242. PRIMARY KEY (`id`) USING BTREE
  243. ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统消息' ROW_FORMAT = DYNAMIC;
  244. -- ----------------------------
  245. -- Records of sys_message
  246. -- ----------------------------
  247. -- ----------------------------
  248. -- Table structure for sys_role
  249. -- ----------------------------
  250. DROP TABLE IF EXISTS `sys_role`;
  251. CREATE TABLE `sys_role` (
  252. `id` bigint NOT NULL AUTO_INCREMENT,
  253. `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '角色名称',
  254. `code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '角色编码',
  255. `sort` int NULL DEFAULT NULL COMMENT '显示顺序',
  256. `status` tinyint(1) NULL DEFAULT 1 COMMENT '角色状态(1-正常 0-停用)',
  257. `data_scope` tinyint NULL DEFAULT NULL COMMENT '数据权限(0-所有数据 1-部门及子部门数据 2-本部门数据3-本人数据)',
  258. `create_by` bigint NULL DEFAULT NULL COMMENT '创建人 ID',
  259. `create_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  260. `update_by` bigint NULL DEFAULT NULL COMMENT '更新人ID',
  261. `update_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  262. `is_deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除标识(0-未删除 1-已删除)',
  263. PRIMARY KEY (`id`) USING BTREE,
  264. UNIQUE INDEX `uk_name`(`name` ASC) USING BTREE COMMENT '角色名称唯一索引',
  265. UNIQUE INDEX `uk_code`(`code` ASC) USING BTREE COMMENT '角色编码唯一索引'
  266. ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色表' ROW_FORMAT = DYNAMIC;
  267. -- ----------------------------
  268. -- Records of sys_role
  269. -- ----------------------------
  270. INSERT INTO `sys_role` VALUES (1, '超级管理员', 'ROOT', 1, 1, 0, NULL, '2021-05-21 14:56:51', NULL, '2018-12-23 16:00:00', 0);
  271. INSERT INTO `sys_role` VALUES (2, '系统管理员', 'ADMIN', 2, 1, 1, NULL, '2021-03-25 12:39:54', NULL, NULL, 0);
  272. INSERT INTO `sys_role` VALUES (3, '访问游客', 'GUEST', 3, 1, 2, NULL, '2021-05-26 15:49:05', NULL, '2019-05-05 16:00:00', 0);
  273. INSERT INTO `sys_role` VALUES (4, '系统管理员1', 'ADMIN1', 4, 1, 1, NULL, '2021-03-25 12:39:54', NULL, NULL, 0);
  274. INSERT INTO `sys_role` VALUES (5, '系统管理员2', 'ADMIN2', 5, 1, 1, NULL, '2021-03-25 12:39:54', NULL, NULL, 0);
  275. INSERT INTO `sys_role` VALUES (6, '系统管理员3', 'ADMIN3', 6, 1, 1, NULL, '2021-03-25 12:39:54', NULL, NULL, 0);
  276. INSERT INTO `sys_role` VALUES (7, '系统管理员4', 'ADMIN4', 7, 1, 1, NULL, '2021-03-25 12:39:54', NULL, NULL, 0);
  277. INSERT INTO `sys_role` VALUES (8, '系统管理员5', 'ADMIN5', 8, 1, 1, NULL, '2021-03-25 12:39:54', NULL, NULL, 0);
  278. INSERT INTO `sys_role` VALUES (9, '系统管理员6', 'ADMIN6', 9, 1, 1, NULL, '2021-03-25 12:39:54', NULL, NULL, 0);
  279. INSERT INTO `sys_role` VALUES (10, '系统管理员7', 'ADMIN7', 10, 1, 1, NULL, '2021-03-25 12:39:54', NULL, NULL, 0);
  280. INSERT INTO `sys_role` VALUES (11, '系统管理员8', 'ADMIN8', 11, 1, 1, NULL, '2021-03-25 12:39:54', NULL, NULL, 0);
  281. INSERT INTO `sys_role` VALUES (12, '系统管理员9', 'ADMIN9', 12, 1, 1, NULL, '2021-03-25 12:39:54', NULL, NULL, 0);
  282. -- ----------------------------
  283. -- Table structure for sys_role_menu
  284. -- ----------------------------
  285. DROP TABLE IF EXISTS `sys_role_menu`;
  286. CREATE TABLE `sys_role_menu` (
  287. `role_id` bigint NOT NULL COMMENT '角色ID',
  288. `menu_id` bigint NOT NULL COMMENT '菜单ID',
  289. UNIQUE INDEX `uk_roleid_menuid`(`role_id` ASC, `menu_id` ASC) USING BTREE COMMENT '角色菜单唯一索引'
  290. ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '角色和菜单关联表' ROW_FORMAT = DYNAMIC;
  291. -- ----------------------------
  292. -- Records of sys_role_menu
  293. -- ----------------------------
  294. INSERT INTO `sys_role_menu` VALUES (2, 1);
  295. INSERT INTO `sys_role_menu` VALUES (2, 2);
  296. INSERT INTO `sys_role_menu` VALUES (2, 3);
  297. INSERT INTO `sys_role_menu` VALUES (2, 4);
  298. INSERT INTO `sys_role_menu` VALUES (2, 5);
  299. INSERT INTO `sys_role_menu` VALUES (2, 6);
  300. INSERT INTO `sys_role_menu` VALUES (2, 20);
  301. INSERT INTO `sys_role_menu` VALUES (2, 21);
  302. INSERT INTO `sys_role_menu` VALUES (2, 22);
  303. INSERT INTO `sys_role_menu` VALUES (2, 23);
  304. INSERT INTO `sys_role_menu` VALUES (2, 24);
  305. INSERT INTO `sys_role_menu` VALUES (2, 26);
  306. INSERT INTO `sys_role_menu` VALUES (2, 30);
  307. INSERT INTO `sys_role_menu` VALUES (2, 31);
  308. INSERT INTO `sys_role_menu` VALUES (2, 32);
  309. INSERT INTO `sys_role_menu` VALUES (2, 33);
  310. INSERT INTO `sys_role_menu` VALUES (2, 36);
  311. INSERT INTO `sys_role_menu` VALUES (2, 37);
  312. INSERT INTO `sys_role_menu` VALUES (2, 38);
  313. INSERT INTO `sys_role_menu` VALUES (2, 39);
  314. INSERT INTO `sys_role_menu` VALUES (2, 40);
  315. INSERT INTO `sys_role_menu` VALUES (2, 41);
  316. INSERT INTO `sys_role_menu` VALUES (2, 70);
  317. INSERT INTO `sys_role_menu` VALUES (2, 71);
  318. INSERT INTO `sys_role_menu` VALUES (2, 72);
  319. INSERT INTO `sys_role_menu` VALUES (2, 73);
  320. INSERT INTO `sys_role_menu` VALUES (2, 74);
  321. INSERT INTO `sys_role_menu` VALUES (2, 75);
  322. INSERT INTO `sys_role_menu` VALUES (2, 76);
  323. INSERT INTO `sys_role_menu` VALUES (2, 77);
  324. INSERT INTO `sys_role_menu` VALUES (2, 78);
  325. INSERT INTO `sys_role_menu` VALUES (2, 79);
  326. INSERT INTO `sys_role_menu` VALUES (2, 81);
  327. INSERT INTO `sys_role_menu` VALUES (2, 84);
  328. INSERT INTO `sys_role_menu` VALUES (2, 85);
  329. INSERT INTO `sys_role_menu` VALUES (2, 86);
  330. INSERT INTO `sys_role_menu` VALUES (2, 87);
  331. INSERT INTO `sys_role_menu` VALUES (2, 88);
  332. INSERT INTO `sys_role_menu` VALUES (2, 89);
  333. INSERT INTO `sys_role_menu` VALUES (2, 90);
  334. INSERT INTO `sys_role_menu` VALUES (2, 91);
  335. INSERT INTO `sys_role_menu` VALUES (2, 95);
  336. INSERT INTO `sys_role_menu` VALUES (2, 97);
  337. INSERT INTO `sys_role_menu` VALUES (2, 102);
  338. INSERT INTO `sys_role_menu` VALUES (2, 105);
  339. INSERT INTO `sys_role_menu` VALUES (2, 106);
  340. INSERT INTO `sys_role_menu` VALUES (2, 107);
  341. INSERT INTO `sys_role_menu` VALUES (2, 108);
  342. INSERT INTO `sys_role_menu` VALUES (2, 109);
  343. INSERT INTO `sys_role_menu` VALUES (2, 110);
  344. INSERT INTO `sys_role_menu` VALUES (2, 111);
  345. INSERT INTO `sys_role_menu` VALUES (2, 112);
  346. INSERT INTO `sys_role_menu` VALUES (2, 114);
  347. INSERT INTO `sys_role_menu` VALUES (2, 115);
  348. INSERT INTO `sys_role_menu` VALUES (2, 116);
  349. INSERT INTO `sys_role_menu` VALUES (2, 117);
  350. INSERT INTO `sys_role_menu` VALUES (2, 118);
  351. INSERT INTO `sys_role_menu` VALUES (2, 119);
  352. INSERT INTO `sys_role_menu` VALUES (2, 120);
  353. INSERT INTO `sys_role_menu` VALUES (2, 121);
  354. INSERT INTO `sys_role_menu` VALUES (2, 122);
  355. INSERT INTO `sys_role_menu` VALUES (2, 123);
  356. INSERT INTO `sys_role_menu` VALUES (2, 124);
  357. INSERT INTO `sys_role_menu` VALUES (2, 125);
  358. INSERT INTO `sys_role_menu` VALUES (2, 126);
  359. INSERT INTO `sys_role_menu` VALUES (2, 127);
  360. INSERT INTO `sys_role_menu` VALUES (2, 128);
  361. INSERT INTO `sys_role_menu` VALUES (2, 129);
  362. INSERT INTO `sys_role_menu` VALUES (2, 130);
  363. INSERT INTO `sys_role_menu` VALUES (2, 131);
  364. INSERT INTO `sys_role_menu` VALUES (2, 132);
  365. INSERT INTO `sys_role_menu` VALUES (2, 133);
  366. INSERT INTO `sys_role_menu` VALUES (2, 134);
  367. INSERT INTO `sys_role_menu` VALUES (2, 135);
  368. INSERT INTO `sys_role_menu` VALUES (2, 136);
  369. INSERT INTO `sys_role_menu` VALUES (2, 137);
  370. INSERT INTO `sys_role_menu` VALUES (2, 138);
  371. -- ----------------------------
  372. -- Table structure for sys_user
  373. -- ----------------------------
  374. DROP TABLE IF EXISTS `sys_user`;
  375. CREATE TABLE `sys_user` (
  376. `id` int NOT NULL AUTO_INCREMENT,
  377. `username` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名',
  378. `nickname` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '昵称',
  379. `gender` tinyint(1) NULL DEFAULT 1 COMMENT '性别((1-男 2-女 0-保密)',
  380. `password` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '密码',
  381. `dept_id` int NULL DEFAULT NULL COMMENT '部门ID',
  382. `avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '用户头像',
  383. `mobile` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '联系方式',
  384. `status` tinyint(1) NULL DEFAULT 1 COMMENT '状态((1-正常 0-禁用)',
  385. `email` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户邮箱',
  386. `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
  387. `create_by` bigint NULL DEFAULT NULL COMMENT '创建人ID',
  388. `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
  389. `update_by` bigint NULL DEFAULT NULL COMMENT '修改人ID',
  390. `is_deleted` tinyint(1) NULL DEFAULT 0 COMMENT '逻辑删除标识(0-未删除 1-已删除)',
  391. PRIMARY KEY (`id`) USING BTREE,
  392. UNIQUE INDEX `login_name`(`username` ASC) USING BTREE
  393. ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户信息表' ROW_FORMAT = DYNAMIC;
  394. -- ----------------------------
  395. -- Records of sys_user
  396. -- ----------------------------
  397. INSERT INTO `sys_user` VALUES (1, 'root', '有来技术', 0, '$2a$10$xVWsNOhHrCxh5UbpCE7/HuJ.PAOKcYAqRxD2CO2nVnJS.IAXkr5aq', NULL, 'https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif', '18866668888', 1, 'youlaitech@163.com', NULL, NULL, NULL, NULL, 0);
  398. INSERT INTO `sys_user` VALUES (2, 'admin', '系统管理员', 1, '$2a$10$xVWsNOhHrCxh5UbpCE7/HuJ.PAOKcYAqRxD2CO2nVnJS.IAXkr5aq', 1, 'https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif', '18866668887', 1, '', '2019-10-10 13:41:22', NULL, '2022-07-31 12:39:30', NULL, 0);
  399. INSERT INTO `sys_user` VALUES (3, 'websocket', '测试小用户', 1, '$2a$10$xVWsNOhHrCxh5UbpCE7/HuJ.PAOKcYAqRxD2CO2nVnJS.IAXkr5aq', 3, 'https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif', '18866668886', 1, 'youlaitech@163.com', '2021-06-05 01:31:29', NULL, '2021-06-05 01:31:29', NULL, 0);
  400. -- ----------------------------
  401. -- Table structure for sys_user_role
  402. -- ----------------------------
  403. DROP TABLE IF EXISTS `sys_user_role`;
  404. CREATE TABLE `sys_user_role` (
  405. `user_id` bigint NOT NULL COMMENT '用户ID',
  406. `role_id` bigint NOT NULL COMMENT '角色ID',
  407. PRIMARY KEY (`user_id`, `role_id`) USING BTREE,
  408. UNIQUE INDEX `uk_userid_roleid`(`user_id` ASC, `role_id` ASC) USING BTREE COMMENT '用户角色唯一索引'
  409. ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户和角色关联表' ROW_FORMAT = DYNAMIC;
  410. -- ----------------------------
  411. -- Records of sys_user_role
  412. -- ----------------------------
  413. INSERT INTO `sys_user_role` VALUES (1, 1);
  414. INSERT INTO `sys_user_role` VALUES (2, 2);
  415. INSERT INTO `sys_user_role` VALUES (3, 3);
  416. -- ----------------------------
  417. -- Table structure for sys_log
  418. -- ----------------------------
  419. DROP TABLE IF EXISTS `sys_log`;
  420. CREATE TABLE `sys_log` (
  421. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  422. `module` enum('LOGIN','USER','ROLE','DEPT','MENU','DICT','OTHER') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '日志模块',
  423. `content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '日志内容',
  424. `request_uri` varchar(255) COLLATE utf8_general_ci DEFAULT NULL COMMENT '请求路径',
  425. `ip` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'IP地址',
  426. `province` varchar(100) COLLATE utf8_general_ci DEFAULT NULL COMMENT '省份',
  427. `city` varchar(100) COLLATE utf8_general_ci DEFAULT NULL COMMENT '城市',
  428. `execution_time` bigint DEFAULT NULL COMMENT '执行时间(ms)',
  429. `browser` varchar(100) COLLATE utf8_general_ci DEFAULT NULL COMMENT '浏览器',
  430. `browser_version` varchar(100) COLLATE utf8_general_ci DEFAULT NULL COMMENT '浏览器版本',
  431. `os` varchar(100) COLLATE utf8_general_ci DEFAULT NULL COMMENT '终端系统',
  432. `create_by` bigint DEFAULT NULL COMMENT '创建人ID',
  433. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  434. `is_deleted` tinyint NOT NULL DEFAULT '0' COMMENT '逻辑删除标识(1-已删除 0-未删除)',
  435. PRIMARY KEY (`id`) USING BTREE
  436. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC COMMENT='系统日志表';
  437. -- ----------------------------
  438. -- Table structure for gen_config
  439. -- ----------------------------
  440. DROP TABLE IF EXISTS `gen_config`;
  441. CREATE TABLE `gen_config` (
  442. `id` bigint NOT NULL AUTO_INCREMENT,
  443. `table_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_0900_ai_ci NOT NULL COMMENT '表名',
  444. `module_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_0900_ai_ci DEFAULT NULL COMMENT '模块名',
  445. `package_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_0900_ai_ci NOT NULL COMMENT '包名',
  446. `business_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_0900_ai_ci NOT NULL COMMENT '业务名',
  447. `entity_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_0900_ai_ci NOT NULL COMMENT '实体类名',
  448. `author` varchar(50) CHARACTER SET utf8 COLLATE utf8_0900_ai_ci NOT NULL COMMENT '作者',
  449. `parent_menu_id` bigint DEFAULT NULL COMMENT '上级菜单ID,对应sys_menu的id ',
  450. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  451. `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  452. `is_deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  453. PRIMARY KEY (`id`),
  454. UNIQUE KEY `uk_tablename` (`table_name`)
  455. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='代码生成基础配置表';
  456. -- ----------------------------
  457. -- Table structure for gen_field_config
  458. -- ----------------------------
  459. DROP TABLE IF EXISTS `gen_field_config`;
  460. CREATE TABLE `gen_field_config` (
  461. `id` bigint NOT NULL AUTO_INCREMENT,
  462. `config_id` bigint NOT NULL COMMENT '关联的配置ID',
  463. `column_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_0900_ai_ci DEFAULT NULL,
  464. `column_type` varchar(50) CHARACTER SET utf8 COLLATE utf8_0900_ai_ci DEFAULT NULL,
  465. `column_length` int DEFAULT NULL,
  466. `field_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_0900_ai_ci NOT NULL COMMENT '字段名称',
  467. `field_type` varchar(100) CHARACTER SET utf8 COLLATE utf8_0900_ai_ci DEFAULT NULL COMMENT '字段类型',
  468. `field_sort` int DEFAULT NULL COMMENT '字段排序',
  469. `field_comment` varchar(255) CHARACTER SET utf8 COLLATE utf8_0900_ai_ci DEFAULT NULL COMMENT '字段描述',
  470. `max_length` int NULL DEFAULT NULL,
  471. `is_required` tinyint(1) DEFAULT NULL COMMENT '是否必填',
  472. `is_show_in_list` tinyint(1) DEFAULT '0' COMMENT '是否在列表显示',
  473. `is_show_in_form` tinyint(1) DEFAULT '0' COMMENT '是否在表单显示',
  474. `is_show_in_query` tinyint(1) DEFAULT '0' COMMENT '是否在查询条件显示',
  475. `query_type` tinyint DEFAULT NULL COMMENT '查询方式',
  476. `form_type` tinyint DEFAULT NULL COMMENT '表单类型',
  477. `dict_type` varchar(50) CHARACTER SET utf8 COLLATE utf8_0900_ai_ci NULL DEFAULT NULL COMMENT '字典类型',
  478. `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  479. `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  480. PRIMARY KEY (`id`),
  481. KEY `config_id` (`config_id`)
  482. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='代码生成字段配置表';
  483. CREATE TABLE `sys_user_notice` (
  484. `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  485. `notice_id` bigint NOT NULL COMMENT '公共通知id',
  486. `user_id` bigint NOT NULL COMMENT '用户id',
  487. `is_read` bigint NOT NULL DEFAULT '0' COMMENT '读取状态(0未读;1已读)',
  488. `read_time` datetime DEFAULT NULL COMMENT '阅读时间',
  489. `create_time` datetime NOT NULL COMMENT '创建时间',
  490. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  491. `is_deleted` tinyint NOT NULL DEFAULT '0' COMMENT '逻辑删除(1-已删除;0-未删除)',
  492. PRIMARY KEY (`id`) USING BTREE
  493. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='用户通知公告表';
  494. CREATE TABLE `sys_notice` (
  495. `id` bigint NOT NULL AUTO_INCREMENT,
  496. `title` varchar(50) CHARACTER SET utf8 COLLATE utf8_0900_ai_ci DEFAULT NULL COMMENT '通知标题',
  497. `content` text CHARACTER SET utf8 COLLATE utf8_0900_ai_ci COMMENT '通知内容',
  498. `type` tinyint NOT NULL COMMENT '通知类型(字典code:notice_type)',
  499. `level` varchar(5) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '通知等级(字典code:notice_level)',
  500. `target_type` tinyint NOT NULL COMMENT '目标类型(1: 全体, 2: 指定)',
  501. `target_user_ids` varchar(255) CHARACTER SET utf8 COLLATE utf8_0900_ai_ci DEFAULT NULL COMMENT '目标人ID集合(多个使用英文逗号,分割)',
  502. `publisher_id` bigint DEFAULT NULL COMMENT '发布人ID',
  503. `publish_status` tinyint NOT NULL DEFAULT '0' COMMENT '发布状态(0: 未发布, 1: 已发布, -1: 已撤回)',
  504. `publish_time` datetime DEFAULT NULL COMMENT '发布时间',
  505. `revoke_time` datetime DEFAULT NULL COMMENT '撤回时间',
  506. `create_by` bigint NOT NULL COMMENT '创建人ID',
  507. `create_time` datetime NOT NULL COMMENT '创建时间',
  508. `update_by` bigint DEFAULT NULL COMMENT '更新人ID',
  509. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  510. `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除(0: 未删除, 1: 已删除)',
  511. PRIMARY KEY (`id`) USING BTREE
  512. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='通知公告表';
  513. SET FOREIGN_KEY_CHECKS = 1;
  514. -- 提交事务
  515. COMMIT;