SET NAMES utf8mb4;
ALTER TABLE bs_sgc_df_xsjhjl MODIFY COLUMN STATUS int NULL COMMENT '状态';

CREATE TABLE `bs_sgc_df_xslx` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防巡视检查路线查编号',
  `DIKE_CODE` varchar(255) COLLATE utf8mb4_general_ci  COMMENT '堤防代码',
  `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '巡查名称',
  `TYPE` int DEFAULT NULL COMMENT '巡查路线类型',
  `DUTY_HOLDER_TYPE` int DEFAULT NULL COMMENT '巡查责任人类型',
  `XC_ID` int NOT NULL COMMENT '巡查ID',
  `POINTS` text COLLATE utf8mb4_general_ci COMMENT '巡查路线点位',
  `STATUS` int NOT NULL COMMENT '状态',
  `REMARK` text COLLATE utf8mb4_general_ci COMMENT '备注',
  `CREATE_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
  `CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
  `UPDATE_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '最近修改人',
  `UPDATE_TIME` datetime DEFAULT NULL COMMENT '最近修改时间',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='堤防巡视检查路线表';

ALTER TABLE `bs_sgc_df_xsjh` MODIFY COLUMN XC_ID int NULL COMMENT '巡查ID';
ALTER TABLE `bs_sgc_df_xsjh` ADD `DIKE_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '堤防名称';
ALTER TABLE `bs_sgc_df_xsjh` ADD `DIKE_TYPE` int  COMMENT '堤防类型';
ALTER TABLE `bs_sgc_df_xsjh` ADD `STATUS` int NOT NULL COMMENT '状态';
ALTER TABLE `bs_sgc_df_xsjh` ADD `START_DATE` datetime DEFAULT NULL COMMENT '计划开始时间';
ALTER TABLE `bs_sgc_df_xsjh` ADD `END_DATE` datetime DEFAULT NULL COMMENT '计划结束时间';

ALTER TABLE `bs_sgc_df_xsjhzx` ADD `SUB_PLAN_ID` int NOT NULL COMMENT '巡查子计划ID';

ALTER TABLE `bs_sgc_df_xsjhjl` ADD `PLAN_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '计划名称';
ALTER TABLE `bs_sgc_df_xsjhjl` ADD `SUB_PLAN_ID` int  COMMENT '子计划ID';
ALTER TABLE `bs_sgc_df_xsjhjl` ADD `SUB_PLAN_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '子计划名称';
ALTER TABLE `bs_sgc_df_xsjhjl` ADD `LINE_ID` int  COMMENT '巡查路线ID';
ALTER TABLE `bs_sgc_df_xsjhjl` ADD `LINE_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '路线名称';
ALTER TABLE `bs_sgc_df_xsjhjl` ADD `LINE_TYPE` int  COMMENT '路线类型';
ALTER TABLE `bs_sgc_df_xsjhjl` ADD `DUTY_HOLDER_TYPE` int DEFAULT NULL COMMENT '巡查责任人类型';
ALTER TABLE `bs_sgc_df_xsjhjl` ADD `START_DATE` datetime DEFAULT NULL COMMENT '巡查开始时间';
ALTER TABLE `bs_sgc_df_xsjhjl` ADD `END_DATE` datetime DEFAULT NULL COMMENT '巡查结束时间';
ALTER TABLE `bs_sgc_df_xsjhjl` ADD `SUB_PLAN_START_DATE` datetime DEFAULT NULL COMMENT '子计划开始时间';
ALTER TABLE `bs_sgc_df_xsjhjl` ADD `SUB_PLAN_END_DATE` datetime DEFAULT NULL COMMENT '子计划结束时间';
ALTER TABLE `bs_sgc_df_xsjhjl` ADD `SCOPE` varchar(50) COLLATE utf8mb4_general_ci COMMENT '巡查范围';
ALTER TABLE `bs_sgc_df_xsjhjl` ADD `DIKE_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '堤防名称';
ALTER TABLE `bs_sgc_df_xsjhjl` ADD `DIKE_TYPE` int  COMMENT '堤防类型';
ALTER TABLE `bs_sgc_df_xsjhjl` ADD `HANDLE_STATUS` int NOT NULL COMMENT '处置状态';
ALTER TABLE `bs_sgc_df_xsjhjl` ADD `REMAINING` int  COMMENT '剩余巡查项';

ALTER TABLE `bs_sgc_df_xsjhjlz` ADD  `HANDLE_TIME` datetime DEFAULT NULL COMMENT '处置时间';
ALTER TABLE `bs_sgc_df_xsjhjlz` ADD  `HANDLE_IMAGES` text COLLATE utf8mb4_general_ci COMMENT '处置图片';
ALTER TABLE `bs_sgc_df_xsjhjlz` ADD  `HANDLE_CONTENT` varchar(500) COLLATE utf8mb4_general_ci COMMENT '处置描述';


CREATE TABLE `bs_sgc_df_xsjhxq` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防巡查计划内容编号',
  `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '巡查计划内容名称',
  `LINE_ID` int NOT NULL COMMENT '巡查路线ID',
  `PLAN_ID` int NOT NULL COMMENT '巡查计划ID',
  `REMARK` text COLLATE utf8mb4_general_ci COMMENT '备注',
  `START_DATE` datetime DEFAULT NULL COMMENT '计划开始时间',
  `END_DATE` datetime DEFAULT NULL COMMENT '计划结束时间',
  `SCOPE` text COLLATE utf8mb4_general_ci COMMENT '巡查范围',
  `OPERATOR` text COLLATE utf8mb4_general_ci COMMENT '执行人',
  `STATUS` int NOT NULL COMMENT '状态',
  `CREATE_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
  `CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
  `UPDATE_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '最近修改人',
  `UPDATE_TIME` datetime DEFAULT NULL COMMENT '最近修改时间',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='堤防巡查计划内容表';



CREATE TABLE `dws_rel_disc_dike` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '编号',
  `DISC_CODE` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '堤段代码',
  `DISC_NAME` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '堤段名称',
  `DIKE_CODE` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '堤防代码',
  `DIKE_NAME` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '堤防名称',
  `FROM_DATE` datetime DEFAULT NULL COMMENT '关系建立时间',
  `TO_DATE` datetime DEFAULT NULL COMMENT '关系终止时间',
  `REMARK` text COLLATE utf8mb4_general_ci COMMENT '备注',
  `CREATE_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
  `CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
  `UPDATE_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '最近修改人',
  `UPDATE_TIME` datetime DEFAULT NULL COMMENT '最近修改时间',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='堤段所属堤防对象关系表';

