epp.sql 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*
  2. Navicat MySQL Data Transfer
  3. Source Server : 192.168.0.22
  4. Source Server Version : 50735
  5. Source Host : 192.168.0.22:3306
  6. Source Database : epp
  7. Target Server Type : MYSQL
  8. Target Server Version : 50735
  9. File Encoding : 65001
  10. Date: 2022-01-26 10:29:41
  11. */
  12. SET FOREIGN_KEY_CHECKS=0;
  13. -- ----------------------------
  14. -- Table structure for notice_receive
  15. -- ----------------------------
  16. DROP TABLE IF EXISTS `notice_receive`;
  17. CREATE TABLE `notice_receive` (
  18. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  19. `receiver_id` varchar(20) NOT NULL COMMENT '收件人id',
  20. `notice_send_id` bigint(20) NOT NULL COMMENT '发件箱id',
  21. `title` varchar(255) NOT NULL COMMENT '主题',
  22. `content` text NOT NULL COMMENT '内容',
  23. `attachment` varchar(100) DEFAULT NULL COMMENT '附件',
  24. `is_look` tinyint(1) DEFAULT '0' COMMENT '是否查看;0:未查看 1:已查看',
  25. `is_del` tinyint(1) DEFAULT '0' COMMENT '是否删除,0:未删除;1:已删除。',
  26. `update_time` bigint(20) DEFAULT NULL COMMENT '更新时间;yyyyMMddHHmmss',
  27. `sender_id` varchar(20) NOT NULL COMMENT '发件人id',
  28. `receiver_ids` text COMMENT '接收人ids,id以","分隔',
  29. PRIMARY KEY (`id`)
  30. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='消息通知-收件箱';
  31. -- ----------------------------
  32. -- Records of notice_receive
  33. -- ----------------------------
  34. -- ----------------------------
  35. -- Table structure for notice_send
  36. -- ----------------------------
  37. DROP TABLE IF EXISTS `notice_send`;
  38. CREATE TABLE `notice_send` (
  39. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  40. `title` varchar(255) NOT NULL COMMENT '主题',
  41. `content` text NOT NULL COMMENT '内容',
  42. `attachment` varchar(100) DEFAULT NULL COMMENT '附件',
  43. `receiver_ids` text NOT NULL COMMENT '接收人ids,id以","分隔',
  44. `is_send` tinyint(1) DEFAULT '0' COMMENT '是否发送;0:草稿;1:已发送',
  45. `is_del` tinyint(1) DEFAULT '0' COMMENT '是否删除,0:未删除;1:已删除。',
  46. `update_time` bigint(20) DEFAULT NULL COMMENT '创建时间;yyyyMMddHHmmss',
  47. `sender_id` varchar(20) NOT NULL COMMENT '发件人id',
  48. PRIMARY KEY (`id`)
  49. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='消息通知-发件箱';
  50. -- ----------------------------
  51. -- Records of notice_send
  52. -- ----------------------------
  53. -- ----------------------------
  54. -- Table structure for push_events
  55. -- ----------------------------
  56. DROP TABLE IF EXISTS `push_events`;
  57. CREATE TABLE `push_events` (
  58. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  59. `user_id` int(11) NOT NULL COMMENT '用户id',
  60. `company_id` int(11) NOT NULL COMMENT '企业id',
  61. `monitor_id` bigint(20) NOT NULL COMMENT '设备id',
  62. `event_content` text NOT NULL COMMENT '发生异常企业id',
  63. `event_time` bigint(20) NOT NULL COMMENT '报警时间',
  64. `read_flag` tinyint(1) NOT NULL COMMENT '0:未读,1:已读',
  65. `type` int(1) NOT NULL COMMENT '0:web,1:app,2:wechat,3:message',
  66. `event_code` varchar(20) DEFAULT NULL COMMENT '报警类型,见epp_sysbase.t_sys_dictory',
  67. `first_search_time` bigint(20) DEFAULT NULL COMMENT '客户端首次查询的时间(列表接口)',
  68. `read_time` bigint(20) DEFAULT NULL COMMENT '客户端已读的时间(打开详情已读)',
  69. `warn_id` bigint(20) DEFAULT NULL,
  70. `create_time` bigint(20) DEFAULT NULL COMMENT '报警产生的时间',
  71. PRIMARY KEY (`id`)
  72. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='告警推送';
  73. -- ----------------------------
  74. -- Records of push_events
  75. -- ----------------------------
  76. -- ----------------------------
  77. -- Table structure for report_set
  78. -- ----------------------------
  79. DROP TABLE IF EXISTS `report_set`;
  80. CREATE TABLE `report_set` (
  81. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '唯一id',
  82. `name` varchar(100) DEFAULT NULL COMMENT '报表名称',
  83. `org_id` int(11) DEFAULT NULL COMMENT '所属机构id',
  84. `display` varchar(200) DEFAULT NULL COMMENT '显示列',
  85. `createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  86. `type` tinyint(4) DEFAULT NULL COMMENT '分类;0:异常告警;1:停限产',
  87. PRIMARY KEY (`id`)
  88. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='报表配置表';
  89. -- ----------------------------
  90. -- Records of report_set
  91. -- ----------------------------
  92. -- ----------------------------
  93. -- Table structure for t_warn
  94. -- ----------------------------
  95. DROP TABLE IF EXISTS `t_warn`;
  96. CREATE TABLE `t_warn` (
  97. `id` bigint(20) NOT NULL COMMENT '主键',
  98. `org_id` int(11) DEFAULT NULL COMMENT '机构id',
  99. `company_id` int(20) NOT NULL COMMENT '企业id',
  100. `industry` varchar(20) DEFAULT NULL COMMENT '企业所属行业编码',
  101. `warn_type` varchar(20) NOT NULL,
  102. `warn_state` varchar(20) NOT NULL COMMENT '告警状态:0未恢复1 已恢复 ',
  103. `workshop_monitor_id` bigint(20) DEFAULT NULL COMMENT '车间监测点id',
  104. `cw_virtual_monitor_id` bigint(20) DEFAULT NULL COMMENT '产污虚拟监测点',
  105. `zw_virtual_monitor_id` bigint(20) DEFAULT NULL COMMENT '治污虚拟监测点',
  106. `cw_group_id` bigint(20) DEFAULT NULL COMMENT '产污分组id',
  107. `cw_monitor_ids` varchar(200) DEFAULT NULL COMMENT '产污监测点列表',
  108. `cw_monitor_id` bigint(20) DEFAULT NULL COMMENT '产污监测点id',
  109. `zw_group_id` bigint(20) DEFAULT NULL COMMENT '治污分组id',
  110. `zw_monitor_ids` varchar(200) DEFAULT NULL COMMENT '治污监测点列表',
  111. `zw_monitor_id` bigint(20) DEFAULT NULL COMMENT '治污监测点id',
  112. `update_date` bigint(20) DEFAULT NULL COMMENT '告警时间(创建时间)',
  113. `create_time` bigint(20) DEFAULT NULL COMMENT '(如果告警持续,该时间会更新)',
  114. `plan_id` bigint(20) DEFAULT NULL COMMENT '方案id',
  115. `pfg_id` bigint(20) DEFAULT NULL COMMENT '产污设施分组ID',
  116. `plan_warn_type` varchar(20) DEFAULT NULL COMMENT '方案告警的异常类型',
  117. `plan_excute_id` bigint(20) DEFAULT NULL COMMENT '方案执行的id',
  118. `workshop_monitor_ids` varchar(200) DEFAULT NULL COMMENT '车间监测点列表',
  119. `process_info` text COMMENT '过程信息(记录配置信息,计算结果等重要过程信息){"cw":[["id:14","ptv:90.000","spt:5"]],"zw":[["id:16","ptv:100.000","plt:5","prt:20190116163500~20190116164000"]],"zwTerminalPower":90.883000,"zwg":[["id:3","ac:1","lrt:1"]]}cw:告警产污列表信息 id:编号 ptv:负荷阈值 spt:负荷告警最短持续时间;zw:告警治污列表信息 id:编号 ptv:负荷阈值 plt:负荷控制持续时间 prt:持续时间描述;zwg:告警治污列表信息 id:编号 ac:分组治污设备总数 lrt:分组至少开启治污设备数量;zwTerminalPower:告警发生时产污设备的负荷',
  120. `abnormal_id` bigint(20) DEFAULT NULL COMMENT '治污异常申报id',
  121. `abnormal_create_date` bigint(20) DEFAULT NULL COMMENT '治污异常申报时间',
  122. `abnormal_declare_state` tinyint(1) DEFAULT NULL COMMENT '逾期状态;0:正常申报;1:逾期申报;',
  123. `abnormal_state` varchar(15) DEFAULT '000170001' COMMENT '申报状态,000170001:未申报;000170002:未审核;000170003;审核通过;000170004:审核未通过',
  124. PRIMARY KEY (`id`),
  125. KEY `planMonitorIndex` (`company_id`,`plan_id`,`cw_monitor_id`) USING BTREE,
  126. KEY `planGroupIndex` (`company_id`,`plan_id`,`pfg_id`) USING BTREE,
  127. KEY `warnIndex` (`warn_type`,`update_date`,`warn_state`) USING BTREE
  128. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='报警表,只存储治污报警、限产报警;000090007,000090010';
  129. -- ----------------------------
  130. -- Records of t_warn
  131. -- ----------------------------
  132. -- ----------------------------
  133. -- Table structure for warn_events_history
  134. -- ----------------------------
  135. DROP TABLE IF EXISTS `warn_events_history`;
  136. CREATE TABLE `warn_events_history` (
  137. `id` bigint(20) NOT NULL,
  138. `company_id` int(20) NOT NULL COMMENT '企业id',
  139. `monitor_id` bigint(20) NOT NULL COMMENT '设备id',
  140. `start_time` bigint(20) DEFAULT NULL COMMENT '开始时间',
  141. `end_time` bigint(20) DEFAULT NULL COMMENT '结束时间',
  142. `state` char(1) NOT NULL COMMENT '状态 0:小于等于阈值 1:大于阈值',
  143. PRIMARY KEY (`id`)
  144. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备上电、停机告警、设备停电事件历史记录';
  145. -- ----------------------------
  146. -- Records of warn_events_history
  147. -- ----------------------------