From e17d0856b0e4076503ce3ff1e1096e80d25b8e94 Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 16 Apr 2024 19:44:52 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E5=B7=A1=E6=A3=80/=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1sql=E8=84=9A=E6=9C=AC=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspect/src/main/resources/db/1.0.0.sql | 120 +++++++-------------- .../inspect/src/main/resources/db/2.0.0.sql | 20 ++-- .../safeproduct/src/main/resources/db/1.0.0.sql | 84 +++++---------- 3 files changed, 75 insertions(+), 149 deletions(-) diff --git a/hzims-service/inspect/src/main/resources/db/1.0.0.sql b/hzims-service/inspect/src/main/resources/db/1.0.0.sql index 451c14a..cb8edff 100644 --- a/hzims-service/inspect/src/main/resources/db/1.0.0.sql +++ b/hzims-service/inspect/src/main/resources/db/1.0.0.sql @@ -1,8 +1,7 @@ -- ---------------------------- -- Table structure for blade_module_version -- ---------------------------- -DROP TABLE IF EXISTS `blade_module_version`; -CREATE TABLE `blade_module_version` ( +CREATE TABLE IF NOT EXISTS `blade_module_version` ( `MODULE_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `VERSION` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `HISTORY` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, @@ -12,8 +11,7 @@ CREATE TABLE `blade_module_version` ( -- ---------------------------- -- Table structure for hz_inspect_temp -- ---------------------------- -DROP TABLE IF EXISTS `hz_inspect_temp`; -CREATE TABLE `hz_inspect_temp` ( +CREATE TABLE IF NOT EXISTS `hz_inspect_temp` ( `id` int(11) NOT NULL, `temp_time` datetime NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE @@ -22,8 +20,7 @@ CREATE TABLE `hz_inspect_temp` ( -- ---------------------------- -- Table structure for hz_offline_task -- ---------------------------- -DROP TABLE IF EXISTS `hz_offline_task`; -CREATE TABLE `hz_offline_task` ( +CREATE TABLE IF NOT EXISTS `hz_offline_task` ( `ID` bigint(20) NOT NULL COMMENT '主键', `TASK_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '任务名称', `TASK_STATUS` bigint(1) NULL DEFAULT NULL COMMENT '任务状态 0 - 任务开启 1 - 任务处理 2 - 任务完成 ', @@ -43,8 +40,7 @@ CREATE TABLE `hz_offline_task` ( -- ---------------------------- -- Table structure for hz_st_camera_info -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_camera_info`; -CREATE TABLE `hz_st_camera_info` ( +CREATE TABLE IF NOT EXISTS `hz_st_camera_info` ( `ID` bigint(20) NOT NULL COMMENT '主键ID', `TYPE` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '1' COMMENT '摄像头类型cameraType,1视频摄像头,2机器人摄像头,数据字典', `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '租户ID', @@ -77,8 +73,7 @@ CREATE TABLE `hz_st_camera_info` ( -- ---------------------------- -- Table structure for hz_st_clock -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_clock`; -CREATE TABLE `hz_st_clock` ( +CREATE TABLE IF NOT EXISTS `hz_st_clock` ( `ID` bigint(20) NOT NULL COMMENT '主键ID', `TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租户ID', `CLOCK_TYPE_ID` bigint(20) NULL DEFAULT NULL COMMENT '表针类型ID', @@ -99,8 +94,7 @@ CREATE TABLE `hz_st_clock` ( -- ---------------------------- -- Table structure for hz_st_clock_type -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_clock_type`; -CREATE TABLE `hz_st_clock_type` ( +CREATE TABLE IF NOT EXISTS `hz_st_clock_type` ( `ID` bigint(20) NOT NULL COMMENT '主键ID', `TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租户ID', `CLOCK_NAME` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表盘名称', @@ -123,8 +117,7 @@ CREATE TABLE `hz_st_clock_type` ( -- ---------------------------- -- Table structure for hz_st_event_attachment -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_event_attachment`; -CREATE TABLE `hz_st_event_attachment` ( +CREATE TABLE IF NOT EXISTS `hz_st_event_attachment` ( `ID` bigint(64) NOT NULL, `EVENT_ID` bigint(20) NOT NULL COMMENT '事件ID', `FILE_URL` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文件路径', @@ -142,8 +135,7 @@ CREATE TABLE `hz_st_event_attachment` ( -- ---------------------------- -- Table structure for hz_st_ex_event -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_ex_event`; -CREATE TABLE `hz_st_ex_event` ( +CREATE TABLE IF NOT EXISTS `hz_st_ex_event` ( `ID` bigint(20) NOT NULL COMMENT 'ID', `TASK_ID` bigint(20) NULL DEFAULT NULL COMMENT '任务ID', `OBJECT_ID` bigint(20) NULL DEFAULT NULL COMMENT '对象ID', @@ -175,8 +167,7 @@ CREATE TABLE `hz_st_ex_event` ( -- ---------------------------- -- Table structure for hz_st_ex_event_record -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_ex_event_record`; -CREATE TABLE `hz_st_ex_event_record` ( +CREATE TABLE IF NOT EXISTS `hz_st_ex_event_record` ( `ID` bigint(64) NOT NULL, `EVENT_ID` bigint(20) NOT NULL COMMENT '事件ID', `OBJECT_ID` bigint(20) NOT NULL COMMENT '对象ID', @@ -212,8 +203,7 @@ CREATE TABLE `hz_st_ex_event_record` ( -- ---------------------------- -- Table structure for hz_st_ex_object -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_ex_object`; -CREATE TABLE `hz_st_ex_object` ( +CREATE TABLE IF NOT EXISTS `hz_st_ex_object` ( `ID` bigint(64) NOT NULL, `TASK_ID` bigint(20) NOT NULL COMMENT '任务ID', `OBJECT_ID` bigint(20) NOT NULL COMMENT '对象ID', @@ -238,8 +228,7 @@ CREATE TABLE `hz_st_ex_object` ( -- ---------------------------- -- Table structure for hz_st_ex_object_project -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_ex_object_project`; -CREATE TABLE `hz_st_ex_object_project` ( +CREATE TABLE IF NOT EXISTS `hz_st_ex_object_project` ( `ID` bigint(64) NOT NULL, `TASK_ID` bigint(64) NOT NULL COMMENT '任务ID', `OBJECT_ID` bigint(64) NOT NULL COMMENT '对象ID', @@ -262,8 +251,7 @@ CREATE TABLE `hz_st_ex_object_project` ( -- ---------------------------- -- Table structure for hz_st_ex_object_project_content -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_ex_object_project_content`; -CREATE TABLE `hz_st_ex_object_project_content` ( +CREATE TABLE IF NOT EXISTS `hz_st_ex_object_project_content` ( `ID` bigint(64) NOT NULL, `TASK_ID` bigint(20) NOT NULL COMMENT '任务ID', `OBJECT_ID` bigint(20) NOT NULL COMMENT '对象ID', @@ -299,8 +287,7 @@ CREATE TABLE `hz_st_ex_object_project_content` ( -- ---------------------------- -- Table structure for hz_st_ex_task -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_ex_task`; -CREATE TABLE `hz_st_ex_task` ( +CREATE TABLE IF NOT EXISTS `hz_st_ex_task` ( `ID` bigint(20) NOT NULL COMMENT 'ID', `PLAN_ID` bigint(20) NULL DEFAULT NULL COMMENT '计划ID', `TYPE` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '计划模式 0 人员 1岗位 2机构 3自由模式 4 自由人模式', @@ -339,8 +326,7 @@ CREATE TABLE `hz_st_ex_task` ( -- ---------------------------- -- Table structure for hz_st_ex_task_user -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_ex_task_user`; -CREATE TABLE `hz_st_ex_task_user` ( +CREATE TABLE IF NOT EXISTS `hz_st_ex_task_user` ( `ID` bigint(64) NOT NULL, `TASK_ID` bigint(20) NOT NULL COMMENT '任务ID', `USER_ID` bigint(20) NOT NULL COMMENT '用户ID', @@ -363,8 +349,7 @@ CREATE TABLE `hz_st_ex_task_user` ( -- ---------------------------- -- Table structure for hz_st_hi_task_gather -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_hi_task_gather`; -CREATE TABLE `hz_st_hi_task_gather` ( +CREATE TABLE IF NOT EXISTS `hz_st_hi_task_gather` ( `USER_ID` bigint(20) NULL DEFAULT NULL COMMENT '用户id', `USER_NAME` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户名称', `ROUTE_ID` bigint(20) NULL DEFAULT NULL COMMENT '路径id', @@ -402,8 +387,7 @@ CREATE TABLE `hz_st_hi_task_gather` ( -- ---------------------------- -- Table structure for hz_st_hi_task_result -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_hi_task_result`; -CREATE TABLE `hz_st_hi_task_result` ( +CREATE TABLE IF NOT EXISTS `hz_st_hi_task_result` ( `ID` bigint(20) NOT NULL COMMENT 'ID', `PLAN_ID` bigint(20) NULL DEFAULT NULL COMMENT '计划ID', `BATCH_NUMBER` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '批次号', @@ -422,8 +406,7 @@ CREATE TABLE `hz_st_hi_task_result` ( -- ---------------------------- -- Table structure for hz_st_offline_record -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_offline_record`; -CREATE TABLE `hz_st_offline_record` ( +CREATE TABLE IF NOT EXISTS `hz_st_offline_record` ( `ID` bigint(20) NOT NULL COMMENT '主键ID', `USER_ID` bigint(20) NOT NULL COMMENT '用户ID', `TERMINAL_CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '终端设备标识imei', @@ -441,8 +424,7 @@ CREATE TABLE `hz_st_offline_record` ( -- ---------------------------- -- Table structure for hz_st_re_content -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_re_content`; -CREATE TABLE `hz_st_re_content` ( +CREATE TABLE IF NOT EXISTS `hz_st_re_content` ( `ID` bigint(64) NOT NULL COMMENT 'ID', `CODE` varchar(18) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '内容编码:由系统自动生成自动生成', `NAME` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '内容名称', @@ -482,8 +464,7 @@ CREATE TABLE `hz_st_re_content` ( -- ---------------------------- -- Table structure for hz_st_re_content_definition -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_re_content_definition`; -CREATE TABLE `hz_st_re_content_definition` ( +CREATE TABLE IF NOT EXISTS `hz_st_re_content_definition` ( `ID` bigint(64) NOT NULL COMMENT 'ID', `CODE` varchar(18) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '内容编码:由系统自动生成自动生成', `NAME` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '内容名称', @@ -521,8 +502,7 @@ CREATE TABLE `hz_st_re_content_definition` ( -- ---------------------------- -- Table structure for hz_st_re_object -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_re_object`; -CREATE TABLE `hz_st_re_object` ( +CREATE TABLE IF NOT EXISTS `hz_st_re_object` ( `ID` bigint(20) NOT NULL, `CODE` varchar(18) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '对象编码', `EM_CODE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备编码', @@ -551,8 +531,7 @@ CREATE TABLE `hz_st_re_object` ( -- ---------------------------- -- Table structure for hz_st_re_object_danger -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_re_object_danger`; -CREATE TABLE `hz_st_re_object_danger` ( +CREATE TABLE IF NOT EXISTS `hz_st_re_object_danger` ( `ID` bigint(20) NOT NULL, `OBJECT_ID` bigint(20) NULL DEFAULT NULL COMMENT '巡检对象ID', `DANGER_ID` bigint(20) NULL DEFAULT NULL COMMENT '危险点ID', @@ -572,8 +551,7 @@ CREATE TABLE `hz_st_re_object_danger` ( -- ---------------------------- -- Table structure for hz_st_re_object_template -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_re_object_template`; -CREATE TABLE `hz_st_re_object_template` ( +CREATE TABLE IF NOT EXISTS `hz_st_re_object_template` ( `ID` bigint(64) NOT NULL, `OBJECT_ID` bigint(20) NULL DEFAULT NULL COMMENT '对象ID', `TEMPLATE_ID` bigint(20) NULL DEFAULT NULL COMMENT '模板ID', @@ -590,8 +568,7 @@ CREATE TABLE `hz_st_re_object_template` ( -- ---------------------------- -- Table structure for hz_st_re_object_user -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_re_object_user`; -CREATE TABLE `hz_st_re_object_user` ( +CREATE TABLE IF NOT EXISTS `hz_st_re_object_user` ( `ID` bigint(64) NOT NULL, `OBJECT_ID` bigint(64) NOT NULL COMMENT '对象ID', `USER_ID` bigint(64) NOT NULL COMMENT '用户ID', @@ -610,8 +587,7 @@ CREATE TABLE `hz_st_re_object_user` ( -- ---------------------------- -- Table structure for hz_st_re_plan -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_re_plan`; -CREATE TABLE `hz_st_re_plan` ( +CREATE TABLE IF NOT EXISTS `hz_st_re_plan` ( `ID` bigint(64) NOT NULL COMMENT 'ID', `CODE` varchar(18) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '计划编码', `NAME` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '计划名称', @@ -650,8 +626,7 @@ CREATE TABLE `hz_st_re_plan` ( -- ---------------------------- -- Table structure for hz_st_re_plan_class -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_re_plan_class`; -CREATE TABLE `hz_st_re_plan_class` ( +CREATE TABLE IF NOT EXISTS `hz_st_re_plan_class` ( `ID` bigint(20) NOT NULL, `PLAN_ID` bigint(20) NOT NULL COMMENT '计划ID', `CLASS_ID` bigint(20) NOT NULL COMMENT '班次ID', @@ -669,8 +644,7 @@ CREATE TABLE `hz_st_re_plan_class` ( -- ---------------------------- -- Table structure for hz_st_re_plan_object_template -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_re_plan_object_template`; -CREATE TABLE `hz_st_re_plan_object_template` ( +CREATE TABLE IF NOT EXISTS `hz_st_re_plan_object_template` ( `ID` bigint(20) NOT NULL, `PLAN_ID` bigint(20) NOT NULL COMMENT '计划ID', `OBJECT_ID` bigint(20) NOT NULL COMMENT '对象ID', @@ -689,8 +663,7 @@ CREATE TABLE `hz_st_re_plan_object_template` ( -- ---------------------------- -- Table structure for hz_st_re_plan_org -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_re_plan_org`; -CREATE TABLE `hz_st_re_plan_org` ( +CREATE TABLE IF NOT EXISTS `hz_st_re_plan_org` ( `ID` bigint(64) NOT NULL, `PLAN_ID` bigint(20) NOT NULL COMMENT '计划ID', `ORG_ID` bigint(20) NOT NULL COMMENT '机构ID', @@ -708,8 +681,7 @@ CREATE TABLE `hz_st_re_plan_org` ( -- ---------------------------- -- Table structure for hz_st_re_plan_position -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_re_plan_position`; -CREATE TABLE `hz_st_re_plan_position` ( +CREATE TABLE IF NOT EXISTS `hz_st_re_plan_position` ( `ID` bigint(64) NOT NULL, `PLAN_ID` bigint(64) NOT NULL COMMENT '计划ID', `POSITION_ID` bigint(64) NOT NULL COMMENT '岗位ID', @@ -727,8 +699,7 @@ CREATE TABLE `hz_st_re_plan_position` ( -- ---------------------------- -- Table structure for hz_st_re_plan_user -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_re_plan_user`; -CREATE TABLE `hz_st_re_plan_user` ( +CREATE TABLE IF NOT EXISTS `hz_st_re_plan_user` ( `ID` bigint(20) NOT NULL, `PLAN_ID` bigint(20) NOT NULL COMMENT '计划ID', `USER_ID` bigint(20) NOT NULL COMMENT '用户ID', @@ -746,8 +717,7 @@ CREATE TABLE `hz_st_re_plan_user` ( -- ---------------------------- -- Table structure for hz_st_re_project -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_re_project`; -CREATE TABLE `hz_st_re_project` ( +CREATE TABLE IF NOT EXISTS `hz_st_re_project` ( `ID` bigint(64) NOT NULL COMMENT 'ID', `CODE` varchar(18) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目编码', `NAME` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目名称', @@ -770,8 +740,7 @@ CREATE TABLE `hz_st_re_project` ( -- ---------------------------- -- Table structure for hz_st_re_project_content -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_re_project_content`; -CREATE TABLE `hz_st_re_project_content` ( +CREATE TABLE IF NOT EXISTS `hz_st_re_project_content` ( `ID` bigint(64) NOT NULL AUTO_INCREMENT, `PROJECT_ID` bigint(64) NOT NULL COMMENT '目标ID', `CONTENT_ID` bigint(64) NOT NULL COMMENT '内容ID', @@ -789,8 +758,7 @@ CREATE TABLE `hz_st_re_project_content` ( -- ---------------------------- -- Table structure for hz_st_re_route -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_re_route`; -CREATE TABLE `hz_st_re_route` ( +CREATE TABLE IF NOT EXISTS `hz_st_re_route` ( `ID` bigint(20) NOT NULL, `TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租户ID', `ROUTE_NAME` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '路线名称', @@ -810,8 +778,7 @@ CREATE TABLE `hz_st_re_route` ( -- ---------------------------- -- Table structure for hz_st_re_route_gather -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_re_route_gather`; -CREATE TABLE `hz_st_re_route_gather` ( +CREATE TABLE IF NOT EXISTS `hz_st_re_route_gather` ( `ID` bigint(20) NOT NULL, `TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租户ID', `ROUTE_NAME` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '路线名称', @@ -830,8 +797,7 @@ CREATE TABLE `hz_st_re_route_gather` ( -- ---------------------------- -- Table structure for hz_st_re_template -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_re_template`; -CREATE TABLE `hz_st_re_template` ( +CREATE TABLE IF NOT EXISTS `hz_st_re_template` ( `ID` bigint(64) NOT NULL, `CODE` varchar(18) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模板代码', `NAME` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模板名称', @@ -854,8 +820,7 @@ CREATE TABLE `hz_st_re_template` ( -- ---------------------------- -- Table structure for hz_st_re_template_project -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_re_template_project`; -CREATE TABLE `hz_st_re_template_project` ( +CREATE TABLE IF NOT EXISTS `hz_st_re_template_project` ( `ID` bigint(64) NOT NULL, `TEMPLATE_ID` bigint(20) NOT NULL COMMENT '模板ID', `PROJECT_ID` bigint(20) NOT NULL COMMENT '项目ID', @@ -874,8 +839,7 @@ CREATE TABLE `hz_st_re_template_project` ( -- ---------------------------- -- Table structure for hz_st_robot -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_robot`; -CREATE TABLE `hz_st_robot` ( +CREATE TABLE IF NOT EXISTS `hz_st_robot` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', `TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租户ID', `USER_ID` bigint(20) NULL DEFAULT NULL COMMENT '机器人用户ID', @@ -897,8 +861,7 @@ CREATE TABLE `hz_st_robot` ( -- ---------------------------- -- Table structure for hz_st_robot_task -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_robot_task`; -CREATE TABLE `hz_st_robot_task` ( +CREATE TABLE IF NOT EXISTS `hz_st_robot_task` ( `ID` bigint(20) NOT NULL COMMENT 'ID', `NAME` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '任务名称', `CHECK_TYPE_SON` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '任务类型 : 0图片,1识别,10热成像', @@ -922,8 +885,7 @@ CREATE TABLE `hz_st_robot_task` ( -- ---------------------------- -- Table structure for hz_st_robot_task_identify -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_robot_task_identify`; -CREATE TABLE `hz_st_robot_task_identify` ( +CREATE TABLE IF NOT EXISTS `hz_st_robot_task_identify` ( `ID` bigint(20) NOT NULL COMMENT 'ID', `ROBOT_TASK_ID` bigint(20) NOT NULL COMMENT '机器人任务ID', `IDENTIFY_KEY` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '识别类型:11表针识别,13灯识别,', @@ -943,8 +905,7 @@ CREATE TABLE `hz_st_robot_task_identify` ( -- ---------------------------- -- Table structure for hz_st_task_record -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_task_record`; -CREATE TABLE `hz_st_task_record` ( +CREATE TABLE IF NOT EXISTS `hz_st_task_record` ( `ID` bigint(64) NOT NULL, `TASK_ID` bigint(20) NULL DEFAULT NULL COMMENT '任务ID', `CREATE_TIME` datetime NULL DEFAULT NULL COMMENT '报备时间', @@ -965,8 +926,7 @@ CREATE TABLE `hz_st_task_record` ( -- ---------------------------- -- Table structure for hz_st_user_face_data -- ---------------------------- -DROP TABLE IF EXISTS `hz_st_user_face_data`; -CREATE TABLE `hz_st_user_face_data` ( +CREATE TABLE IF NOT EXISTS `hz_st_user_face_data` ( `ID` bigint(20) NOT NULL COMMENT '主键ID', `TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '租户ID', `USER_ID` bigint(20) NOT NULL COMMENT '用户ID', diff --git a/hzims-service/inspect/src/main/resources/db/2.0.0.sql b/hzims-service/inspect/src/main/resources/db/2.0.0.sql index 1736e4f..97b793e 100644 --- a/hzims-service/inspect/src/main/resources/db/2.0.0.sql +++ b/hzims-service/inspect/src/main/resources/db/2.0.0.sql @@ -9,7 +9,7 @@ alter table `hz_st_ex_task` add column `video_url` varchar(255) default null com alter table `hz_st_ex_task` add column `hik_video_task_id` varchar(50) default null comment '海康录制视频任务ID'; -- 巡检计划模板表 -CREATE TABLE `hz_st_re_plan_template` ( +CREATE TABLE IF NOT EXISTS `hz_st_re_plan_template` ( `ID` bigint(64) NOT NULL COMMENT 'ID', `CODE` varchar(18) DEFAULT NULL COMMENT '计划编码', `NAME` varchar(128) DEFAULT NULL COMMENT '计划名称', @@ -47,7 +47,7 @@ CREATE TABLE `hz_st_re_plan_template` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='巡检计划模板表(专供演示数据使用)'; -- 巡检任务模板表 -CREATE TABLE `hz_st_ex_task_template` ( +CREATE TABLE IF NOT EXISTS `hz_st_ex_task_template` ( `ID` bigint(20) NOT NULL COMMENT 'ID', `PLAN_ID` bigint(20) DEFAULT NULL COMMENT '计划ID', `TYPE` char(1) DEFAULT NULL COMMENT '计划模式 0 人员 1岗位 2机构 3自由模式 4 自由人模式', @@ -83,7 +83,7 @@ CREATE TABLE `hz_st_ex_task_template` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='巡检任务模板表(专供演示数据使用)'; -- 巡检任务对象模板表 -CREATE TABLE `hz_st_ex_object_template` ( +CREATE TABLE IF NOT EXISTS `hz_st_ex_object_template` ( `ID` bigint(64) NOT NULL, `TASK_ID` bigint(20) NOT NULL COMMENT '任务ID', `OBJECT_ID` bigint(20) NOT NULL COMMENT '对象ID', @@ -107,7 +107,7 @@ CREATE TABLE `hz_st_ex_object_template` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='巡检任务对象模板表(专供演示数据使用)'; -- 巡检任务对象项目模板表 -CREATE TABLE `hz_st_ex_object_project_template` ( +CREATE TABLE IF NOT EXISTS `hz_st_ex_object_project_template` ( `ID` bigint(64) NOT NULL, `TASK_ID` bigint(64) NOT NULL COMMENT '任务ID', `OBJECT_ID` bigint(64) NOT NULL COMMENT '对象ID', @@ -128,7 +128,7 @@ CREATE TABLE `hz_st_ex_object_project_template` ( KEY `idx_task_id` (`TASK_ID`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='巡检任务对象项目模板表(专供演示数据使用)'; -CREATE TABLE `hz_st_ex_object_project_content_template` ( +CREATE TABLE IF NOT EXISTS `hz_st_ex_object_project_content_template` ( `ID` bigint(64) NOT NULL, `TASK_ID` bigint(20) NOT NULL COMMENT '任务ID', `OBJECT_ID` bigint(20) NOT NULL COMMENT '对象ID', @@ -161,7 +161,7 @@ CREATE TABLE `hz_st_ex_object_project_content_template` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='巡检任务对象项目内容模板表(专供演示数据使用)'; -- 巡检情况列模板表 -CREATE TABLE `hz_st_ex_event_template` ( +CREATE TABLE IF NOT EXISTS `hz_st_ex_event_template` ( `ID` bigint(20) NOT NULL COMMENT 'ID', `TASK_ID` bigint(20) DEFAULT NULL COMMENT '任务ID', `OBJECT_ID` bigint(20) DEFAULT NULL COMMENT '对象ID', @@ -192,7 +192,7 @@ CREATE TABLE `hz_st_ex_event_template` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='巡检情况列模板表(专供演示数据使用)'; -- 巡检情况记录模板表 -CREATE TABLE `hz_st_ex_event_record_template` ( +CREATE TABLE IF NOT EXISTS `hz_st_ex_event_record_template` ( `ID` bigint(64) NOT NULL, `EVENT_ID` bigint(20) NOT NULL COMMENT '事件ID', `OBJECT_ID` bigint(20) NOT NULL COMMENT '对象ID', @@ -230,13 +230,7 @@ ALTER TABLE `hz_st_ex_task_user` MODIFY COLUMN `CLAIM_STATUS` char(1) CHARACTER ALTER TABLE `hz_st_ex_task_user` ADD COLUMN `user_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `TENANT_ID`; -alter table `hz_st_ex_task` add column `hik_video_task_id` varchar(50) default null comment '海康录制视频任务ID'; -alter table `hz_st_ex_task` add column `video_start_time` datetime default null comment '视频录制开始时间'; -alter table `hz_st_ex_task` add column `video_end_time` datetime default null comment '视频录制开始时间'; -alter table `hz_st_ex_task` add column `video_url` varchar(255) default null comment '手动录制视频地址'; -- 巡检摄像头管理添加设备编号 -alter table `hz_st_camera_info` add column `em_code` varchar(50) default null comment '设备编号'; -alter table `hz_st_robot` add column `code` varchar(50) default null comment '机器人编号'; alter table `hz_st_robot` add column `station_code` varchar(50) default null comment '站点编号'; alter table `hz_st_robot` add column `is_device_instance` tinyint(2) default 0 comment '是否绑定设备实例'; alter table `hz_st_re_object` change COLUMN `EM_CODE` `EM_CODE` VARCHAR(50) COMMENT '设备编号'; \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/resources/db/1.0.0.sql b/hzims-service/safeproduct/src/main/resources/db/1.0.0.sql index c571cf6..ce9d309 100644 --- a/hzims-service/safeproduct/src/main/resources/db/1.0.0.sql +++ b/hzims-service/safeproduct/src/main/resources/db/1.0.0.sql @@ -1,8 +1,7 @@ -- ---------------------------- -- TABLE STRUCTURE FOR BLADE_MODULE_VERSION -- ---------------------------- -DROP TABLE IF EXISTS `BLADE_MODULE_VERSION`; -CREATE TABLE `BLADE_MODULE_VERSION` ( +CREATE TABLE IF NOT EXISTS `BLADE_MODULE_VERSION` ( `MODULE_NAME` VARCHAR(64) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL, `VERSION` VARCHAR(8) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL, `HISTORY` VARCHAR(300) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL, @@ -12,8 +11,7 @@ CREATE TABLE `BLADE_MODULE_VERSION` ( -- ---------------------------- -- TABLE STRUCTURE FOR DOCUMENT_MANAGEMENT -- ---------------------------- -DROP TABLE IF EXISTS `DOCUMENT_MANAGEMENT`; -CREATE TABLE `DOCUMENT_MANAGEMENT` ( +CREATE TABLE IF NOT EXISTS `DOCUMENT_MANAGEMENT` ( `ID` BIGINT(20) NOT NULL AUTO_INCREMENT, `DOCUMENT_NAME` VARCHAR(100) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '文档名称', `DOCUMENT_URL` VARCHAR(300) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '文档路径', @@ -28,8 +26,7 @@ CREATE TABLE `DOCUMENT_MANAGEMENT` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZ_IMS_MON_ALARM_INFO -- ---------------------------- -DROP TABLE IF EXISTS `HZ_IMS_MON_ALARM_INFO`; -CREATE TABLE `HZ_IMS_MON_ALARM_INFO` ( +CREATE TABLE IF NOT EXISTS `HZ_IMS_MON_ALARM_INFO` ( `ID` BIGINT(20) NOT NULL COMMENT '主键ID', `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', `CAMERA_ID` BIGINT(20) NULL DEFAULT NULL COMMENT '告警摄像头ID', @@ -54,8 +51,7 @@ CREATE TABLE `HZ_IMS_MON_ALARM_INFO` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZ_IMS_MON_CAMERA_INFO -- ---------------------------- -DROP TABLE IF EXISTS `HZ_IMS_MON_CAMERA_INFO`; -CREATE TABLE `HZ_IMS_MON_CAMERA_INFO` ( +CREATE TABLE IF NOT EXISTS `HZ_IMS_MON_CAMERA_INFO` ( `ID` BIGINT(20) NOT NULL COMMENT '主键ID', `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', `NAME` VARCHAR(127) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '摄像头名称', @@ -87,8 +83,7 @@ CREATE TABLE `HZ_IMS_MON_CAMERA_INFO` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_ACCIDENT -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_ACCIDENT`; -CREATE TABLE `HZIMS_ACCIDENT` ( +CREATE TABLE IF NOT EXISTS `HZIMS_ACCIDENT` ( `ID` BIGINT(20) NOT NULL COMMENT '主键ID', `NAME` VARCHAR(255) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '事故名称', `TYPE` TINYINT(4) NULL DEFAULT NULL COMMENT '事故分类(事件、一般事故、重大及以上事故))', @@ -117,8 +112,7 @@ CREATE TABLE `HZIMS_ACCIDENT` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_REVIEW -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_REVIEW`; -CREATE TABLE `HZIMS_REVIEW` ( +CREATE TABLE IF NOT EXISTS `HZIMS_REVIEW` ( `ID` BIGINT(20) NOT NULL COMMENT '主键ID', `STATION_CODE` VARCHAR(100) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '站点ID', `SCORE` DOUBLE(6, 2) NULL DEFAULT NULL COMMENT '分数', @@ -142,8 +136,7 @@ CREATE TABLE `HZIMS_REVIEW` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_REVIEW_STANDARD -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_REVIEW_STANDARD`; -CREATE TABLE `HZIMS_REVIEW_STANDARD` ( +CREATE TABLE IF NOT EXISTS `HZIMS_REVIEW_STANDARD` ( `ID` BIGINT(20) NOT NULL COMMENT '主键ID', `REVIEW_ID` BIGINT(20) NOT NULL COMMENT '评审ID', `STANDARD_ID` TINYINT(4) NOT NULL COMMENT '标准ID', @@ -163,8 +156,7 @@ CREATE TABLE `HZIMS_REVIEW_STANDARD` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_SAFE_CHECK_COMPANY -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_SAFE_CHECK_COMPANY`; -CREATE TABLE `HZIMS_SAFE_CHECK_COMPANY` ( +CREATE TABLE IF NOT EXISTS `HZIMS_SAFE_CHECK_COMPANY` ( `ID` BIGINT(20) NOT NULL, `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', `START_TIME` DATETIME NULL DEFAULT NULL COMMENT '开始时间', @@ -184,8 +176,7 @@ CREATE TABLE `HZIMS_SAFE_CHECK_COMPANY` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_SAFE_CHECK_ITEM -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_SAFE_CHECK_ITEM`; -CREATE TABLE `HZIMS_SAFE_CHECK_ITEM` ( +CREATE TABLE IF NOT EXISTS `HZIMS_SAFE_CHECK_ITEM` ( `ID` BIGINT(20) NOT NULL, `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', `PARENT_ITEM` BIGINT(20) NULL DEFAULT NULL COMMENT '父级检查项', @@ -206,8 +197,7 @@ CREATE TABLE `HZIMS_SAFE_CHECK_ITEM` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_SAFE_CHECK_ITEM_INSTANCE -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_SAFE_CHECK_ITEM_INSTANCE`; -CREATE TABLE `HZIMS_SAFE_CHECK_ITEM_INSTANCE` ( +CREATE TABLE IF NOT EXISTS `HZIMS_SAFE_CHECK_ITEM_INSTANCE` ( `ID` BIGINT(20) NOT NULL, `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', `OID` BIGINT(20) NULL DEFAULT NULL COMMENT '原始ID,用于维持父子结构', @@ -234,8 +224,7 @@ CREATE TABLE `HZIMS_SAFE_CHECK_ITEM_INSTANCE` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_SAFE_CHECK_MONTH -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_SAFE_CHECK_MONTH`; -CREATE TABLE `HZIMS_SAFE_CHECK_MONTH` ( +CREATE TABLE IF NOT EXISTS `HZIMS_SAFE_CHECK_MONTH` ( `ID` BIGINT(20) NOT NULL, `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', `MONTH` VARCHAR(255) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '自查月份', @@ -254,8 +243,7 @@ CREATE TABLE `HZIMS_SAFE_CHECK_MONTH` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_SAFE_CHECK_NOTICE -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_SAFE_CHECK_NOTICE`; -CREATE TABLE `HZIMS_SAFE_CHECK_NOTICE` ( +CREATE TABLE IF NOT EXISTS `HZIMS_SAFE_CHECK_NOTICE` ( `ID` BIGINT(20) NOT NULL, `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', `YEAR` INT(11) NULL DEFAULT NULL COMMENT '年度', @@ -278,8 +266,7 @@ CREATE TABLE `HZIMS_SAFE_CHECK_NOTICE` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_SAFE_CHECK_QUARTER -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_SAFE_CHECK_QUARTER`; -CREATE TABLE `HZIMS_SAFE_CHECK_QUARTER` ( +CREATE TABLE IF NOT EXISTS `HZIMS_SAFE_CHECK_QUARTER` ( `ID` BIGINT(20) NOT NULL, `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', `YEAR` INT(11) NULL DEFAULT NULL COMMENT '年度', @@ -299,8 +286,7 @@ CREATE TABLE `HZIMS_SAFE_CHECK_QUARTER` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_SAFE_DANGER_SOURCE -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_SAFE_DANGER_SOURCE`; -CREATE TABLE `HZIMS_SAFE_DANGER_SOURCE` ( +CREATE TABLE IF NOT EXISTS `HZIMS_SAFE_DANGER_SOURCE` ( `ID` BIGINT(20) NOT NULL, `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', `TYPE` TINYINT(4) NOT NULL COMMENT '危险源类型 1=作业活动 2=设备', @@ -324,8 +310,7 @@ CREATE TABLE `HZIMS_SAFE_DANGER_SOURCE` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_SAFE_DANGER_SOURCE_LEVEL_RECORD -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_SAFE_DANGER_SOURCE_LEVEL_RECORD`; -CREATE TABLE `HZIMS_SAFE_DANGER_SOURCE_LEVEL_RECORD` ( +CREATE TABLE IF NOT EXISTS `HZIMS_SAFE_DANGER_SOURCE_LEVEL_RECORD` ( `SOURCE_ID` BIGINT(20) NOT NULL COMMENT '危险源ID', `ORGI_LEVEL` TINYINT(4) NOT NULL COMMENT '原等级', `NEW_LEVEL` TINYINT(4) NOT NULL COMMENT '新等级', @@ -342,8 +327,7 @@ CREATE TABLE `HZIMS_SAFE_DANGER_SOURCE_LEVEL_RECORD` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_SAFE_DANGER_SOURCE_POSITION -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_SAFE_DANGER_SOURCE_POSITION`; -CREATE TABLE `HZIMS_SAFE_DANGER_SOURCE_POSITION` ( +CREATE TABLE IF NOT EXISTS `HZIMS_SAFE_DANGER_SOURCE_POSITION` ( `SOURCE_ID` BIGINT(20) NOT NULL COMMENT '危险源ID', `PADDING_TOP` DOUBLE(11, 2) NULL DEFAULT NULL COMMENT '平面图顶部距离', `PADDING_LEFT` DOUBLE(11, 2) NULL DEFAULT NULL COMMENT '平面图左边距', @@ -355,8 +339,7 @@ CREATE TABLE `HZIMS_SAFE_DANGER_SOURCE_POSITION` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_SAFE_EMERGENCY_PLAN -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_SAFE_EMERGENCY_PLAN`; -CREATE TABLE `HZIMS_SAFE_EMERGENCY_PLAN` ( +CREATE TABLE IF NOT EXISTS `HZIMS_SAFE_EMERGENCY_PLAN` ( `ID` BIGINT(20) NOT NULL, `TYPE_ID` BIGINT(20) NOT NULL COMMENT '应急预案类型ID', `FILE_PATH` VARCHAR(255) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '文件路径', @@ -378,8 +361,7 @@ CREATE TABLE `HZIMS_SAFE_EMERGENCY_PLAN` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_SAFE_EMERGENCY_PLAN_TYPE -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_SAFE_EMERGENCY_PLAN_TYPE`; -CREATE TABLE `HZIMS_SAFE_EMERGENCY_PLAN_TYPE` ( +CREATE TABLE IF NOT EXISTS `HZIMS_SAFE_EMERGENCY_PLAN_TYPE` ( `ID` BIGINT(20) NOT NULL, `NAME` VARCHAR(60) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '类型名称', `PARENT_ID` BIGINT(20) NOT NULL DEFAULT -1 COMMENT '父类型ID', @@ -398,8 +380,7 @@ CREATE TABLE `HZIMS_SAFE_EMERGENCY_PLAN_TYPE` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_SAFE_EQUIPMENT_TRIAL -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_SAFE_EQUIPMENT_TRIAL`; -CREATE TABLE `HZIMS_SAFE_EQUIPMENT_TRIAL` ( +CREATE TABLE IF NOT EXISTS `HZIMS_SAFE_EQUIPMENT_TRIAL` ( `ID` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', `FILE_PATH` VARCHAR(255) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '文件路径', `FILE_NAME` VARCHAR(200) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '文件名称', @@ -417,8 +398,7 @@ CREATE TABLE `HZIMS_SAFE_EQUIPMENT_TRIAL` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_SAFE_SAFETY_TOOL -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_SAFE_SAFETY_TOOL`; -CREATE TABLE `HZIMS_SAFE_SAFETY_TOOL` ( +CREATE TABLE IF NOT EXISTS `HZIMS_SAFE_SAFETY_TOOL` ( `ID` BIGINT(20) NOT NULL AUTO_INCREMENT, `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', `TYPE_ID` BIGINT(20) NOT NULL, @@ -446,8 +426,7 @@ CREATE TABLE `HZIMS_SAFE_SAFETY_TOOL` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_SAFE_SAFETY_TOOL_RECHECK -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_SAFE_SAFETY_TOOL_RECHECK`; -CREATE TABLE `HZIMS_SAFE_SAFETY_TOOL_RECHECK` ( +CREATE TABLE IF NOT EXISTS `HZIMS_SAFE_SAFETY_TOOL_RECHECK` ( `TOOL_ID` BIGINT(20) NOT NULL COMMENT '工器具ID', `CHECK_USER_ID` BIGINT(20) NOT NULL COMMENT '复核人ID', `CHECK_USER_NAME` VARCHAR(60) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '复核人名称', @@ -460,8 +439,7 @@ CREATE TABLE `HZIMS_SAFE_SAFETY_TOOL_RECHECK` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_SAFE_SAFETY_TOOL_TYPE -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_SAFE_SAFETY_TOOL_TYPE`; -CREATE TABLE `HZIMS_SAFE_SAFETY_TOOL_TYPE` ( +CREATE TABLE IF NOT EXISTS `HZIMS_SAFE_SAFETY_TOOL_TYPE` ( `ID` BIGINT(20) NOT NULL AUTO_INCREMENT, `TENANT_ID` BIGINT(12) NOT NULL, `TYPE_NAME` VARCHAR(60) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '类型名称', @@ -481,8 +459,7 @@ CREATE TABLE `HZIMS_SAFE_SAFETY_TOOL_TYPE` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_SAFE_SAFETY_TOOL_TYPE_USER -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_SAFE_SAFETY_TOOL_TYPE_USER`; -CREATE TABLE `HZIMS_SAFE_SAFETY_TOOL_TYPE_USER` ( +CREATE TABLE IF NOT EXISTS `HZIMS_SAFE_SAFETY_TOOL_TYPE_USER` ( `TYPE_ID` BIGINT(20) NOT NULL COMMENT '安全工器具类型ID', `USER_ID` BIGINT(20) NOT NULL COMMENT '账户ID', INDEX `IDX_TYPE_ID`(`TYPE_ID`) USING BTREE, @@ -492,8 +469,7 @@ CREATE TABLE `HZIMS_SAFE_SAFETY_TOOL_TYPE_USER` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_SAFE_SYSTEM_FILE -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_SAFE_SYSTEM_FILE`; -CREATE TABLE `HZIMS_SAFE_SYSTEM_FILE` ( +CREATE TABLE IF NOT EXISTS `HZIMS_SAFE_SYSTEM_FILE` ( `ID` BIGINT(20) NOT NULL AUTO_INCREMENT, `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '租户ID', `FILE_TYPE_ID` BIGINT(20) NOT NULL COMMENT '文件类型ID', @@ -516,8 +492,7 @@ CREATE TABLE `HZIMS_SAFE_SYSTEM_FILE` ( -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_SAFE_SYSTEM_FILE_TYPE -- ---------------------------- -DROP TABLE IF EXISTS `HZIMS_SAFE_SYSTEM_FILE_TYPE`; -CREATE TABLE `HZIMS_SAFE_SYSTEM_FILE_TYPE` ( +CREATE TABLE IF NOT EXISTS `HZIMS_SAFE_SYSTEM_FILE_TYPE` ( `ID` BIGINT(20) NOT NULL DEFAULT -1, `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '租户ID', `NAME` VARCHAR(60) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '文件类型名称', @@ -536,8 +511,7 @@ CREATE TABLE `HZIMS_SAFE_SYSTEM_FILE_TYPE` ( -- ---------------------------- -- TABLE STRUCTURE FOR INDICATOR_MANAGEMENT -- ---------------------------- -DROP TABLE IF EXISTS `INDICATOR_MANAGEMENT`; -CREATE TABLE `INDICATOR_MANAGEMENT` ( +CREATE TABLE IF NOT EXISTS `INDICATOR_MANAGEMENT` ( `ID` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '编号', `PRODUCT_NAME` VARCHAR(5000) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '项目名称', `STANDARD_SCORE` VARCHAR(50) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '标准分值', @@ -552,8 +526,7 @@ CREATE TABLE `INDICATOR_MANAGEMENT` ( -- ---------------------------- -- TABLE STRUCTURE FOR RATING_SCALE -- ---------------------------- -DROP TABLE IF EXISTS `RATING_SCALE`; -CREATE TABLE `RATING_SCALE` ( +CREATE TABLE IF NOT EXISTS `RATING_SCALE` ( `ID` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '编号', `INDICATOR_MANAGEMENT_ID` BIGINT(20) NULL DEFAULT NULL COMMENT '指标项管理ID', `GOAL` VARCHAR(50) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '得分', @@ -567,8 +540,7 @@ CREATE TABLE `RATING_SCALE` ( -- ---------------------------- -- TABLE STRUCTURE FOR TARGET_MANAGEMENT -- ---------------------------- -DROP TABLE IF EXISTS `TARGET_MANAGEMENT`; -CREATE TABLE `TARGET_MANAGEMENT` ( +CREATE TABLE IF NOT EXISTS `TARGET_MANAGEMENT` ( `ID` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '编号', `NAME` VARCHAR(50) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NOT NULL COMMENT '名称', `SCORE` VARCHAR(50) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '分值',