sq_logistics.sql 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. /*
  2. Navicat MySQL Data Transfer
  3. Source Server : 118.178.58.178
  4. Source Server Version : 50627
  5. Source Host : 118.178.58.178:3306
  6. Source Database : sq_logistics
  7. Target Server Type : MYSQL
  8. Target Server Version : 50627
  9. File Encoding : 65001
  10. Date: 2018-02-09 11:33:50
  11. */
  12. SET FOREIGN_KEY_CHECKS=0;
  13. -- ----------------------------
  14. -- Table structure for `box`
  15. -- ----------------------------
  16. DROP TABLE IF EXISTS `box`;
  17. CREATE TABLE `box` (
  18. `id` int(11) NOT NULL AUTO_INCREMENT,
  19. `box_no` varchar(255) NOT NULL,
  20. `box_name` varchar(255) NOT NULL,
  21. PRIMARY KEY (`id`)
  22. ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
  23. -- ----------------------------
  24. -- Records of box
  25. -- ----------------------------
  26. INSERT INTO `box` VALUES ('1', 'FCIU4615791', '小箱子');
  27. INSERT INTO `box` VALUES ('2', 'FCIU4615792', '大箱子');
  28. INSERT INTO `box` VALUES ('3', 'FCIU4615793', '微型箱子');
  29. INSERT INTO `box` VALUES ('4', 'FCIU4615794', '巨型箱子');
  30. -- ----------------------------
  31. -- Table structure for `module`
  32. -- ----------------------------
  33. DROP TABLE IF EXISTS `module`;
  34. CREATE TABLE `module` (
  35. `id` int(11) NOT NULL AUTO_INCREMENT,
  36. `module_id` int(11) NOT NULL,
  37. `module_name` varchar(255) NOT NULL,
  38. `module_url` varchar(255) NOT NULL,
  39. PRIMARY KEY (`id`)
  40. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
  41. -- ----------------------------
  42. -- Records of module
  43. -- ----------------------------
  44. INSERT INTO `module` VALUES ('1', '1', '计划员订单查询', '/ordersIssue/queryOrdersByPlanner');
  45. INSERT INTO `module` VALUES ('2', '2', '计划员添加订单', '/ordersIssue/addOrder');
  46. INSERT INTO `module` VALUES ('3', '3', '计划员订单跟踪', '/ordersIssue/orderTracking');
  47. -- ----------------------------
  48. -- Table structure for `operation_history`
  49. -- ----------------------------
  50. DROP TABLE IF EXISTS `operation_history`;
  51. CREATE TABLE `operation_history` (
  52. `id` int(11) NOT NULL AUTO_INCREMENT,
  53. `order_id` int(11) NOT NULL,
  54. `operation_type_id` int(11) NOT NULL,
  55. `operator_id` int(11) NOT NULL COMMENT '用户的user_id',
  56. `operation_time` bigint(20) NOT NULL,
  57. `hash` varchar(255) NOT NULL,
  58. PRIMARY KEY (`id`),
  59. KEY `operator_id` (`operator_id`) USING BTREE
  60. ) ENGINE=InnoDB AUTO_INCREMENT=90 DEFAULT CHARSET=utf8;
  61. -- ----------------------------
  62. -- Records of operation_history
  63. -- ----------------------------
  64. -- ----------------------------
  65. -- Table structure for `operation_history_admin`
  66. -- ----------------------------
  67. DROP TABLE IF EXISTS `operation_history_admin`;
  68. CREATE TABLE `operation_history_admin` (
  69. `id` int(11) NOT NULL AUTO_INCREMENT,
  70. `operator_id` int(11) NOT NULL,
  71. `operation_type_id` int(11) NOT NULL,
  72. `be_operated_id` int(11) NOT NULL,
  73. `operation_time` bigint(20) NOT NULL,
  74. `hash` varchar(255) NOT NULL,
  75. PRIMARY KEY (`id`),
  76. KEY `operator_id` (`operator_id`) USING BTREE
  77. ) ENGINE=InnoDB AUTO_INCREMENT=292 DEFAULT CHARSET=utf8;
  78. -- ----------------------------
  79. -- Records of operation_history_admin
  80. -- ----------------------------
  81. INSERT INTO `operation_history_admin` VALUES ('291', '1', '1', '1', '1518144355124', '7446954550830814811');
  82. -- ----------------------------
  83. -- Table structure for `operation_type`
  84. -- ----------------------------
  85. DROP TABLE IF EXISTS `operation_type`;
  86. CREATE TABLE `operation_type` (
  87. `id` int(11) NOT NULL AUTO_INCREMENT,
  88. `operation_type_id` int(11) NOT NULL,
  89. `operation_type_name` varchar(255) NOT NULL,
  90. PRIMARY KEY (`id`)
  91. ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
  92. -- ----------------------------
  93. -- Records of operation_type
  94. -- ----------------------------
  95. INSERT INTO `operation_type` VALUES ('1', '1', '设置管理员公钥');
  96. INSERT INTO `operation_type` VALUES ('2', '2', '创建账号');
  97. INSERT INTO `operation_type` VALUES ('3', '3', '编辑账号');
  98. INSERT INTO `operation_type` VALUES ('4', '4', '删除账号');
  99. INSERT INTO `operation_type` VALUES ('5', '5', '设置供应商');
  100. INSERT INTO `operation_type` VALUES ('6', '6', '创建订单');
  101. INSERT INTO `operation_type` VALUES ('7', '7', '供应商发货');
  102. INSERT INTO `operation_type` VALUES ('8', '8', '承运商运货');
  103. INSERT INTO `operation_type` VALUES ('9', '9', '收货');
  104. -- ----------------------------
  105. -- Table structure for `orders`
  106. -- ----------------------------
  107. DROP TABLE IF EXISTS `orders`;
  108. CREATE TABLE `orders` (
  109. `id` int(11) NOT NULL AUTO_INCREMENT,
  110. `order_id` int(255) DEFAULT NULL,
  111. `part_no` varchar(255) DEFAULT NULL,
  112. `box_no` varchar(255) DEFAULT NULL,
  113. `box_qty` int(11) DEFAULT NULL COMMENT '箱子的数量?',
  114. `inbox_qty` int(11) DEFAULT NULL,
  115. `require_time` bigint(20) DEFAULT NULL,
  116. `send_time` bigint(20) DEFAULT NULL,
  117. `planner_id` int(11) DEFAULT NULL COMMENT '计划员的user_id',
  118. `supplier_id` int(11) DEFAULT NULL COMMENT '供应商的user_id',
  119. `carrier_id` int(11) DEFAULT NULL COMMENT '承运商的user_id',
  120. `receiver_id` int(11) DEFAULT NULL COMMENT '收货员的user_id',
  121. `transport_time` bigint(20) DEFAULT NULL,
  122. `tally_time` bigint(20) DEFAULT NULL,
  123. `car_no` varchar(255) DEFAULT NULL,
  124. `status_id` int(11) DEFAULT NULL,
  125. `create_time` bigint(20) DEFAULT NULL,
  126. `update_time` bigint(20) DEFAULT NULL,
  127. PRIMARY KEY (`id`)
  128. ) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8;
  129. -- ----------------------------
  130. -- Records of orders
  131. -- ----------------------------
  132. -- ----------------------------
  133. -- Table structure for `part`
  134. -- ----------------------------
  135. DROP TABLE IF EXISTS `part`;
  136. CREATE TABLE `part` (
  137. `id` int(11) NOT NULL AUTO_INCREMENT,
  138. `part_no` varchar(255) NOT NULL,
  139. `part_name` varchar(255) NOT NULL,
  140. PRIMARY KEY (`id`)
  141. ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
  142. -- ----------------------------
  143. -- Records of part
  144. -- ----------------------------
  145. INSERT INTO `part` VALUES ('1', 'FCIU4615791', '方向盘');
  146. INSERT INTO `part` VALUES ('2', 'FCIU4615792', '挡风玻璃');
  147. INSERT INTO `part` VALUES ('3', 'FCIU4615793', '轮胎');
  148. INSERT INTO `part` VALUES ('4', 'FCIU4615794', '发动机');
  149. INSERT INTO `part` VALUES ('5', 'FCIU4615795', '座椅');
  150. INSERT INTO `part` VALUES ('6', 'FCIU4615796', '后视镜');
  151. -- ----------------------------
  152. -- Table structure for `planner_supplier`
  153. -- ----------------------------
  154. DROP TABLE IF EXISTS `planner_supplier`;
  155. CREATE TABLE `planner_supplier` (
  156. `id` int(11) NOT NULL AUTO_INCREMENT,
  157. `planner_id` int(11) NOT NULL,
  158. `supplier_id` int(11) NOT NULL,
  159. PRIMARY KEY (`id`)
  160. ) ENGINE=InnoDB AUTO_INCREMENT=211 DEFAULT CHARSET=utf8;
  161. -- ----------------------------
  162. -- Records of planner_supplier
  163. -- ----------------------------
  164. -- ----------------------------
  165. -- Table structure for `role`
  166. -- ----------------------------
  167. DROP TABLE IF EXISTS `role`;
  168. CREATE TABLE `role` (
  169. `id` int(11) NOT NULL AUTO_INCREMENT,
  170. `role_id` int(11) NOT NULL,
  171. `role_name` varchar(255) NOT NULL,
  172. PRIMARY KEY (`id`)
  173. ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
  174. -- ----------------------------
  175. -- Records of role
  176. -- ----------------------------
  177. INSERT INTO `role` VALUES ('1', '1', '计划员');
  178. INSERT INTO `role` VALUES ('2', '2', '供应商');
  179. INSERT INTO `role` VALUES ('3', '3', '承运商');
  180. INSERT INTO `role` VALUES ('4', '4', '仓库收货员');
  181. INSERT INTO `role` VALUES ('5', '5', '管理员');
  182. -- ----------------------------
  183. -- Table structure for `role_module`
  184. -- ----------------------------
  185. DROP TABLE IF EXISTS `role_module`;
  186. CREATE TABLE `role_module` (
  187. `id` int(11) NOT NULL AUTO_INCREMENT,
  188. `role_id` int(11) NOT NULL,
  189. `module_id` int(11) NOT NULL,
  190. PRIMARY KEY (`id`)
  191. ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
  192. -- ----------------------------
  193. -- Records of role_module
  194. -- ----------------------------
  195. INSERT INTO `role_module` VALUES ('1', '1', '1');
  196. INSERT INTO `role_module` VALUES ('2', '1', '2');
  197. INSERT INTO `role_module` VALUES ('3', '1', '3');
  198. INSERT INTO `role_module` VALUES ('4', '5', '1');
  199. INSERT INTO `role_module` VALUES ('5', '5', '2');
  200. INSERT INTO `role_module` VALUES ('6', '5', '3');
  201. -- ----------------------------
  202. -- Table structure for `status`
  203. -- ----------------------------
  204. DROP TABLE IF EXISTS `status`;
  205. CREATE TABLE `status` (
  206. `id` int(11) NOT NULL AUTO_INCREMENT,
  207. `status_id` int(11) NOT NULL,
  208. `status_name` varchar(255) NOT NULL,
  209. PRIMARY KEY (`id`)
  210. ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
  211. -- ----------------------------
  212. -- Records of status
  213. -- ----------------------------
  214. INSERT INTO `status` VALUES ('1', '1', '待发货');
  215. INSERT INTO `status` VALUES ('3', '2', '待运输');
  216. INSERT INTO `status` VALUES ('4', '3', '运输中');
  217. INSERT INTO `status` VALUES ('5', '4', '已点货');
  218. INSERT INTO `status` VALUES ('6', '5', '拒收');
  219. INSERT INTO `status` VALUES ('7', '6', '已发货');
  220. INSERT INTO `status` VALUES ('8', '7', '已承运');
  221. -- ----------------------------
  222. -- Table structure for `supplier_carrier`
  223. -- ----------------------------
  224. DROP TABLE IF EXISTS `supplier_carrier`;
  225. CREATE TABLE `supplier_carrier` (
  226. `id` int(11) NOT NULL AUTO_INCREMENT,
  227. `supplier_id` int(11) NOT NULL,
  228. `carrier_id` int(11) NOT NULL,
  229. PRIMARY KEY (`id`)
  230. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  231. -- ----------------------------
  232. -- Records of supplier_carrier
  233. -- ----------------------------
  234. -- ----------------------------
  235. -- Table structure for `token`
  236. -- ----------------------------
  237. DROP TABLE IF EXISTS `token`;
  238. CREATE TABLE `token` (
  239. `id` int(11) NOT NULL AUTO_INCREMENT,
  240. `user_id` int(11) DEFAULT NULL,
  241. `token` varchar(255) DEFAULT NULL,
  242. PRIMARY KEY (`id`)
  243. ) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=utf8;
  244. -- ----------------------------
  245. -- Records of token
  246. -- ----------------------------
  247. INSERT INTO `token` VALUES ('72', '1', '5d576b8423154e8d9f3c9f944d562868');
  248. -- ----------------------------
  249. -- Table structure for `users`
  250. -- ----------------------------
  251. DROP TABLE IF EXISTS `users`;
  252. CREATE TABLE `users` (
  253. `id` int(11) NOT NULL AUTO_INCREMENT,
  254. `user_id` int(11) NOT NULL,
  255. `username` varchar(255) NOT NULL,
  256. `password` varchar(255) NOT NULL,
  257. `p_id` int(11) DEFAULT NULL COMMENT '上级user_id',
  258. `role_id` int(11) DEFAULT NULL,
  259. `person_name` varchar(255) DEFAULT NULL,
  260. `random` varchar(255) DEFAULT NULL,
  261. `create_time` bigint(20) DEFAULT NULL,
  262. `update_time` bigint(20) DEFAULT NULL,
  263. `state` tinyint(4) DEFAULT NULL,
  264. PRIMARY KEY (`id`)
  265. ) ENGINE=InnoDB AUTO_INCREMENT=319 DEFAULT CHARSET=utf8;
  266. -- ----------------------------
  267. -- Records of users
  268. -- ----------------------------
  269. INSERT INTO `users` VALUES ('318', '1', 'admin', '123456', null, '5', '管理员', 'sA4vfeQGqD', '1518144355022', '1518144355022', '1');