jm-smart-city.sql 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /*
  2. Navicat MySQL Data Transfer
  3. Source Server : localhost
  4. Source Server Version : 50720
  5. Source Host : localhost:3306
  6. Source Database : mood-wall
  7. Target Server Type : MYSQL
  8. Target Server Version : 50720
  9. File Encoding : 65001
  10. Date: 2018-12-04 11:25:29
  11. */
  12. SET FOREIGN_KEY_CHECKS=0;
  13. -- ----------------------------
  14. -- Table structure for tb_data_dictionary
  15. -- ----------------------------
  16. DROP TABLE IF EXISTS `tb_data_dictionary`;
  17. CREATE TABLE `tb_data_dictionary` (
  18. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  19. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  20. `rec_status` varchar(2) DEFAULT NULL COMMENT '记录的状态,A: 生效,I: 禁用',
  21. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  22. `code` varchar(24) DEFAULT NULL COMMENT '数据字典code',
  23. `data_key` varchar(255) DEFAULT NULL COMMENT '数据字典key',
  24. `data_value` varchar(255) DEFAULT NULL COMMENT '数据字典value',
  25. `description` varchar(255) DEFAULT NULL COMMENT '描述',
  26. `param1` varchar(255) DEFAULT NULL COMMENT '备用,参数1',
  27. `param2` varchar(255) DEFAULT NULL COMMENT '备用,参数2',
  28. `param3` varchar(255) DEFAULT NULL COMMENT '备用,参数3',
  29. PRIMARY KEY (`id`)
  30. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='数据字典表';
  31. -- ----------------------------
  32. -- Records of tb_data_dictionary
  33. -- ----------------------------
  34. -- ----------------------------
  35. -- Table structure for tb_resource
  36. -- ----------------------------
  37. DROP TABLE IF EXISTS `tb_resource`;
  38. CREATE TABLE `tb_resource` (
  39. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  40. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  41. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  42. `description` varchar(255) DEFAULT NULL COMMENT '资源描述',
  43. `icon` varchar(10) DEFAULT NULL COMMENT '图标',
  44. `name` varchar(50) DEFAULT NULL COMMENT '资源名称',
  45. `url` varchar(255) DEFAULT NULL COMMENT '资源地址',
  46. `parent_id` bigint(20) DEFAULT NULL COMMENT '父资源id',
  47. `resource_type` enum('menu','button') DEFAULT NULL COMMENT '资源类型',
  48. `resource_key` varchar(255) DEFAULT NULL COMMENT '资源key',
  49. `rec_status` varchar(2) DEFAULT NULL COMMENT '记录的状态,A: 生效,I: 禁用',
  50. `sort` tinyint(4) DEFAULT NULL COMMENT '排序',
  51. PRIMARY KEY (`id`),
  52. KEY `FKf5ra2gn0xedeida2op8097sr5` (`parent_id`),
  53. CONSTRAINT `FKf5ra2gn0xedeida2op8097sr5` FOREIGN KEY (`parent_id`) REFERENCES `tb_resource` (`id`)
  54. ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COMMENT='资源表';
  55. -- ----------------------------
  56. -- Records of tb_resource
  57. -- ----------------------------
  58. INSERT INTO `tb_resource` VALUES ('1', '2018-05-10 17:18:36', '2018-05-10 17:22:42', null, '&#xe716', '系统管理', 'javascript:void(0);', null, 'menu', 'system', 'A', '1');
  59. INSERT INTO `tb_resource` VALUES ('2', '2018-05-11 10:05:41', '2018-12-04 11:22:02', null, '&#xe66f', '用户管理', '/admin/user/list', '1', 'menu', 'admin:user:list', 'A', '2');
  60. INSERT INTO `tb_resource` VALUES ('3', '2018-05-14 09:38:43', '2018-05-14 09:38:46', null, '&#xe66f', '用户添加', '/admin/user/add', '2', 'button', 'admin:user:add', 'A', '3');
  61. INSERT INTO `tb_resource` VALUES ('4', '2018-05-14 10:46:32', '2018-05-14 10:46:36', null, '&#xe66f', '用户编辑', '/admin/user/edit', '2', 'button', 'admin:user:edit', 'A', '4');
  62. INSERT INTO `tb_resource` VALUES ('5', '2018-05-14 12:03:20', '2018-05-14 12:03:30', null, '&#xe66f', '用户重置密码', '/admin/user/resetPass', '2', 'button', 'admin:user:resetPass', 'A', '5');
  63. INSERT INTO `tb_resource` VALUES ('6', '2018-05-14 14:08:16', '2018-05-14 14:08:20', null, '&#xe66f', '用户删除', '/admin/user/remove', '2', 'button', 'admin:user:remove', 'A', '6');
  64. INSERT INTO `tb_resource` VALUES ('7', '2018-05-14 14:09:07', '2018-05-14 14:09:10', null, '&#xe770', '角色管理', '/admin/role/list', '1', 'menu', 'admin:role:list', 'A', '7');
  65. INSERT INTO `tb_resource` VALUES ('8', '2018-05-14 15:06:59', '2018-05-14 15:07:01', null, '&#xe770', '角色添加', '/admin/role/add', '7', 'button', 'admin:role:add', 'A', '8');
  66. INSERT INTO `tb_resource` VALUES ('9', '2018-05-14 15:06:59', '2018-05-14 15:07:01', null, '&#xe770', '角色编辑', '/admin/role/edit', '7', 'button', 'admin:role:edit', 'A', '9');
  67. INSERT INTO `tb_resource` VALUES ('10', '2018-05-14 15:08:06', '2018-05-14 15:08:08', null, '&#xe770', '角色删除', '/admin/role/remove', '7', 'button', 'admin:role:remove', 'A', '10');
  68. INSERT INTO `tb_resource` VALUES ('11', '2018-05-14 15:08:06', '2018-05-14 15:08:08', null, '&#xe671', '资源管理', '/admin/resource/list', '1', 'menu', 'admin:resource:list', 'A', '11');
  69. INSERT INTO `tb_resource` VALUES ('12', '2018-05-15 09:51:49', '2018-05-15 09:51:51', null, '&#xe671', '资源添加', '/admin/resource/add', '11', 'button', 'admin:resource:add', 'A', '12');
  70. INSERT INTO `tb_resource` VALUES ('13', '2018-05-15 09:51:49', '2018-05-15 09:51:51', null, '&#xe671', '资源编辑', '/admin/resource/edit', '11', 'button', 'admin:resource:edit', 'A', '13');
  71. INSERT INTO `tb_resource` VALUES ('14', '2018-05-15 09:51:49', '2018-12-04 11:20:29', null, '&#xe671', '资源删除', '/admin/resource/remove', '11', 'button', 'admin:resource:remove', 'A', '14');
  72. INSERT INTO `tb_resource` VALUES ('15', '2018-07-27 16:30:51', '2018-07-27 16:30:51', null, '&#xe66e', '数据字典管理', '/admin/dataDictionary/list', '1', 'menu', 'admin:dataDictionary:list', 'A', '40');
  73. INSERT INTO `tb_resource` VALUES ('16', '2018-07-27 16:31:57', '2018-07-27 16:31:57', null, '&#xe66e', '数据字典添加', '/admin/dataDictionary/add', '15', 'button', 'admin:dataDictionary:add', 'A', '41');
  74. INSERT INTO `tb_resource` VALUES ('17', '2018-07-27 16:35:59', '2018-07-27 16:35:59', null, '&#xe66e', '数据字典编辑', '/admin/dataDictionary/edit', '15', 'button', 'admin:dataDictionary:edit', 'A', '42');
  75. INSERT INTO `tb_resource` VALUES ('18', '2018-07-27 16:36:56', '2018-07-27 16:36:56', null, '&#xe66e', '数据字典删除', '/admin/dataDictionary/remove', '15', 'button', 'admin:dataDictionary:remove', 'A', '43');
  76. -- ----------------------------
  77. -- Table structure for tb_role
  78. -- ----------------------------
  79. DROP TABLE IF EXISTS `tb_role`;
  80. CREATE TABLE `tb_role` (
  81. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  82. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  83. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  84. `role_desc` varchar(255) DEFAULT NULL COMMENT '角色描述',
  85. `role_name` varchar(50) DEFAULT NULL COMMENT '角色名',
  86. `role_key` varchar(255) DEFAULT NULL COMMENT '角色key',
  87. `rec_status` varchar(2) DEFAULT NULL COMMENT '记录的状态,A: 生效,I: 禁用',
  88. PRIMARY KEY (`id`)
  89. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='角色表';
  90. -- ----------------------------
  91. -- Records of tb_role
  92. -- ----------------------------
  93. INSERT INTO `tb_role` VALUES ('1', '2018-05-11 10:02:27', '2018-12-04 10:50:43', '超级管理员', '超级管理员', 'administrator', 'A');
  94. -- ----------------------------
  95. -- Table structure for tb_role_resource
  96. -- ----------------------------
  97. DROP TABLE IF EXISTS `tb_role_resource`;
  98. CREATE TABLE `tb_role_resource` (
  99. `role_id` bigint(20) NOT NULL COMMENT '角色表id',
  100. `resource_id` bigint(20) NOT NULL COMMENT '资源表id',
  101. PRIMARY KEY (`role_id`,`resource_id`),
  102. KEY `FK868kc8iic48ilv5npa80ut6qo` (`resource_id`),
  103. CONSTRAINT `FK7ffc7h6obqxflhj1aq1mk20jk` FOREIGN KEY (`role_id`) REFERENCES `tb_role` (`id`),
  104. CONSTRAINT `FK868kc8iic48ilv5npa80ut6qo` FOREIGN KEY (`resource_id`) REFERENCES `tb_resource` (`id`)
  105. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色资源关系表';
  106. -- ----------------------------
  107. -- Records of tb_role_resource
  108. -- ----------------------------
  109. INSERT INTO `tb_role_resource` VALUES ('1', '1');
  110. INSERT INTO `tb_role_resource` VALUES ('1', '2');
  111. INSERT INTO `tb_role_resource` VALUES ('1', '3');
  112. INSERT INTO `tb_role_resource` VALUES ('1', '4');
  113. INSERT INTO `tb_role_resource` VALUES ('1', '5');
  114. INSERT INTO `tb_role_resource` VALUES ('1', '6');
  115. INSERT INTO `tb_role_resource` VALUES ('1', '7');
  116. INSERT INTO `tb_role_resource` VALUES ('1', '8');
  117. INSERT INTO `tb_role_resource` VALUES ('1', '9');
  118. INSERT INTO `tb_role_resource` VALUES ('1', '10');
  119. INSERT INTO `tb_role_resource` VALUES ('1', '11');
  120. INSERT INTO `tb_role_resource` VALUES ('1', '12');
  121. INSERT INTO `tb_role_resource` VALUES ('1', '13');
  122. INSERT INTO `tb_role_resource` VALUES ('1', '14');
  123. INSERT INTO `tb_role_resource` VALUES ('1', '15');
  124. INSERT INTO `tb_role_resource` VALUES ('1', '16');
  125. INSERT INTO `tb_role_resource` VALUES ('1', '17');
  126. INSERT INTO `tb_role_resource` VALUES ('1', '18');
  127. -- ----------------------------
  128. -- Table structure for tb_user
  129. -- ----------------------------
  130. DROP TABLE IF EXISTS `tb_user`;
  131. CREATE TABLE `tb_user` (
  132. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  133. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  134. `rec_status` varchar(2) DEFAULT NULL COMMENT '记录的状态,A: 生效,I: 禁用',
  135. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  136. `password` varchar(100) DEFAULT NULL COMMENT '登录密码',
  137. `real_name` varchar(50) DEFAULT NULL COMMENT '真实姓名',
  138. `user_name` varchar(50) DEFAULT NULL COMMENT '用户名',
  139. `avatar` varchar(255) DEFAULT NULL COMMENT '头像地址',
  140. `status` tinyint(4) DEFAULT NULL COMMENT '状态,0:激活,1:禁用',
  141. PRIMARY KEY (`id`)
  142. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='用户表';
  143. -- ----------------------------
  144. -- Records of tb_user
  145. -- ----------------------------
  146. INSERT INTO `tb_user` VALUES ('1', '2018-05-10 15:12:42', 'A', '2018-12-04 10:58:51', '8ca1e641c2bc5040', '超级管理员', 'admin', '/img/avater.jpg', '0');
  147. -- ----------------------------
  148. -- Table structure for tb_user_role
  149. -- ----------------------------
  150. DROP TABLE IF EXISTS `tb_user_role`;
  151. CREATE TABLE `tb_user_role` (
  152. `user_id` bigint(20) NOT NULL COMMENT '用户表id',
  153. `role_id` bigint(20) NOT NULL COMMENT '角色表id',
  154. PRIMARY KEY (`user_id`,`role_id`),
  155. KEY `FKea2ootw6b6bb0xt3ptl28bymv` (`role_id`),
  156. CONSTRAINT `FK7vn3h53d0tqdimm8cp45gc0kl` FOREIGN KEY (`user_id`) REFERENCES `tb_user` (`id`),
  157. CONSTRAINT `FKea2ootw6b6bb0xt3ptl28bymv` FOREIGN KEY (`role_id`) REFERENCES `tb_role` (`id`)
  158. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户角色关系表';
  159. -- ----------------------------
  160. -- Records of tb_user_role
  161. -- ----------------------------
  162. INSERT INTO `tb_user_role` VALUES ('1', '1');