ALTER TABLE `MS_DSM_ENV` MODIFY COLUMN MPCD  varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '测点编号';
ALTER TABLE `MS_DSM_GSTMONREC` MODIFY COLUMN MPCD  varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '测点编号';
ALTER TABLE `MS_DSM_OSSMONREC` MODIFY COLUMN MPCD  varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '测点编号';

INSERT INTO sys_dict_type
(id, dict_name, dict_type, status, create_uid, create_time, update_uid, update_time, remark)
VALUES('b9e7401112fd4702b50a41952d55e9e7', '巡查记录隐患处置状态', 'xs_record_dag_status', '0', '1', '2024-06-18 16:10:01', '1', '2024-06-18 16:10:01', NULL);

INSERT INTO sys_dict_data
(id, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_uid, create_time, update_uid, update_time, remark)
VALUES('ced062fe6ec042dabc6c409000113e4f', 0, '已处置', '2', 'xs_record_dag_status', NULL, NULL, 'N', '0', '1', '2024-06-18 16:10:48', '1', '2024-06-18 16:10:48', NULL);
INSERT INTO sys_dict_data
(id, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_uid, create_time, update_uid, update_time, remark)
VALUES('21f6215fbf514f1eba9b80ff2b17f704', 0, '未处置', '1', 'xs_record_dag_status', NULL, NULL, 'N', '0', '1', '2024-06-18 16:10:34', '1', '2024-06-18 16:10:34', NULL);
INSERT INTO sys_dict_data
(id, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_uid, create_time, update_uid, update_time, remark)
VALUES('3fa63a6a55df49f8ad60b18362767d42', 0, '无异常', '0', 'xs_record_dag_status', NULL, NULL, 'N', '0', '1', '2024-06-18 16:10:22', '1', '2024-06-18 16:10:22', NULL);

INSERT INTO sys_dict_data
(id, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_uid, create_time, update_uid, update_time, remark)
VALUES('b7d2bc7fe78244cbaa17dee2d371c0ca', 3, '重大隐患', '3', 'xs_record_problem', NULL, NULL, 'N', '0', '1', '2024-06-28 11:29:42', '1', '2024-06-28 11:30:23', NULL);
INSERT INTO sys_dict_data
(id, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_uid, create_time, update_uid, update_time, remark)
VALUES('28f2718356f9436684f109263c743e61', 2, '较大至重大', '2', 'xs_record_problem', NULL, NULL, 'N', '0', '1', '2024-06-28 11:29:28', '1', '2024-06-28 11:30:30', NULL);

INSERT INTO sys_dict_type
(id, dict_name, dict_type, status, create_uid, create_time, update_uid, update_time, remark)
VALUES('a942be9c53774a4ea3837732110ebe86', '巡检记录巡查项隐患状态', 'xs_record_problem', '0', '1', '2024-06-28 11:27:48', '1', '2024-06-28 11:27:48', NULL);

INSERT INTO sys_dict_data
(id, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_uid, create_time, update_uid, update_time, remark)
VALUES('922661657adb4294adedac3352ca3812', 1, '一般隐患', '1', 'xs_record_problem', NULL, NULL, 'N', '0', '1', '2024-06-28 11:29:17', '1', '2024-06-28 11:30:27', NULL);
INSERT INTO sys_dict_data
(id, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_uid, create_time, update_uid, update_time, remark)
VALUES('ffceadb6f0be4d798c8dd1c13d36595f', 0, '无', '0', 'xs_record_problem', NULL, NULL, 'N', '0', '1', '2024-06-28 11:29:05', '1', '2024-06-28 11:29:05', NULL);