init.sql 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. /*
  2. Navicat Premium Data Transfer
  3. Source Server : localhost
  4. Source Server Type : MySQL
  5. Source Server Version : 50639
  6. Source Host : 127.0.0.1:3306
  7. Source Schema : da
  8. Target Server Type : MySQL
  9. Target Server Version : 50639
  10. File Encoding : 65001
  11. Date: 06/11/2018 17:15:56
  12. */
  13. SET NAMES utf8mb4;
  14. SET FOREIGN_KEY_CHECKS = 0;
  15. -- ----------------------------
  16. -- Table structure for QRTZ_BLOB_TRIGGERS
  17. -- ----------------------------
  18. DROP TABLE IF EXISTS `QRTZ_BLOB_TRIGGERS`;
  19. CREATE TABLE `QRTZ_BLOB_TRIGGERS` (
  20. `SCHED_NAME` varchar(120) NOT NULL,
  21. `TRIGGER_NAME` varchar(200) NOT NULL,
  22. `TRIGGER_GROUP` varchar(200) NOT NULL,
  23. `BLOB_DATA` blob,
  24. PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  25. KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  26. CONSTRAINT `qrtz_blob_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
  27. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  28. -- ----------------------------
  29. -- Table structure for QRTZ_CALENDARS
  30. -- ----------------------------
  31. DROP TABLE IF EXISTS `QRTZ_CALENDARS`;
  32. CREATE TABLE `QRTZ_CALENDARS` (
  33. `SCHED_NAME` varchar(120) NOT NULL,
  34. `CALENDAR_NAME` varchar(200) NOT NULL,
  35. `CALENDAR` blob NOT NULL,
  36. PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`)
  37. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  38. -- ----------------------------
  39. -- Table structure for QRTZ_CRON_TRIGGERS
  40. -- ----------------------------
  41. DROP TABLE IF EXISTS `QRTZ_CRON_TRIGGERS`;
  42. CREATE TABLE `QRTZ_CRON_TRIGGERS` (
  43. `SCHED_NAME` varchar(120) NOT NULL,
  44. `TRIGGER_NAME` varchar(200) NOT NULL,
  45. `TRIGGER_GROUP` varchar(200) NOT NULL,
  46. `CRON_EXPRESSION` varchar(120) NOT NULL,
  47. `TIME_ZONE_ID` varchar(80) DEFAULT NULL,
  48. PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  49. CONSTRAINT `qrtz_cron_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
  50. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  51. -- ----------------------------
  52. -- Table structure for QRTZ_FIRED_TRIGGERS
  53. -- ----------------------------
  54. DROP TABLE IF EXISTS `QRTZ_FIRED_TRIGGERS`;
  55. CREATE TABLE `QRTZ_FIRED_TRIGGERS` (
  56. `SCHED_NAME` varchar(120) NOT NULL,
  57. `ENTRY_ID` varchar(95) NOT NULL,
  58. `TRIGGER_NAME` varchar(200) NOT NULL,
  59. `TRIGGER_GROUP` varchar(200) NOT NULL,
  60. `INSTANCE_NAME` varchar(200) NOT NULL,
  61. `FIRED_TIME` bigint(13) NOT NULL,
  62. `SCHED_TIME` bigint(13) NOT NULL,
  63. `PRIORITY` int(11) NOT NULL,
  64. `STATE` varchar(16) NOT NULL,
  65. `JOB_NAME` varchar(200) DEFAULT NULL,
  66. `JOB_GROUP` varchar(200) DEFAULT NULL,
  67. `IS_NONCONCURRENT` varchar(1) DEFAULT NULL,
  68. `REQUESTS_RECOVERY` varchar(1) DEFAULT NULL,
  69. PRIMARY KEY (`SCHED_NAME`,`ENTRY_ID`),
  70. KEY `IDX_QRTZ_FT_TRIG_INST_NAME` (`SCHED_NAME`,`INSTANCE_NAME`),
  71. KEY `IDX_QRTZ_FT_INST_JOB_REQ_RCVRY` (`SCHED_NAME`,`INSTANCE_NAME`,`REQUESTS_RECOVERY`),
  72. KEY `IDX_QRTZ_FT_J_G` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`),
  73. KEY `IDX_QRTZ_FT_JG` (`SCHED_NAME`,`JOB_GROUP`),
  74. KEY `IDX_QRTZ_FT_T_G` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  75. KEY `IDX_QRTZ_FT_TG` (`SCHED_NAME`,`TRIGGER_GROUP`)
  76. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  77. -- ----------------------------
  78. -- Table structure for QRTZ_JOB_DETAILS
  79. -- ----------------------------
  80. DROP TABLE IF EXISTS `QRTZ_JOB_DETAILS`;
  81. CREATE TABLE `QRTZ_JOB_DETAILS` (
  82. `SCHED_NAME` varchar(120) NOT NULL,
  83. `JOB_NAME` varchar(200) NOT NULL,
  84. `JOB_GROUP` varchar(200) NOT NULL,
  85. `DESCRIPTION` varchar(250) DEFAULT NULL,
  86. `JOB_CLASS_NAME` varchar(250) NOT NULL,
  87. `IS_DURABLE` varchar(1) NOT NULL,
  88. `IS_NONCONCURRENT` varchar(1) NOT NULL,
  89. `IS_UPDATE_DATA` varchar(1) NOT NULL,
  90. `REQUESTS_RECOVERY` varchar(1) NOT NULL,
  91. `JOB_DATA` blob,
  92. PRIMARY KEY (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`),
  93. KEY `IDX_QRTZ_J_REQ_RECOVERY` (`SCHED_NAME`,`REQUESTS_RECOVERY`),
  94. KEY `IDX_QRTZ_J_GRP` (`SCHED_NAME`,`JOB_GROUP`)
  95. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  96. -- ----------------------------
  97. -- Table structure for QRTZ_LOCKS
  98. -- ----------------------------
  99. DROP TABLE IF EXISTS `QRTZ_LOCKS`;
  100. CREATE TABLE `QRTZ_LOCKS` (
  101. `SCHED_NAME` varchar(120) NOT NULL,
  102. `LOCK_NAME` varchar(40) NOT NULL,
  103. PRIMARY KEY (`SCHED_NAME`,`LOCK_NAME`)
  104. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  105. -- ----------------------------
  106. -- Table structure for QRTZ_PAUSED_TRIGGER_GRPS
  107. -- ----------------------------
  108. DROP TABLE IF EXISTS `QRTZ_PAUSED_TRIGGER_GRPS`;
  109. CREATE TABLE `QRTZ_PAUSED_TRIGGER_GRPS` (
  110. `SCHED_NAME` varchar(120) NOT NULL,
  111. `TRIGGER_GROUP` varchar(200) NOT NULL,
  112. PRIMARY KEY (`SCHED_NAME`,`TRIGGER_GROUP`)
  113. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  114. -- ----------------------------
  115. -- Table structure for QRTZ_SCHEDULER_STATE
  116. -- ----------------------------
  117. DROP TABLE IF EXISTS `QRTZ_SCHEDULER_STATE`;
  118. CREATE TABLE `QRTZ_SCHEDULER_STATE` (
  119. `SCHED_NAME` varchar(120) NOT NULL,
  120. `INSTANCE_NAME` varchar(200) NOT NULL,
  121. `LAST_CHECKIN_TIME` bigint(13) NOT NULL,
  122. `CHECKIN_INTERVAL` bigint(13) NOT NULL,
  123. PRIMARY KEY (`SCHED_NAME`,`INSTANCE_NAME`)
  124. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  125. -- ----------------------------
  126. -- Table structure for QRTZ_SIMPLE_TRIGGERS
  127. -- ----------------------------
  128. DROP TABLE IF EXISTS `QRTZ_SIMPLE_TRIGGERS`;
  129. CREATE TABLE `QRTZ_SIMPLE_TRIGGERS` (
  130. `SCHED_NAME` varchar(120) NOT NULL,
  131. `TRIGGER_NAME` varchar(200) NOT NULL,
  132. `TRIGGER_GROUP` varchar(200) NOT NULL,
  133. `REPEAT_COUNT` bigint(7) NOT NULL,
  134. `REPEAT_INTERVAL` bigint(12) NOT NULL,
  135. `TIMES_TRIGGERED` bigint(10) NOT NULL,
  136. PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  137. CONSTRAINT `qrtz_simple_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
  138. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  139. -- ----------------------------
  140. -- Table structure for QRTZ_SIMPROP_TRIGGERS
  141. -- ----------------------------
  142. DROP TABLE IF EXISTS `QRTZ_SIMPROP_TRIGGERS`;
  143. CREATE TABLE `QRTZ_SIMPROP_TRIGGERS` (
  144. `SCHED_NAME` varchar(120) NOT NULL,
  145. `TRIGGER_NAME` varchar(200) NOT NULL,
  146. `TRIGGER_GROUP` varchar(200) NOT NULL,
  147. `STR_PROP_1` varchar(512) DEFAULT NULL,
  148. `STR_PROP_2` varchar(512) DEFAULT NULL,
  149. `STR_PROP_3` varchar(512) DEFAULT NULL,
  150. `INT_PROP_1` int(11) DEFAULT NULL,
  151. `INT_PROP_2` int(11) DEFAULT NULL,
  152. `LONG_PROP_1` bigint(20) DEFAULT NULL,
  153. `LONG_PROP_2` bigint(20) DEFAULT NULL,
  154. `DEC_PROP_1` decimal(13,4) DEFAULT NULL,
  155. `DEC_PROP_2` decimal(13,4) DEFAULT NULL,
  156. `BOOL_PROP_1` varchar(1) DEFAULT NULL,
  157. `BOOL_PROP_2` varchar(1) DEFAULT NULL,
  158. PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  159. CONSTRAINT `qrtz_simprop_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
  160. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  161. -- ----------------------------
  162. -- Table structure for QRTZ_TRIGGERS
  163. -- ----------------------------
  164. DROP TABLE IF EXISTS `QRTZ_TRIGGERS`;
  165. CREATE TABLE `QRTZ_TRIGGERS` (
  166. `SCHED_NAME` varchar(120) NOT NULL,
  167. `TRIGGER_NAME` varchar(200) NOT NULL,
  168. `TRIGGER_GROUP` varchar(200) NOT NULL,
  169. `JOB_NAME` varchar(200) NOT NULL,
  170. `JOB_GROUP` varchar(200) NOT NULL,
  171. `DESCRIPTION` varchar(250) DEFAULT NULL,
  172. `NEXT_FIRE_TIME` bigint(13) DEFAULT NULL,
  173. `PREV_FIRE_TIME` bigint(13) DEFAULT NULL,
  174. `PRIORITY` int(11) DEFAULT NULL,
  175. `TRIGGER_STATE` varchar(16) NOT NULL,
  176. `TRIGGER_TYPE` varchar(8) NOT NULL,
  177. `START_TIME` bigint(13) NOT NULL,
  178. `END_TIME` bigint(13) DEFAULT NULL,
  179. `CALENDAR_NAME` varchar(200) DEFAULT NULL,
  180. `MISFIRE_INSTR` smallint(2) DEFAULT NULL,
  181. `JOB_DATA` blob,
  182. PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  183. KEY `IDX_QRTZ_T_J` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`),
  184. KEY `IDX_QRTZ_T_JG` (`SCHED_NAME`,`JOB_GROUP`),
  185. KEY `IDX_QRTZ_T_C` (`SCHED_NAME`,`CALENDAR_NAME`),
  186. KEY `IDX_QRTZ_T_G` (`SCHED_NAME`,`TRIGGER_GROUP`),
  187. KEY `IDX_QRTZ_T_STATE` (`SCHED_NAME`,`TRIGGER_STATE`),
  188. KEY `IDX_QRTZ_T_N_STATE` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`),
  189. KEY `IDX_QRTZ_T_N_G_STATE` (`SCHED_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`),
  190. KEY `IDX_QRTZ_T_NEXT_FIRE_TIME` (`SCHED_NAME`,`NEXT_FIRE_TIME`),
  191. KEY `IDX_QRTZ_T_NFT_ST` (`SCHED_NAME`,`TRIGGER_STATE`,`NEXT_FIRE_TIME`),
  192. KEY `IDX_QRTZ_T_NFT_MISFIRE` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`),
  193. KEY `IDX_QRTZ_T_NFT_ST_MISFIRE` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_STATE`),
  194. KEY `IDX_QRTZ_T_NFT_ST_MISFIRE_GRP` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_GROUP`,`TRIGGER_STATE`),
  195. CONSTRAINT `qrtz_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) REFERENCES `QRTZ_JOB_DETAILS` (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`)
  196. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  197. -- ----------------------------
  198. -- Table structure for area
  199. -- ----------------------------
  200. DROP TABLE IF EXISTS `area`;
  201. CREATE TABLE `area` (
  202. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  203. `create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
  204. `modify_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新日期',
  205. `version` bigint(20) NOT NULL DEFAULT '0',
  206. `orders` int(11) DEFAULT NULL,
  207. `full_name` longtext NOT NULL,
  208. `grade` int(11) NOT NULL,
  209. `name` varchar(255) NOT NULL,
  210. `tree_path` varchar(255) NOT NULL,
  211. `parent_id` bigint(20) DEFAULT NULL,
  212. PRIMARY KEY (`id`),
  213. KEY `ind_area_parent` (`parent_id`)
  214. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='地区';
  215. -- ----------------------------
  216. -- Table structure for schedule_job
  217. -- ----------------------------
  218. DROP TABLE IF EXISTS `schedule_job`;
  219. CREATE TABLE `schedule_job` (
  220. `job_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务id',
  221. `bean_name` varchar(200) DEFAULT NULL COMMENT 'spring bean名称',
  222. `method_name` varchar(100) DEFAULT NULL COMMENT '方法名',
  223. `params` varchar(2000) DEFAULT NULL COMMENT '参数',
  224. `cron_expression` varchar(100) DEFAULT NULL COMMENT 'cron表达式',
  225. `status` tinyint(4) DEFAULT NULL COMMENT '任务状态 0:正常 1:暂停',
  226. `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  227. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  228. PRIMARY KEY (`job_id`)
  229. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='定时任务';
  230. -- ----------------------------
  231. -- Table structure for schedule_job_log
  232. -- ----------------------------
  233. DROP TABLE IF EXISTS `schedule_job_log`;
  234. CREATE TABLE `schedule_job_log` (
  235. `log_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务日志id',
  236. `job_id` bigint(20) NOT NULL COMMENT '任务id',
  237. `bean_name` varchar(200) DEFAULT NULL COMMENT 'spring bean名称',
  238. `method_name` varchar(100) DEFAULT NULL COMMENT '方法名',
  239. `params` varchar(2000) DEFAULT NULL COMMENT '参数',
  240. `status` tinyint(4) NOT NULL COMMENT '任务状态 0:成功 1:失败',
  241. `error` varchar(2000) DEFAULT NULL COMMENT '失败信息',
  242. `times` int(11) NOT NULL COMMENT '耗时(单位:毫秒)',
  243. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  244. PRIMARY KEY (`log_id`),
  245. KEY `job_id` (`job_id`)
  246. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='定时任务日志';
  247. -- ----------------------------
  248. -- Table structure for sn
  249. -- ----------------------------
  250. DROP TABLE IF EXISTS `sn`;
  251. CREATE TABLE `sn` (
  252. `type` int(11) NOT NULL COMMENT '类型',
  253. `last_value` bigint(20) NOT NULL COMMENT '末值',
  254. `create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
  255. `modify_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改日期',
  256. PRIMARY KEY (`type`)
  257. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='序列号';
  258. -- ----------------------------
  259. -- Table structure for sys_captcha
  260. -- ----------------------------
  261. DROP TABLE IF EXISTS `sys_captcha`;
  262. CREATE TABLE `sys_captcha` (
  263. `uuid` char(36) NOT NULL COMMENT 'uuid',
  264. `code` varchar(6) NOT NULL COMMENT '验证码',
  265. `expire_time` datetime DEFAULT NULL COMMENT '过期时间',
  266. PRIMARY KEY (`uuid`)
  267. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统验证码';
  268. -- ----------------------------
  269. -- Table structure for sys_config
  270. -- ----------------------------
  271. DROP TABLE IF EXISTS `sys_config`;
  272. CREATE TABLE `sys_config` (
  273. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  274. `param_key` varchar(50) DEFAULT NULL COMMENT 'key',
  275. `param_value` varchar(2000) DEFAULT NULL COMMENT 'value',
  276. `status` tinyint(4) DEFAULT '1' COMMENT '状态 0:隐藏 1:显示',
  277. `remark` varchar(500) DEFAULT NULL COMMENT '备注',
  278. PRIMARY KEY (`id`),
  279. UNIQUE KEY `param_key` (`param_key`)
  280. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统配置信息表';
  281. -- ----------------------------
  282. -- Table structure for sys_log
  283. -- ----------------------------
  284. DROP TABLE IF EXISTS `sys_log`;
  285. CREATE TABLE `sys_log` (
  286. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  287. `username` varchar(50) DEFAULT NULL COMMENT '用户名',
  288. `operation` varchar(50) DEFAULT NULL COMMENT '用户操作',
  289. `method` varchar(200) DEFAULT NULL COMMENT '请求方法',
  290. `params` varchar(5000) DEFAULT NULL COMMENT '请求参数',
  291. `time` bigint(20) NOT NULL COMMENT '执行时长(毫秒)',
  292. `ip` varchar(64) DEFAULT NULL COMMENT 'IP地址',
  293. `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  294. PRIMARY KEY (`id`)
  295. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统日志';
  296. -- ----------------------------
  297. -- Table structure for sys_menu
  298. -- ----------------------------
  299. DROP TABLE IF EXISTS `sys_menu`;
  300. CREATE TABLE `sys_menu` (
  301. `menu_id` bigint(20) NOT NULL AUTO_INCREMENT,
  302. `parent_id` bigint(20) DEFAULT NULL COMMENT '父菜单ID,一级菜单为0',
  303. `name` varchar(50) DEFAULT NULL COMMENT '菜单名称',
  304. `url` varchar(200) DEFAULT NULL COMMENT '菜单URL',
  305. `perms` varchar(500) DEFAULT NULL COMMENT '授权(多个用逗号分隔,如:user:list,user:create)',
  306. `type` int(11) DEFAULT NULL COMMENT '类型 0:目录 1:菜单 2:按钮',
  307. `icon` varchar(50) DEFAULT NULL COMMENT '菜单图标',
  308. `order_num` int(11) DEFAULT NULL COMMENT '排序',
  309. PRIMARY KEY (`menu_id`)
  310. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='菜单管理';
  311. -- ----------------------------
  312. -- Table structure for sys_oss
  313. -- ----------------------------
  314. DROP TABLE IF EXISTS `sys_oss`;
  315. CREATE TABLE `sys_oss` (
  316. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  317. `url` varchar(200) DEFAULT NULL COMMENT 'URL地址',
  318. `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  319. PRIMARY KEY (`id`)
  320. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文件上传';
  321. -- ----------------------------
  322. -- Table structure for sys_role
  323. -- ----------------------------
  324. DROP TABLE IF EXISTS `sys_role`;
  325. CREATE TABLE `sys_role` (
  326. `role_id` bigint(20) NOT NULL AUTO_INCREMENT,
  327. `role_name` varchar(100) DEFAULT NULL COMMENT '角色名称',
  328. `remark` varchar(100) DEFAULT NULL COMMENT '备注',
  329. `create_user_id` bigint(20) DEFAULT NULL COMMENT '创建者ID',
  330. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  331. PRIMARY KEY (`role_id`)
  332. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色';
  333. -- ----------------------------
  334. -- Table structure for sys_role_menu
  335. -- ----------------------------
  336. DROP TABLE IF EXISTS `sys_role_menu`;
  337. CREATE TABLE `sys_role_menu` (
  338. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  339. `role_id` bigint(20) DEFAULT NULL COMMENT '角色ID',
  340. `menu_id` bigint(20) DEFAULT NULL COMMENT '菜单ID',
  341. PRIMARY KEY (`id`)
  342. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色与菜单对应关系';
  343. -- ----------------------------
  344. -- Table structure for sys_user
  345. -- ----------------------------
  346. DROP TABLE IF EXISTS `sys_user`;
  347. CREATE TABLE `sys_user` (
  348. `user_id` bigint(20) NOT NULL AUTO_INCREMENT,
  349. `username` varchar(50) NOT NULL COMMENT '用户名',
  350. `password` varchar(100) DEFAULT NULL COMMENT '密码',
  351. `salt` varchar(20) DEFAULT NULL COMMENT '盐',
  352. `email` varchar(100) DEFAULT NULL COMMENT '邮箱',
  353. `mobile` varchar(100) DEFAULT NULL COMMENT '手机号',
  354. `status` tinyint(4) DEFAULT NULL COMMENT '状态 0:禁用 1:正常',
  355. `create_user_id` bigint(20) DEFAULT NULL COMMENT '创建者ID',
  356. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  357. PRIMARY KEY (`user_id`),
  358. UNIQUE KEY `username` (`username`)
  359. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统用户';
  360. -- ----------------------------
  361. -- Table structure for sys_user_role
  362. -- ----------------------------
  363. DROP TABLE IF EXISTS `sys_user_role`;
  364. CREATE TABLE `sys_user_role` (
  365. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  366. `user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
  367. `role_id` bigint(20) DEFAULT NULL COMMENT '角色ID',
  368. PRIMARY KEY (`id`)
  369. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户与角色对应关系';
  370. -- ----------------------------
  371. -- Table structure for sys_user_token
  372. -- ----------------------------
  373. DROP TABLE IF EXISTS `sys_user_token`;
  374. CREATE TABLE `sys_user_token` (
  375. `user_id` bigint(20) NOT NULL,
  376. `token` varchar(100) NOT NULL COMMENT 'token',
  377. `expire_time` datetime DEFAULT NULL COMMENT '过期时间',
  378. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  379. PRIMARY KEY (`user_id`),
  380. UNIQUE KEY `token` (`token`)
  381. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统用户Token';
  382. -- ----------------------------
  383. -- Table structure for test_table
  384. -- ----------------------------
  385. DROP TABLE IF EXISTS `test_table`;
  386. CREATE TABLE `test_table` (
  387. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '[ID]',
  388. `name` varchar(255) DEFAULT NULL COMMENT '[姓名]',
  389. `sex` smallint(2) DEFAULT NULL COMMENT '[性别] 1-男 2-女',
  390. `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '[创建时间]',
  391. `update_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '[更新时间]',
  392. PRIMARY KEY (`id`)
  393. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  394. -- ----------------------------
  395. -- Table structure for user
  396. -- ----------------------------
  397. DROP TABLE IF EXISTS `user`;
  398. CREATE TABLE `user` (
  399. `user_id` varchar(50) NOT NULL COMMENT 'ID',
  400. `username` varchar(50) DEFAULT NULL COMMENT '用户名',
  401. `ma_open_id` varchar(100) DEFAULT NULL COMMENT '小程序openid',
  402. `union_id` varchar(100) DEFAULT NULL COMMENT '开放平台id',
  403. `nickname` varchar(50) DEFAULT NULL COMMENT '昵称',
  404. `name` varchar(50) DEFAULT NULL COMMENT '真实姓名',
  405. `email` varchar(50) DEFAULT NULL COMMENT '邮箱',
  406. `gender` smallint(1) DEFAULT NULL COMMENT '性别 1-男 2-女',
  407. `area_id` smallint(10) DEFAULT NULL COMMENT '地区id',
  408. `language` smallint(1) DEFAULT NULL COMMENT '语言 1-中文 2-英文',
  409. `volunteer` smallint(4) DEFAULT NULL COMMENT '是否志愿者',
  410. `avatar` varchar(255) DEFAULT NULL COMMENT '头像',
  411. `mobile` varchar(20) DEFAULT NULL COMMENT '手机号',
  412. `password` varchar(64) DEFAULT NULL COMMENT '密码',
  413. `update_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  414. `create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  415. PRIMARY KEY (`user_id`),
  416. UNIQUE KEY `idx_username` (`username`) USING BTREE,
  417. KEY `idx_maopenid` (`ma_open_id`),
  418. KEY `idx_unionid` (`union_id`),
  419. KEY `idx_createdate` (`create_date`),
  420. KEY `idx_nickname` (`nickname`),
  421. KEY `idx_name` (`name`),
  422. KEY `idex_mobile` (`mobile`)
  423. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户';
  424. -- 初始数据
  425. INSERT INTO `sys_user` (`user_id`, `username`, `password`, `salt`, `email`, `mobile`, `status`, `create_user_id`, `create_time`) VALUES ('1', 'admin', '9ec9750e709431dad22365cabc5c625482e574c74adaebba7dd02f1129e4ce1d', 'YzcmCZNvbXocrsz9dm8e', 'root@da.com', '13612345678', '1', '1', '2016-11-11 11:11:11');
  426. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (1, 0, '系统管理', NULL, NULL, 0, 'system', 0);
  427. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (2, 1, '管理员列表', 'sys/user', NULL, 1, 'admin', 1);
  428. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (3, 1, '角色管理', 'sys/role', NULL, 1, 'role', 2);
  429. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (4, 1, '菜单管理', 'sys/menu', NULL, 1, 'menu', 3);
  430. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (5, 1, 'SQL监控', 'http://localhost:8080/da/druid/sql.html', NULL, 1, 'sql', 4);
  431. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (6, 1, '定时任务', 'job/schedule', NULL, 1, 'job', 5);
  432. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (7, 6, '查看', NULL, 'sys:schedule:list,sys:schedule:info', 2, NULL, 0);
  433. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (8, 6, '新增', NULL, 'sys:schedule:save', 2, NULL, 0);
  434. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (9, 6, '修改', NULL, 'sys:schedule:update', 2, NULL, 0);
  435. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (10, 6, '删除', NULL, 'sys:schedule:delete', 2, NULL, 0);
  436. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (11, 6, '暂停', NULL, 'sys:schedule:pause', 2, NULL, 0);
  437. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (12, 6, '恢复', NULL, 'sys:schedule:resume', 2, NULL, 0);
  438. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (13, 6, '立即执行', NULL, 'sys:schedule:run', 2, NULL, 0);
  439. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (14, 6, '日志列表', NULL, 'sys:schedule:log', 2, NULL, 0);
  440. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (15, 2, '查看', NULL, 'sys:user:list,sys:user:info', 2, NULL, 0);
  441. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (16, 2, '新增', NULL, 'sys:user:save,sys:role:select', 2, NULL, 0);
  442. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (17, 2, '修改', NULL, 'sys:user:update,sys:role:select', 2, NULL, 0);
  443. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (18, 2, '删除', NULL, 'sys:user:delete', 2, NULL, 0);
  444. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (19, 3, '查看', NULL, 'sys:role:list,sys:role:info', 2, NULL, 0);
  445. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (20, 3, '新增', NULL, 'sys:role:save,sys:menu:list', 2, NULL, 0);
  446. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (21, 3, '修改', NULL, 'sys:role:update,sys:menu:list', 2, NULL, 0);
  447. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (22, 3, '删除', NULL, 'sys:role:delete', 2, NULL, 0);
  448. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (23, 4, '查看', NULL, 'sys:menu:list,sys:menu:info', 2, NULL, 0);
  449. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (24, 4, '新增', NULL, 'sys:menu:save,sys:menu:select', 2, NULL, 0);
  450. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (25, 4, '修改', NULL, 'sys:menu:update,sys:menu:select', 2, NULL, 0);
  451. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (26, 4, '删除', NULL, 'sys:menu:delete', 2, NULL, 0);
  452. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (27, 1, '参数管理', 'sys/config', 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete', 1, 'config', 6);
  453. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (29, 1, '系统日志', 'sys/log', 'sys:log:list', 1, 'log', 7);
  454. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (30, 1, '文件上传', 'oss/oss', 'sys:oss:all', 1, 'oss', 6);
  455. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (31, 0, '业务管理', '', '', 0, 'config', 0);
  456. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (42, 31, '商品管理', 'sys/goods', '', 1, 'editor', 0);
  457. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (43, 31, '订单管理', 'sys/order', '', 1, 'bianji', 0);
  458. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (45, 31, '商品分类', 'sys/productCategory', '', 1, 'log', 0);
  459. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (46, 31, '规格管理', 'sys/specification', '', 1, 'menu', 0);
  460. INSERT INTO `sys_config` (`param_key`, `param_value`, `status`, `remark`) VALUES ('CLOUD_STORAGE_CONFIG_KEY', '{\"aliyunAccessKeyId\":\"\",\"aliyunAccessKeySecret\":\"\",\"aliyunBucketName\":\"\",\"aliyunDomain\":\"\",\"aliyunEndPoint\":\"\",\"aliyunPrefix\":\"\",\"qcloudBucketName\":\"\",\"qcloudDomain\":\"\",\"qcloudPrefix\":\"\",\"qcloudSecretId\":\"\",\"qcloudSecretKey\":\"\",\"qiniuAccessKey\":\"NrgMfABZxWLo5B-YYSjoE8-AZ1EISdi1Z3ubLOeZ\",\"qiniuBucketName\":\"ios-app\",\"qiniuDomain\":\"http://7xqbwh.dl1.z0.glb.clouddn.com\",\"qiniuPrefix\":\"upload\",\"qiniuSecretKey\":\"uIwJHevMRWU0VLxFvgy0tAcOdGqasdtVlJkdy6vV\",\"type\":1}', '0', '云存储配置信息');
  461. INSERT INTO `schedule_job` (`bean_name`, `method_name`, `params`, `cron_expression`, `status`, `remark`, `create_time`) VALUES ('testTask', 'test', 'da', '0 0/30 * * * ?', '0', '有参数测试', '2016-12-01 23:16:46');
  462. INSERT INTO `schedule_job` (`bean_name`, `method_name`, `params`, `cron_expression`, `status`, `remark`, `create_time`) VALUES ('testTask', 'test2', NULL, '0 0/30 * * * ?', '1', '无参数测试', '2016-12-03 14:55:56');
  463. INSERT INTO `sn`(`type`, `last_value`, `create_date`, `modify_date`) VALUES (1, 100, '2018-05-23 14:52:55', '2018-05-23 14:52:55');
  464. INSERT INTO `sn`(`type`, `last_value`, `create_date`, `modify_date`) VALUES (2, 100, '2018-05-23 14:52:55', '2018-05-23 14:52:55');
  465. INSERT INTO `sn`(`type`, `last_value`, `create_date`, `modify_date`) VALUES (3, 100, '2018-05-23 14:52:55', '2018-05-23 14:52:55');
  466. INSERT INTO `sn`(`type`, `last_value`, `create_date`, `modify_date`) VALUES (4, 100, '2018-05-23 14:52:55', '2018-05-23 14:52:55');
  467. INSERT INTO `sn`(`type`, `last_value`, `create_date`, `modify_date`) VALUES (5, 100, '2018-05-23 14:52:55', '2018-05-23 14:52:55');
  468. INSERT INTO `sn`(`type`, `last_value`, `create_date`, `modify_date`) VALUES (6, 100, '2018-05-23 14:52:55', '2018-05-23 14:52:55');