20211103修改.sql 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. delete
  2. from tbl_paln;
  3. delete
  4. from tbl_paln_task;
  5. delete
  6. from tbl_incident;
  7. delete
  8. from tbl_incident_process;
  9. create table b_plan
  10. (
  11. id bigint not null
  12. primary key,
  13. name varchar(255),
  14. type integer,
  15. create_by varchar(64),
  16. create_time timestamp(0),
  17. create_dept varchar(64),
  18. update_by varchar(64),
  19. update_time timestamp(0),
  20. del_flag char default '0'
  21. );
  22. comment
  23. on table b_plan is '预案管理';
  24. comment
  25. on column b_plan.id is '主键id';
  26. comment
  27. on column b_plan.name is '预案名称';
  28. comment
  29. on column b_plan.type is '预案类型';
  30. comment
  31. on column b_plan.create_by is '创建人';
  32. comment
  33. on column b_plan.create_time is '创建时间';
  34. comment
  35. on column b_plan.create_dept is '创建部门';
  36. create table b_plan_task
  37. (
  38. id bigint not null
  39. primary key,
  40. plan_id bigint,
  41. level int,
  42. task_name varchar(255),
  43. task_des varchar(2550),
  44. create_by varchar(64),
  45. create_time timestamp(0),
  46. update_by varchar(64),
  47. update_time timestamp(0),
  48. del_flag char default '0'
  49. );
  50. comment
  51. on table b_plan_task is '预案任务管理';
  52. comment
  53. on column b_plan_task.id is '任务id';
  54. comment
  55. on column b_plan_task.plan_id is '所属预案id';
  56. comment
  57. on column b_plan_task.level is '预案等级';
  58. comment
  59. on column b_plan_task.task_name is '任务名称';
  60. comment
  61. on column b_plan_task.task_des is '任务描述';
  62. comment
  63. on column b_plan_task.create_by is '创建用户';
  64. comment
  65. on column b_plan_task.create_time is '创建时间';
  66. create table b_plan_file
  67. (
  68. id bigint not null primary key,
  69. plan_id bigint,
  70. file_name varchar(255),
  71. file_url varchar(255),
  72. create_by varchar(64),
  73. create_time timestamp(0),
  74. update_by varchar(64),
  75. update_time timestamp(0),
  76. del_flag char default '0'
  77. );
  78. comment
  79. on table b_plan_file is '预案文件管理';
  80. comment
  81. on column b_plan_file.id is '=id';
  82. comment
  83. on column b_plan_file.plan_id is '任务id';
  84. comment
  85. on column b_plan_file.file_name is '文件名称';
  86. comment
  87. on column b_plan_file.file_url is '文件路径';
  88. create table b_incident
  89. (
  90. id bigint not null primary key,
  91. type smallint,
  92. level smallint,
  93. addr varchar(255),
  94. locations varchar(255),
  95. create_dept varchar(64),
  96. create_by varchar(64),
  97. create_time timestamp(0),
  98. update_by varchar(64),
  99. update_time timestamp(0),
  100. del_flag char default '0',
  101. source varchar(16),
  102. des varchar(2550),
  103. pic varchar(2550),
  104. video varchar(2550),
  105. expr1 varchar(255),
  106. expr2 varchar(255),
  107. expr_json text,
  108. name varchar(255),
  109. status smallint,
  110. madin_dept integer,
  111. assist_dept varchar(255)
  112. );
  113. comment on table b_incident is '事件基础表';
  114. comment on column b_incident.id is '主键id';
  115. comment on column b_incident.type is '事件类型';
  116. comment on column b_incident.level is '事件等级';
  117. comment on column b_incident.addr is '事件地址';
  118. comment on column b_incident.locations is '经纬度';
  119. comment on column b_incident.create_dept is '上报部门';
  120. comment on column b_incident.create_by is '上报人';
  121. comment on column b_incident.create_time is '上报时间';
  122. comment on column b_incident.update_by is '修改人';
  123. comment on column b_incident.update_time is '修改时间';
  124. comment on column b_incident.source is '事件来源';
  125. comment on column b_incident.des is '事件描述';
  126. comment on column b_incident.pic is '上传图片地址';
  127. comment on column b_incident.video is '上传视频地址';
  128. comment on column b_incident.expr1 is '拓展1';
  129. comment on column b_incident.expr2 is '拓展2';
  130. comment on column b_incident.expr_json is 'json拓展,用于存取多出的字段';
  131. comment on column b_incident.name is '事件标题';
  132. comment on column b_incident.status is '事件状态 1:预警,2:事件 3:归档';
  133. comment on column b_incident.madin_dept is '主办单位';
  134. comment on column b_incident.assist_dept is '协办单位 多个数据用,分割';
  135. create table b_incident_process
  136. (
  137. id bigint not null primary key,
  138. incident_id bigint,
  139. des varchar(2550),
  140. create_time timestamp(0),
  141. create_by varchar(64),
  142. status smallint
  143. );
  144. comment on table b_incident_process is '事件处置流程';
  145. comment on column b_incident_process.id is '主键id';
  146. comment on column b_incident_process.incident_id is '所属事件id';
  147. comment on column b_incident_process.des is '处置过程';
  148. comment on column b_incident_process.create_time is '过程创建时间';
  149. comment on column b_incident_process.create_by is '过程创建人';
  150. comment on column b_incident_process.status is '流程进度当前状态';
  151. create table b_incident_task
  152. (
  153. id bigint not null primary key,
  154. incident_id bigint,
  155. task_name varchar(255),
  156. create_time timestamp(0),
  157. create_by varchar(64),
  158. del_flag char default '0'
  159. );
  160. comment on table b_incident_task is '事件处置任务';
  161. comment on column b_incident_task.id is '主键id';
  162. comment on column b_incident_task.incident_id is '所属事件id';
  163. comment on column b_incident_task.task_name is '事件任务名称';
  164. comment on column b_incident_task.create_time is '过程创建时间';
  165. comment on column b_incident_task.create_by is '过程创建人';
  166. INSERT INTO sys_dict_type (dict_id, dict_name, dict_type, status, create_by, create_time, update_by, update_time, remark) VALUES (18, '应急资源', 'zhdd_resource', '0', 'admin', '2021-09-28 15:55:09', 'admin', '2021-09-28 15:55:09', null);
  167. INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (127, 0, '应急仓库', '1', 'zhdd_resource', null, 'default', 'N', '0', 'admin', '2021-09-28 15:57:23', 'admin', '2021-09-28 15:57:23', null);
  168. INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (128, 0, '应急队伍', '2', 'zhdd_resource', null, 'default', 'N', '0', 'admin', '2021-09-28 15:57:23', 'admin', '2021-09-28 15:57:23', null);
  169. INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (129, 0, '应急车辆', '3', 'zhdd_resource', null, 'default', 'N', '0', 'admin', '2021-09-28 15:57:23', 'admin', '2021-09-28 15:57:23', null);
  170. INSERT INTO sys_dict_type (dict_id, dict_name, dict_type, status, create_by, create_time, update_by, update_time, remark) VALUES (19, '首页类型筛选', 'zhdd_screen_type', '0', 'admin', '2021-09-28 15:55:09', 'admin', '2021-09-28 15:55:09', null);
  171. INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (130, 0, '预警事件', '预警事件', 'zhdd_screen_type', null, 'default', 'N', '0', 'admin', '2021-09-28 15:57:23', 'admin', '2021-09-28 15:57:23', null);
  172. INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (131, 0, '待派发事件', '待派发事件', 'zhdd_screen_type', null, 'default', 'N', '0', 'admin', '2021-09-28 15:57:23', 'admin', '2021-09-28 15:57:23', null);
  173. INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (132, 0, '待处置事件', '待处置事件', 'zhdd_screen_type', null, 'default', 'N', '0', 'admin', '2021-09-28 15:57:23', 'admin', '2021-09-28 15:57:23', null);
  174. INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (133, 0, '路况信息', '路况信息', 'zhdd_screen_type', null, 'default', 'N', '0', 'admin', '2021-09-28 15:57:23', 'admin', '2021-09-28 15:57:23', null);
  175. INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (134, 0, '视频监控', '视频监控', 'zhdd_screen_type', null, 'default', 'N', '0', 'admin', '2021-09-28 15:57:23', 'admin', '2021-09-28 15:57:23', null);
  176. INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (135, 0, '应急车辆', '应急车辆', 'zhdd_screen_type', null, 'default', 'N', '0', 'admin', '2021-09-28 15:57:23', 'admin', '2021-09-28 15:57:23', null);
  177. INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (136, 0, '应急队伍', '应急队伍', 'zhdd_screen_type', null, 'default', 'N', '0', 'admin', '2021-09-28 15:57:23', 'admin', '2021-09-28 15:57:23', null);
  178. INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark) VALUES (137, 0, '应急仓库', '应急仓库', 'zhdd_screen_type', null, 'default', 'N', '0', 'admin', '2021-09-28 15:57:23', 'admin', '2021-09-28 15:57:23', null);
  179. alter table b_resource
  180. add car_type varchar(20);
  181. comment on column b_resource.car_type is '车辆类型';
  182. alter table b_duty_emp alter column id type varchar(36) using id::varchar(36);
  183. alter table b_duty_report alter column id type varchar(36) using id::varchar(36);
  184. alter table b_incident alter column id type varchar(36) using id::varchar(36);
  185. alter table b_incident_process alter column id type varchar(36) using id::varchar(36);
  186. alter table b_incident_task alter column id type varchar(36) using id::varchar(36);
  187. alter table b_plan alter column id type varchar(36) using id::varchar(36);
  188. alter table b_plan_file alter column id type varchar(36) using id::varchar(36);
  189. alter table b_plan_task alter column id type varchar(36) using id::varchar(36);
  190. alter table b_resource alter column id type varchar(36) using id::varchar(36);
  191. alter table b_resource_detail alter column id type varchar(36) using id::varchar(36);
  192. alter table b_incident_process alter column incident_id type varchar(36) using incident_id::varchar(36);
  193. alter table b_incident_task alter column incident_id type varchar(36) using incident_id::varchar(36);
  194. alter table b_plan_file alter column plan_id type varchar(36) using plan_id::varchar(36);
  195. alter table b_plan_task alter column plan_id type varchar(36) using plan_id::varchar(36);
  196. alter table b_resource_detail alter column resource_id type varchar(36) using resource_id::varchar(36);
  197. alter table b_incident alter column madin_dept type varchar(36) using madin_dept::varchar(36);
  198. INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time) VALUES (138, 0, '皮卡', '皮卡', 'zhdd_car_type', null, 'default', 'N', '0', 'admin', '2021-09-28 15:57:23', 'admin', '2021-09-28 15:57:23');
  199. INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time) VALUES (139, 0, '轿车', '轿车', 'zhdd_car_type', null, 'default', 'N', '0', 'admin', '2021-09-28 15:57:23', 'admin', '2021-09-28 15:57:23');
  200. INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time) VALUES (140, 0, '越野车', '越野车', 'zhdd_car_type', null, 'default', 'N', '0', 'admin', '2021-09-28 15:57:23', 'admin', '2021-09-28 15:57:23');
  201. INSERT INTO sys_dict_type (dict_id, dict_name, dict_type, status, create_by, create_time, update_by, update_time) VALUES (20, '车辆类型', 'zhdd_car_type', '0', 'admin', '2021-09-28 15:55:09', 'admin', '2021-09-28 15:55:09');
  202. create table b_incident_task_person
  203. (
  204. id varchar(36),
  205. incident_task_id varchar(36),
  206. position varchar(20),
  207. person varchar(10),
  208. create_time timestamp(0),
  209. create_by varchar(64)
  210. );
  211. comment on table b_incident_task_person is '事件处置方案人员';
  212. comment on column b_incident_task_person.id is '主键';
  213. comment on column b_incident_task_person.incident_task_id is '事件id';
  214. comment on column b_incident_task_person.position is '人员职位';
  215. comment on column b_incident_task_person.person is '人员姓名';
  216. create table b_incident_task_command
  217. (
  218. id varchar(36),
  219. incident_task_id varchar(36),
  220. command varchar(300),
  221. create_time timestamp(0),
  222. create_by varchar(64)
  223. );
  224. comment on table b_incident_task_command is '事件处置方案指令';
  225. comment on column b_incident_task_command.id is '主键';
  226. comment on column b_incident_task_command.incident_task_id is '事件方案id';
  227. comment on column b_incident_task_command.command is '指令';