create_db.sql 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. /*
  2. SQLyog v12.2.6 (64 bit)
  3. MySQL - 8.0.11 : Database - factory_db
  4. *********************************************************************
  5. */
  6. /*!40101 SET NAMES utf8 */;
  7. /*!40101 SET SQL_MODE=''*/;
  8. /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
  9. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  10. /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  11. /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
  12. /*Table structure for table `ao_com_notice` */
  13. DROP TABLE IF EXISTS `ao_com_notice`;
  14. CREATE TABLE `ao_com_notice` (
  15. `id` int(11) NOT NULL AUTO_INCREMENT,
  16. `title` varchar(200) NOT NULL COMMENT '标题',
  17. `content` text COMMENT '内容',
  18. `published_on` datetime NOT NULL COMMENT '发布时间',
  19. `published_by` varchar(20) DEFAULT NULL COMMENT '发布人',
  20. `published_by_dept_name` varchar(30) NOT NULL COMMENT '发布部门',
  21. `notice_type` char(1) DEFAULT NULL COMMENT '通告类型A全体,F飞行,C乘务员,S安全员',
  22. `notice_level` char(1) DEFAULT NULL COMMENT '通告等级G局方,C公司,D部门',
  23. `notice_cat` varchar(20) DEFAULT NULL COMMENT '通告类型:字典 安全提示签派提示',
  24. `language` varchar(5) NOT NULL COMMENT '语言zh-CN,en',
  25. `is_must_reed` tinyint(1) DEFAULT '0' COMMENT '1必读,0选读',
  26. PRIMARY KEY (`id`)
  27. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公司公告';
  28. /*Table structure for table `ao_file_learning` */
  29. DROP TABLE IF EXISTS `ao_file_learning`;
  30. CREATE TABLE `ao_file_learning` (
  31. `id` int(11) NOT NULL AUTO_INCREMENT,
  32. `title` varchar(200) NOT NULL COMMENT '标题',
  33. `content` varchar(2000) DEFAULT NULL COMMENT '内容',
  34. `published_on` datetime NOT NULL COMMENT '发布时间',
  35. `published_by` varchar(20) DEFAULT NULL COMMENT '发布人',
  36. `published_by_dept_name` varchar(30) NOT NULL COMMENT '发布部门',
  37. `notice_type` char(1) DEFAULT NULL COMMENT '通告类型A全体,F飞行,C乘务员,S安全员',
  38. `file_path` varchar(20) DEFAULT NULL COMMENT '文件路径',
  39. `language` varchar(5) NOT NULL COMMENT '语言zh-CN,en',
  40. `is_must_reed` tinyint(1) DEFAULT '0' COMMENT '1必读,0选读',
  41. PRIMARY KEY (`id`)
  42. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文件学习';
  43. /*Table structure for table `com_dictionary` */
  44. DROP TABLE IF EXISTS `com_dictionary`;
  45. CREATE TABLE `com_dictionary` (
  46. `dict_id` int(11) NOT NULL AUTO_INCREMENT,
  47. `dict_code` varchar(20) NOT NULL COMMENT '字典编码',
  48. `dict_name` varchar(50) NOT NULL COMMENT '字典名称',
  49. `dict_type` varchar(20) NOT NULL COMMENT '字典类型,clientLevel,certType',
  50. `parent_dict_id` int(11) DEFAULT NULL COMMENT '父类型ID默认为0',
  51. `dict_name_en` varchar(50) DEFAULT NULL COMMENT '字典英文名称',
  52. `enable_state` char(1) NOT NULL COMMENT '启用状态,1为启用,0禁用',
  53. `order_no` tinyint(4) DEFAULT NULL COMMENT '排序值',
  54. `dict_ico` varchar(50) DEFAULT NULL COMMENT '字典图标地址',
  55. `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
  56. `created_by` varchar(20) DEFAULT NULL COMMENT '创建人工号',
  57. `modified_on` timestamp NULL DEFAULT NULL COMMENT '修改日期',
  58. `modified_by` varchar(20) DEFAULT NULL COMMENT '修改人工号',
  59. PRIMARY KEY (`dict_id`)
  60. ) ENGINE=InnoDB AUTO_INCREMENT=306 DEFAULT CHARSET=utf8 COMMENT='数据字典';
  61. /*Table structure for table `com_dictionary_mapping` */
  62. DROP TABLE IF EXISTS `com_dictionary_mapping`;
  63. CREATE TABLE `com_dictionary_mapping` (
  64. `id` int(11) NOT NULL AUTO_INCREMENT,
  65. `dict_type` varchar(30) DEFAULT NULL COMMENT '平台字典类型',
  66. `dict_code_cloud` varchar(20) NOT NULL COMMENT '平台字典项编号',
  67. `dict_code_third_sys` varchar(20) DEFAULT NULL COMMENT '第三方系统字典项编号',
  68. `dict_code_third_type` varchar(20) DEFAULT NULL COMMENT '第三方系统中字典类型,abnormal_reason不正常原因',
  69. `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
  70. `created_by` varchar(20) DEFAULT NULL COMMENT '创建人工号',
  71. `modified_on` timestamp NULL DEFAULT NULL COMMENT '修改日期',
  72. `modified_by` varchar(20) DEFAULT NULL COMMENT '修改人工号',
  73. PRIMARY KEY (`id`),
  74. KEY `ind_dict_mapping_third_sys` (`dict_code_third_sys`,`dict_code_third_type`)
  75. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='第三方数据字典com_dictionary与业务系统字典映射';
  76. /*Table structure for table `ep_board_spot` */
  77. DROP TABLE IF EXISTS `ep_board_spot`;
  78. CREATE TABLE `ep_board_spot` (
  79. `combine_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '对应关系编码',
  80. `ep_id` int(11) NOT NULL COMMENT '采集机ID',
  81. `board_id` int(11) NOT NULL COMMENT '控制板ID',
  82. `spot_id` int(11) NOT NULL COMMENT '工位ID',
  83. `arg` int(11) NOT NULL COMMENT '附加参数',
  84. PRIMARY KEY (`combine_id`)
  85. ) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8 COMMENT='采集点对应';
  86. /*Table structure for table `ep_config` */
  87. DROP TABLE IF EXISTS `ep_config`;
  88. CREATE TABLE `ep_config` (
  89. `ep_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '采集机ID',
  90. `flow_id` int(11) NOT NULL COMMENT '生产线ID',
  91. `spots` int(11) NOT NULL COMMENT '工位数量',
  92. `extra` varchar(5000) NOT NULL COMMENT '设置选项',
  93. PRIMARY KEY (`ep_id`)
  94. ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='采集设置';
  95. /*Table structure for table `ep_state` */
  96. DROP TABLE IF EXISTS `ep_state`;
  97. CREATE TABLE `ep_state` (
  98. `ep_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '采集机ID',
  99. `spot_data` varchar(5000) NOT NULL COMMENT '工位数据',
  100. `spot_worker` varchar(5000) NOT NULL COMMENT '工人产量数据',
  101. PRIMARY KEY (`ep_id`)
  102. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='采集状态';
  103. /*Table structure for table `ep_system` */
  104. DROP TABLE IF EXISTS `ep_system`;
  105. CREATE TABLE `ep_system` (
  106. `data_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '数据ID',
  107. `ep_id` int(11) NOT NULL COMMENT '设备Id',
  108. `cpu` varchar(100) NOT NULL COMMENT 'CPU使用',
  109. `memory` varchar(100) NOT NULL COMMENT '内存使用',
  110. `processes` varchar(5000) NOT NULL COMMENT '进程信息',
  111. `os` varchar(100) NOT NULL COMMENT '操作系统',
  112. `runtime` varchar(2000) NOT NULL COMMENT '运行环境',
  113. PRIMARY KEY (`data_id`)
  114. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='采集机运行状态';
  115. /*Table structure for table `fc_bi_factory_daily` */
  116. DROP TABLE IF EXISTS `fc_bi_factory_daily`;
  117. CREATE TABLE `fc_bi_factory_daily` (
  118. `data_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '数据标识',
  119. `pass_num` int(11) NOT NULL COMMENT '合格品数量',
  120. `fc_day` date NOT NULL COMMENT '记录日期',
  121. `fail_num` int(11) NOT NULL COMMENT '坏品数量',
  122. `fail_rate` int(11) NOT NULL COMMENT '坏品率',
  123. `avg_due` int(11) NOT NULL COMMENT '平均堆积数',
  124. PRIMARY KEY (`data_id`)
  125. ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='全厂按日统计';
  126. /*Table structure for table `fc_bi_flow_daily` */
  127. DROP TABLE IF EXISTS `fc_bi_flow_daily`;
  128. CREATE TABLE `fc_bi_flow_daily` (
  129. `data_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '统计ID',
  130. `flow_id` int(11) NOT NULL COMMENT '生产线ID',
  131. `fc_day` date NOT NULL COMMENT '记录日期',
  132. `fail_num` int(11) NOT NULL COMMENT '坏品数量',
  133. `fail_rate` int(11) NOT NULL COMMENT '坏品率',
  134. `avg_due` int(11) NOT NULL COMMENT '平均堆积数',
  135. `pass_num` int(11) NOT NULL COMMENT '合格品数量',
  136. PRIMARY KEY (`data_id`)
  137. ) ENGINE=InnoDB AUTO_INCREMENT=126 DEFAULT CHARSET=utf8 COMMENT='产线按日统计';
  138. /*Table structure for table `fc_bi_worker_daily` */
  139. DROP TABLE IF EXISTS `fc_bi_worker_daily`;
  140. CREATE TABLE `fc_bi_worker_daily` (
  141. `data_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '统计数据ID',
  142. `worker_id` int(11) NOT NULL COMMENT '员工ID',
  143. `fc_day` date NOT NULL COMMENT '记录日期',
  144. `fail_num` int(11) NOT NULL COMMENT '坏品数量',
  145. `fail_rate` int(11) NOT NULL COMMENT '坏品率',
  146. `avg_due` int(11) NOT NULL COMMENT '平均堆积数',
  147. `pass_num` int(11) NOT NULL COMMENT '合格品数量',
  148. PRIMARY KEY (`data_id`)
  149. ) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8 COMMENT='按日统计';
  150. /*Table structure for table `fc_flow` */
  151. DROP TABLE IF EXISTS `fc_flow`;
  152. CREATE TABLE `fc_flow` (
  153. `flow_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '生产线ID',
  154. `flow_name` varchar(100) NOT NULL COMMENT '生产线名称',
  155. `flow_place` varchar(100) NOT NULL COMMENT '生产线地点',
  156. `flow_master_id` int(11) NOT NULL COMMENT '负责人ID',
  157. `flow_spots` int(11) NOT NULL COMMENT '生产线工位数量',
  158. PRIMARY KEY (`flow_id`)
  159. ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='生产线信息';
  160. /*Table structure for table `fc_sector` */
  161. DROP TABLE IF EXISTS `fc_sector`;
  162. CREATE TABLE `fc_sector` (
  163. `sector_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '工序ID',
  164. `sector_name` varchar(200) NOT NULL COMMENT '工序名称',
  165. `flow_id` int(11) NOT NULL COMMENT '生产线ID',
  166. `sector_order` int(11) NOT NULL COMMENT '产线内顺序',
  167. `counter` int(11) DEFAULT '1' COMMENT '计数方法',
  168. PRIMARY KEY (`sector_id`)
  169. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='工序定义';
  170. /*Table structure for table `fc_sector_spot` */
  171. DROP TABLE IF EXISTS `fc_sector_spot`;
  172. CREATE TABLE `fc_sector_spot` (
  173. `combine_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '关系ID',
  174. `sector_id` int(11) NOT NULL COMMENT '工序ID',
  175. `spot_id` int(11) NOT NULL COMMENT '工位ID',
  176. `spot_order` int(11) NOT NULL COMMENT '工序内工位顺序',
  177. PRIMARY KEY (`combine_id`)
  178. ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='工序内部';
  179. /*Table structure for table `fc_spot` */
  180. DROP TABLE IF EXISTS `fc_spot`;
  181. CREATE TABLE `fc_spot` (
  182. `spot_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '工位ID',
  183. `flow_id` int(11) NOT NULL COMMENT '生产线ID',
  184. `spot_name` varchar(50) DEFAULT NULL COMMENT '工位名称',
  185. `order_num` int(11) NOT NULL COMMENT '生产线内顺序',
  186. `ratio` int(11) NOT NULL COMMENT '产能比例',
  187. PRIMARY KEY (`spot_id`)
  188. ) ENGINE=InnoDB AUTO_INCREMENT=64 DEFAULT CHARSET=utf8 COMMENT='生产工位表';
  189. /*Table structure for table `fc_spot_extra` */
  190. DROP TABLE IF EXISTS `fc_spot_extra`;
  191. CREATE TABLE `fc_spot_extra` (
  192. `spot_id` int(11) NOT NULL COMMENT '工位ID',
  193. `spot_period` int(11) NOT NULL COMMENT '工位统计周期',
  194. `spot_threshold_failnum` int(11) NOT NULL COMMENT '坏品数阈值',
  195. `spot_threshold_failrate` decimal(10,0) NOT NULL COMMENT '坏品率阈值',
  196. `spot_threshold_min_output` int(11) NOT NULL COMMENT '产能阈值',
  197. PRIMARY KEY (`spot_id`)
  198. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='工位统计信息';
  199. /*Table structure for table `fc_system_event` */
  200. DROP TABLE IF EXISTS `fc_system_event`;
  201. CREATE TABLE `fc_system_event` (
  202. `sysev_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '事件记录ID',
  203. `event_type` int(11) NOT NULL COMMENT '事件类型',
  204. `event_level` int(11) NOT NULL COMMENT '事件严重等级',
  205. `event_title` varchar(300) DEFAULT NULL COMMENT '事件标题',
  206. `event_detail` varchar(1000) DEFAULT NULL COMMENT '事件详情',
  207. `event_status` int(11) NOT NULL COMMENT '事件状态',
  208. `time_point` bigint(20) NOT NULL COMMENT '发生时间',
  209. PRIMARY KEY (`sysev_id`)
  210. ) ENGINE=InnoDB AUTO_INCREMENT=12971 DEFAULT CHARSET=utf8 COMMENT='系统事件';
  211. /*Table structure for table `fc_work_period` */
  212. DROP TABLE IF EXISTS `fc_work_period`;
  213. CREATE TABLE `fc_work_period` (
  214. `period_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '时间段ID',
  215. `period_name` varchar(100) NOT NULL COMMENT '时间段名称',
  216. `start_second` int(11) NOT NULL COMMENT '开始时间',
  217. `end_second` int(11) NOT NULL COMMENT '结束时间',
  218. PRIMARY KEY (`period_id`)
  219. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='工作时间段信息';
  220. /*Table structure for table `fc_work_raw` */
  221. DROP TABLE IF EXISTS `fc_work_raw`;
  222. CREATE TABLE `fc_work_raw` (
  223. `raw_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '原始数据ID',
  224. `schedule_id` int(11) NOT NULL DEFAULT '0' COMMENT '班次ID',
  225. `board_id` int(11) NOT NULL COMMENT '控制板ID',
  226. `timing` bigint(20) NOT NULL COMMENT '时间点',
  227. `handheld_id` int(11) NOT NULL COMMENT '手持ID',
  228. `pass_num` int(11) NOT NULL COMMENT '合格品数量',
  229. `total_num` int(11) NOT NULL COMMENT '总计数量',
  230. `hand_pass` int(11) NOT NULL COMMENT '手持合格数',
  231. `hand_total` int(11) NOT NULL COMMENT '手持总计数',
  232. PRIMARY KEY (`raw_id`),
  233. KEY `handheld_id` (`handheld_id`),
  234. KEY `board_id` (`board_id`)
  235. ) ENGINE=InnoDB AUTO_INCREMENT=78272 DEFAULT CHARSET=utf8 COMMENT='原始工作量数据';
  236. /*Table structure for table `fc_work_schedule` */
  237. DROP TABLE IF EXISTS `fc_work_schedule`;
  238. CREATE TABLE `fc_work_schedule` (
  239. `schedule_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '班次ID',
  240. `work_day` date NOT NULL COMMENT '班次日期',
  241. `start_time` datetime NOT NULL COMMENT '实际开始',
  242. `end_time` datetime NOT NULL COMMENT '实际结束',
  243. `period_id` int(11) NOT NULL COMMENT '工作时间段ID',
  244. `flow_id` int(11) NOT NULL COMMENT '生产线ID',
  245. `start_uid` int(11) NOT NULL COMMENT '上班操作人',
  246. `end_uid` int(11) NOT NULL COMMENT '下班操作人',
  247. `status` int(11) NOT NULL COMMENT '班次状态',
  248. PRIMARY KEY (`schedule_id`)
  249. ) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8 COMMENT='班次信息';
  250. /*Table structure for table `fc_work_schedule_event` */
  251. DROP TABLE IF EXISTS `fc_work_schedule_event`;
  252. CREATE TABLE `fc_work_schedule_event` (
  253. `event_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '事件记录ID',
  254. `schedule_id` int(11) NOT NULL COMMENT '班次ID',
  255. `evtype` int(11) NOT NULL COMMENT '事件类型',
  256. `period_id` int(11) NOT NULL COMMENT '时间段ID',
  257. `worker_id` int(11) NOT NULL COMMENT '工人ID',
  258. `spot_id` int(11) NOT NULL COMMENT '工位ID',
  259. `occurance` datetime NOT NULL COMMENT '实际发生时间',
  260. PRIMARY KEY (`event_id`)
  261. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='工作上下班信息';
  262. /*Table structure for table `fc_work_schedule_load` */
  263. DROP TABLE IF EXISTS `fc_work_schedule_load`;
  264. CREATE TABLE `fc_work_schedule_load` (
  265. `load_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '班次产量ID',
  266. `schedule_id` int(11) NOT NULL COMMENT '班次ID',
  267. `spot_id` int(11) NOT NULL COMMENT '工位ID',
  268. `user_id` int(11) NOT NULL COMMENT '员工ID',
  269. `pass_num` int(11) NOT NULL COMMENT '合格数量',
  270. `fail_num` int(11) NOT NULL COMMENT '坏品数量',
  271. `due` int(11) NOT NULL COMMENT '堆积数量',
  272. `time_point` bigint(20) NOT NULL COMMENT '时间点',
  273. PRIMARY KEY (`load_id`)
  274. ) ENGINE=InnoDB AUTO_INCREMENT=82 DEFAULT CHARSET=utf8 COMMENT='班次产量信息';
  275. /*Table structure for table `fc_work_schedule_outcome` */
  276. DROP TABLE IF EXISTS `fc_work_schedule_outcome`;
  277. CREATE TABLE `fc_work_schedule_outcome` (
  278. `outcome_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '产能数据ID',
  279. `schedule_id` int(4) NOT NULL COMMENT '班次ID',
  280. `spot_id` int(11) NOT NULL COMMENT '工位ID',
  281. `worker_id` int(11) NOT NULL COMMENT '员工ID',
  282. `pass_num` int(11) NOT NULL COMMENT '合格数量',
  283. `fail_num` int(11) NOT NULL COMMENT '坏品数量',
  284. `avg_due` int(11) NOT NULL COMMENT '平均堆积数量',
  285. PRIMARY KEY (`outcome_id`)
  286. ) ENGINE=InnoDB AUTO_INCREMENT=120 DEFAULT CHARSET=utf8 COMMENT='产能数据结算';
  287. /*Table structure for table `fc_worker` */
  288. DROP TABLE IF EXISTS `fc_worker`;
  289. CREATE TABLE `fc_worker` (
  290. `user_id` int(10) NOT NULL AUTO_INCREMENT COMMENT '本系统用户ID',
  291. `user_local_no` char(30) DEFAULT NULL COMMENT '公司内工号',
  292. `user_login_name` varchar(50) DEFAULT NULL COMMENT '员工设备名',
  293. `password` varchar(50) DEFAULT NULL COMMENT '密码',
  294. `user_name` varchar(50) DEFAULT NULL COMMENT '姓名',
  295. `user_name_en` varchar(50) DEFAULT NULL COMMENT '拼音',
  296. `mobile_phone` varchar(50) DEFAULT NULL COMMENT '手机',
  297. `dept_id` varchar(50) DEFAULT NULL COMMENT '部门ID',
  298. `dept_name` varchar(30) DEFAULT NULL COMMENT '部门名称',
  299. `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态1有效,0无效',
  300. `gender` varchar(1) DEFAULT NULL COMMENT '性别',
  301. `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
  302. `created_by` varchar(20) DEFAULT NULL COMMENT '创建人的工号',
  303. `modified_on` timestamp NULL DEFAULT NULL COMMENT '修改日期',
  304. `modified_by` varchar(20) DEFAULT NULL COMMENT '修改人的工号',
  305. PRIMARY KEY (`user_id`),
  306. UNIQUE KEY `user_local_no` (`user_local_no`),
  307. KEY `idx_userno` (`user_id`)
  308. ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8 COMMENT='员工信息表';
  309. /*Table structure for table `sys_atachment` */
  310. DROP TABLE IF EXISTS `sys_atachment`;
  311. CREATE TABLE `sys_atachment` (
  312. `id` int(11) NOT NULL AUTO_INCREMENT,
  313. `parent_table_name` varchar(30) NOT NULL COMMENT '主表名',
  314. `parent_row_id` varchar(50) NOT NULL COMMENT '主表记录ID',
  315. `file_name` varchar(500) NOT NULL COMMENT '文件名',
  316. `file_ext_name` varchar(20) NOT NULL COMMENT '文件扩展名',
  317. `file_path` varchar(500) NOT NULL COMMENT '文件路径',
  318. `order_no` tinyint(4) DEFAULT NULL COMMENT '排序,正序1在前',
  319. `created_by_code` varchar(10) DEFAULT NULL COMMENT '创建人工号',
  320. `created_by_name` varchar(30) DEFAULT NULL COMMENT '创建人姓名',
  321. `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
  322. `created_by` varchar(20) DEFAULT NULL COMMENT '创建人工号',
  323. `modified_on` timestamp NULL DEFAULT NULL COMMENT '修改日期',
  324. `modified_by` varchar(20) DEFAULT NULL COMMENT '修改人工号',
  325. PRIMARY KEY (`id`)
  326. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='附件';
  327. /*Table structure for table `sys_feedback` */
  328. DROP TABLE IF EXISTS `sys_feedback`;
  329. CREATE TABLE `sys_feedback` (
  330. `id` int(11) NOT NULL AUTO_INCREMENT,
  331. `feedback_type` varchar(20) NOT NULL COMMENT '反馈类型字典值,字典feedbackType',
  332. `feedback_type_name` varchar(50) DEFAULT NULL COMMENT '反馈类型名称',
  333. `content` varchar(2000) NOT NULL COMMENT '内容',
  334. `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
  335. `created_by` varchar(20) DEFAULT NULL COMMENT '创建人工号',
  336. `modified_on` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '修改日期',
  337. `modified_by` varchar(20) DEFAULT NULL COMMENT '修改人',
  338. PRIMARY KEY (`id`)
  339. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='问题反馈';
  340. /*Table structure for table `sys_master_server` */
  341. DROP TABLE IF EXISTS `sys_master_server`;
  342. CREATE TABLE `sys_master_server` (
  343. `item_id` int(10) unsigned NOT NULL,
  344. `server_ip` int(10) unsigned NOT NULL COMMENT '主控IP',
  345. `updatetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间戳',
  346. PRIMARY KEY (`item_id`)
  347. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='负载均衡-定时任务主服务器';
  348. /*Table structure for table `sys_personal` */
  349. DROP TABLE IF EXISTS `sys_personal`;
  350. CREATE TABLE `sys_personal` (
  351. `user_no` varchar(20) NOT NULL COMMENT '用户工号',
  352. `head_img` varchar(200) DEFAULT NULL COMMENT '头像URL',
  353. `birthday` date DEFAULT NULL COMMENT '出生日期',
  354. `phone_bak` varchar(30) DEFAULT NULL COMMENT '备用电话',
  355. `email` varchar(50) DEFAULT NULL COMMENT '邮箱',
  356. `specialty` varchar(100) DEFAULT NULL COMMENT '特长',
  357. `wechat` varchar(30) DEFAULT NULL COMMENT '微信号',
  358. `open_wx` tinyint(1) DEFAULT '0' COMMENT '是否公开微信号 1公开0隐藏',
  359. `address` varchar(200) DEFAULT NULL COMMENT '深圳住址',
  360. `open_addr` tinyint(1) DEFAULT NULL COMMENT '是否公开深圳住址 1公开0隐藏',
  361. `car_id` varchar(20) DEFAULT NULL COMMENT '车牌号',
  362. `open_car_id` tinyint(1) DEFAULT NULL COMMENT '是否公开车牌 1公开0隐藏',
  363. `parent_addr` varchar(200) DEFAULT NULL COMMENT '父母住址',
  364. `open_par_addr` tinyint(1) DEFAULT NULL COMMENT '是否父母地址 1公开0隐藏',
  365. `life_photo_1` varchar(200) DEFAULT NULL COMMENT '生活照地址1',
  366. `life_photo_2` varchar(200) DEFAULT NULL COMMENT '生活照地址2',
  367. `life_photo_3` varchar(200) DEFAULT NULL COMMENT '生活照地址3',
  368. `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
  369. `created_by` varchar(20) DEFAULT NULL COMMENT '创建人工号',
  370. `modified_on` timestamp NULL DEFAULT NULL COMMENT '修改日期',
  371. `modified_by` varchar(20) DEFAULT NULL COMMENT '修改人工号',
  372. PRIMARY KEY (`user_no`)
  373. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='个人信息';
  374. /*Table structure for table `sys_resource` */
  375. DROP TABLE IF EXISTS `sys_resource`;
  376. CREATE TABLE `sys_resource` (
  377. `id` int(11) NOT NULL AUTO_INCREMENT,
  378. `name` varchar(50) NOT NULL COMMENT '名称',
  379. `code` varchar(80) DEFAULT NULL COMMENT '编码',
  380. `res_type` char(1) DEFAULT NULL COMMENT '资源类型(M菜单,B按钮)',
  381. `url` varchar(120) DEFAULT NULL COMMENT '菜单地址',
  382. `parent_id` int(11) DEFAULT NULL COMMENT '父ID',
  383. `is_show` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1显示,0不显示',
  384. `menu_order` tinyint(4) DEFAULT NULL COMMENT '顺序',
  385. `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
  386. `created_by` varchar(20) DEFAULT NULL COMMENT '创建人工号',
  387. `modified_on` timestamp NULL DEFAULT NULL COMMENT '修改日期',
  388. `modified_by` varchar(20) DEFAULT NULL COMMENT '修改人工号',
  389. PRIMARY KEY (`id`)
  390. ) ENGINE=InnoDB AUTO_INCREMENT=121 DEFAULT CHARSET=utf8 COMMENT='资源';
  391. /*Table structure for table `sys_role` */
  392. DROP TABLE IF EXISTS `sys_role`;
  393. CREATE TABLE `sys_role` (
  394. `id` int(11) NOT NULL AUTO_INCREMENT,
  395. `name` varchar(50) NOT NULL COMMENT '角色名称',
  396. `role_code` varchar(20) DEFAULT NULL COMMENT '角色编号',
  397. `remark` varchar(200) DEFAULT NULL COMMENT '说明',
  398. `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
  399. `created_by` varchar(20) DEFAULT NULL COMMENT '创建人工号',
  400. `modified_on` timestamp NULL DEFAULT NULL COMMENT '修改日期',
  401. `modified_by` varchar(20) DEFAULT NULL COMMENT '修改人工号',
  402. `is_default` varchar(1) DEFAULT '0',
  403. PRIMARY KEY (`id`)
  404. ) ENGINE=InnoDB AUTO_INCREMENT=83 DEFAULT CHARSET=utf8 COMMENT='角色';
  405. /*Table structure for table `sys_role_resource` */
  406. DROP TABLE IF EXISTS `sys_role_resource`;
  407. CREATE TABLE `sys_role_resource` (
  408. `id` int(11) NOT NULL AUTO_INCREMENT,
  409. `role_id` int(11) NOT NULL,
  410. `resource_id` int(11) NOT NULL,
  411. `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
  412. `created_by` varchar(20) DEFAULT NULL COMMENT '创建人工号',
  413. `modified_on` timestamp NULL DEFAULT NULL COMMENT '修改日期',
  414. `modified_by` varchar(20) DEFAULT NULL COMMENT '修改人工号',
  415. PRIMARY KEY (`id`)
  416. ) ENGINE=InnoDB AUTO_INCREMENT=1556 DEFAULT CHARSET=utf8 COMMENT='角色资源权限';
  417. /*Table structure for table `sys_user` */
  418. DROP TABLE IF EXISTS `sys_user`;
  419. CREATE TABLE `sys_user` (
  420. `user_no` varchar(20) NOT NULL COMMENT '用户工号',
  421. `user_login_name` varchar(50) DEFAULT NULL COMMENT '账号',
  422. `password` varchar(50) DEFAULT NULL COMMENT '密码',
  423. `user_name` varchar(50) DEFAULT NULL,
  424. `user_name_en` varchar(50) DEFAULT NULL,
  425. `mobile_phone` varchar(50) DEFAULT NULL COMMENT '手机',
  426. `p_code` varchar(20) DEFAULT NULL COMMENT 'FOC代码',
  427. `dept_id` varchar(50) DEFAULT NULL COMMENT '部门ID',
  428. `dept_name` varchar(30) DEFAULT NULL COMMENT '部门名称',
  429. `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态1有效,0无效',
  430. `gender` varchar(1) DEFAULT NULL COMMENT '性别',
  431. `crew_type` char(1) DEFAULT NULL COMMENT '机组人员类型F飞行,C乘务员,S安全员',
  432. `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
  433. `created_by` varchar(20) DEFAULT NULL COMMENT '创建人工号',
  434. `modified_on` timestamp NULL DEFAULT NULL COMMENT '修改日期',
  435. `modified_by` varchar(20) DEFAULT NULL COMMENT '修改人工号',
  436. PRIMARY KEY (`user_no`),
  437. KEY `idx_userno` (`user_no`)
  438. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户表';
  439. /*Table structure for table `sys_user_device_binding` */
  440. DROP TABLE IF EXISTS `sys_user_device_binding`;
  441. CREATE TABLE `sys_user_device_binding` (
  442. `id` int(11) DEFAULT NULL,
  443. `user_no` tinytext,
  444. `client_id` tinytext,
  445. `device_name` tinytext,
  446. `bind_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  447. `last_login_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  448. `on_black_list` tinyint(4) DEFAULT NULL,
  449. `created_on` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  450. `created_by` tinytext,
  451. `modified_on` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  452. `modified_by` tinytext
  453. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='用户绑定设备表';
  454. /*Table structure for table `sys_user_role` */
  455. DROP TABLE IF EXISTS `sys_user_role`;
  456. CREATE TABLE `sys_user_role` (
  457. `id` int(11) DEFAULT NULL,
  458. `user_no` tinytext CHARACTER SET latin1 COLLATE latin1_swedish_ci,
  459. `role_id` int(11) DEFAULT NULL,
  460. `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  461. `created_by` tinytext CHARACTER SET latin1 COLLATE latin1_swedish_ci,
  462. `modified_on` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  463. `modified_by` tinytext CHARACTER SET latin1 COLLATE latin1_swedish_ci
  464. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户角色';
  465. /*Table structure for table `sys_visit_log` */
  466. DROP TABLE IF EXISTS `sys_visit_log`;
  467. CREATE TABLE `sys_visit_log` (
  468. `log_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  469. `log_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  470. `call_api` tinytext,
  471. `api_desc` varchar(200) DEFAULT NULL,
  472. `user_no` tinytext,
  473. `device` tinytext,
  474. `remote_addr` tinytext,
  475. `remote_host` tinytext,
  476. `input_params` varchar(200) DEFAULT NULL,
  477. `error` int(11) DEFAULT NULL,
  478. `time_consuming` int(11) DEFAULT NULL,
  479. `bak` varchar(200) DEFAULT NULL,
  480. PRIMARY KEY (`log_id`)
  481. ) ENGINE=InnoDB AUTO_INCREMENT=1990103 DEFAULT CHARSET=latin1 COMMENT='系统API调用日志表';
  482. /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  483. /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  484. /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  485. /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;