SET NAMES utf8mb4;

ALTER TABLE `bs_sgc_df_yhjh` ADD `DIKE_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '堤防名称';
ALTER TABLE `bs_sgc_df_yhjh` ADD `DIKE_TYPE` int  COMMENT '堤防类型';
ALTER TABLE `bs_sgc_df_yhjh` ADD `TYPE` int DEFAULT NULL COMMENT '维修养护类型';
ALTER TABLE `bs_sgc_df_yhjh` ADD `START_DATE` datetime DEFAULT NULL COMMENT '计划开始时间';
ALTER TABLE `bs_sgc_df_yhjh` ADD `END_DATE` datetime DEFAULT NULL COMMENT '计划结束时间';
ALTER TABLE `bs_sgc_df_yhjh` ADD `SUPPLEMENT` varchar(500) DEFAULT NULL COMMENT '资金';
ALTER TABLE `bs_sgc_df_yhjh` ADD `DOC` text COLLATE utf8mb4_general_ci COMMENT '文档';
ALTER TABLE `bs_sgc_df_yhjh` ADD `ENGINEERING_UNIT` varchar(100) COLLATE utf8mb4_general_ci COMMENT '工程单位';
ALTER TABLE `bs_sgc_df_yhjh` ADD `RESPONSIBLE_PERSON` varchar(100) COLLATE utf8mb4_general_ci COMMENT '负责人';
ALTER TABLE `bs_sgc_df_yhjh` ADD `REMINDER_TIME` datetime DEFAULT NULL COMMENT '提醒时间';
ALTER TABLE `bs_sgc_df_yhjh` ADD `STATUS` int NOT NULL COMMENT '状态';


ALTER TABLE `bs_sgc_df_yhjl` ADD  `DIKE_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '堤防名称';
ALTER TABLE `bs_sgc_df_yhjl` ADD  `DIKE_TYPE` int  COMMENT '堤防类型';
ALTER TABLE `bs_sgc_df_yhjl` ADD  `SUPPLEMENT` varchar(500) DEFAULT NULL COMMENT '资金';
ALTER TABLE `bs_sgc_df_yhjl` ADD  `LEDGER_DOC` text COLLATE utf8mb4_general_ci COMMENT '维养台账';
ALTER TABLE `bs_sgc_df_yhjl` ADD  `PLAN_NAME` varchar(100) COLLATE utf8mb4_general_ci COMMENT '计划名称';

CREATE TABLE `bs_sgc_sp_task` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '审批编号ID',
  `FORM_ID` int NOT NULL COMMENT '表单ID',
  `BUSINESS_TYPE` VARCHAR(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '业务类型',
  `STATUS` int NOT NULL COMMENT '状态',
  `OPERATOR` VARCHAR(32) COLLATE utf8mb4_general_ci  COMMENT '审批人',
  `COMMENT` text COLLATE utf8mb4_general_ci COMMENT '审批意见',
  `DOC` text COLLATE utf8mb4_general_ci COMMENT '审批文档',
  `APPROVAL_TIME` datetime DEFAULT 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  `bs_sgc_sp_operator` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '审批执行人员编号',
  `UID` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户ID',
  `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户名称',
  `TASK_ID` int NOT NULL COMMENT '审批任务ID',
  `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 `bs_sgc_sp_objrole` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '审批对象角色编号',
  `ROLE_ID` int NOT NULL COMMENT '角色ID',
  `OBJ_TYPE` varchar(50) 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 `bs_sgc_sp_objrole` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '审批对象角色编号',
  `ROLE_ID` varchar(50) NOT NULL COMMENT '角色ID',
  `OBJ_TYPE` varchar(50) 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='审批对象角色表';

ALTER TABLE `bs_sgc_sz_yhjh` ADD `WAGA_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '水闸名称';
ALTER TABLE `bs_sgc_sz_yhjh` ADD `WAGA_TYPE` int  COMMENT '水闸类型';
ALTER TABLE `bs_sgc_sz_yhjh` ADD `TYPE` int DEFAULT NULL COMMENT '维修养护类型';
ALTER TABLE `bs_sgc_sz_yhjh` ADD `START_DATE` datetime DEFAULT NULL COMMENT '计划开始时间';
ALTER TABLE `bs_sgc_sz_yhjh` ADD `END_DATE` datetime DEFAULT NULL COMMENT '计划结束时间';
ALTER TABLE `bs_sgc_sz_yhjh` ADD `SUPPLEMENT` varchar(500) DEFAULT NULL COMMENT '资金';
ALTER TABLE `bs_sgc_sz_yhjh` ADD `DOC` text COLLATE utf8mb4_general_ci COMMENT '文档';
ALTER TABLE `bs_sgc_sz_yhjh` ADD `ENGINEERING_UNIT` varchar(100) COLLATE utf8mb4_general_ci COMMENT '工程单位';
ALTER TABLE `bs_sgc_sz_yhjh` ADD `RESPONSIBLE_PERSON` varchar(100) COLLATE utf8mb4_general_ci COMMENT '负责人';
ALTER TABLE `bs_sgc_sz_yhjh` ADD `REMINDER_TIME` datetime DEFAULT NULL COMMENT '提醒时间';
ALTER TABLE `bs_sgc_sz_yhjh` ADD `STATUS` int NOT NULL COMMENT '状态';


ALTER TABLE `bs_sgc_sz_yhjl` ADD  `WAGA_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '水闸名称';
ALTER TABLE `bs_sgc_sz_yhjl` ADD  `WAGA_TYPE` int  COMMENT '水闸类型';
ALTER TABLE `bs_sgc_sz_yhjl` ADD  `SUPPLEMENT` varchar(500) DEFAULT NULL COMMENT '资金';
ALTER TABLE `bs_sgc_sz_yhjl` ADD  `LEDGER_DOC` text COLLATE utf8mb4_general_ci COMMENT '维养台账';
ALTER TABLE `bs_sgc_sz_yhjl` ADD  `PLAN_NAME` varchar(100) COLLATE utf8mb4_general_ci COMMENT '计划名称';


-------------------------------------------------

ALTER TABLE bs_sgc_sz_xsjhjl MODIFY COLUMN STATUS int NULL COMMENT '状态';

CREATE TABLE `bs_sgc_sz_xslx` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸巡视检查路线查编号',
  `WAGA_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(16) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
  `CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
  `UPDATE_UID` varchar(16) 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_sz_xsjh` MODIFY COLUMN XC_ID int NULL COMMENT '巡查ID';
ALTER TABLE `bs_sgc_sz_xsjh` ADD `WAGA_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '水闸名称';
ALTER TABLE `bs_sgc_sz_xsjh` ADD `WAGA_TYPE` int  COMMENT '水闸类型';
ALTER TABLE `bs_sgc_sz_xsjh` ADD `STATUS` int NOT NULL COMMENT '状态';
ALTER TABLE `bs_sgc_sz_xsjh` ADD `START_DATE` datetime DEFAULT NULL COMMENT '计划开始时间';
ALTER TABLE `bs_sgc_sz_xsjh` ADD `END_DATE` datetime DEFAULT NULL COMMENT '计划结束时间';

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

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


CREATE TABLE `bs_sgc_sz_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 `bs_sgc_job_task`(
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '任务ID',
    `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '任务名称',
    `TYPE` int NOT NULL COMMENT '任务类型',
    `STATUS` int NOT NULL COMMENT '任务状态',
    `START_DATE` datetime DEFAULT NULL COMMENT '开始时间',
    `END_DATE` datetime DEFAULT NULL COMMENT '结束时间',
    `REMINDER_TIME` datetime DEFAULT 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='任务表';


delete from sys_menu where id in (
'2af1e46844a04dc1898f7bf27afd09bd','88a90a6452fb4af7b070b37b83fb73a4','dce5c717ecaf475ea71ca2d095232ec7',
'385993aea2c44283a21f09772b909bc3','e6d27d32dfbe4201ac7ea1036d05494e','025ea8a420a64bc399d6547d74542b24','e92cae0b06d242c4aa5bfc41d7c3c26c',
'f512341df2a8454e830fd2635e34b1bb','c85c1d9751174b4ba7b9284d0751dcd7','c825178955e4420a94238005a54ac084','364f425d93344ffa890c5ec185c28c49'
)

update sys_menu set visible = '0' and menu_name = '维养计划' where id = '3f7cf2a425984fc391100536d472517c';
update sys_menu set visible = '0' and menu_name = '维养计划' where id = '038691476a374368ac1934371a22ed2d';
update sys_menu set visible = '0' and menu_name = '维养记录' where id = '29a31582ce3147449b6c0d6718f00d38';
update sys_menu set visible = '0' and menu_name = '维养记录' where id = 'f3e4f97a9aa8493892e8fbb3eeaa0efe';


INSERT INTO sys_dict_type
(id, dict_name, dict_type, status, create_uid, create_time, update_uid, update_time, remark)
VALUES('6469ce355ca24e42be4504ccaafb8cf7', '审核状态', 'xs_sh_status', '0', '1', '2024-07-09 15:26:20', '1', '2024-07-09 15:26:20', NULL);
INSERT INTO sys_dict_type
(id, dict_name, dict_type, status, create_uid, create_time, update_uid, update_time, remark)
VALUES('55aa2fa0a71248a78f222a0733bc59f1', '维修养护资金类型', 'xs_yh_supplement', '0', '1', '2024-07-09 15:25:29', '1', '2024-07-09 15:25:29', NULL);
INSERT INTO sys_dict_type
(id, dict_name, dict_type, status, create_uid, create_time, update_uid, update_time, remark)
VALUES('8ef89375f81a4d32a5a5beb5c05e6cde', '维修养护类型', 'xs_yh_type', '0', '1', '2024-07-09 15:24:26', '1', '2024-07-09 15:24:26', 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('f1f5265144fc4c30b74e8349d9bbad9a', 4, '已回退', '4', 'xs_sh_status', NULL, NULL, 'N', '0', '1', '2024-07-12 14:54:25', '1', '2024-07-12 14:54:25', 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('3fed7bb5ed054570a34fdf18f0dc1f2b', 0, '已驳回', '3', 'xs_sh_status', NULL, NULL, 'N', '0', '1', '2024-07-09 15:27:02', '1', '2024-07-09 15:27:02', 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('f2a3ce80189842afaf379ab55fc7f0c3', 0, '已通过', '2', 'xs_sh_status', NULL, NULL, 'N', '0', '1', '2024-07-09 15:26:53', '1', '2024-07-09 15:26:53', 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('8e05f89498454f71b833289f6f1340d7', 0, '审批中', '1', 'xs_sh_status', NULL, NULL, 'N', '0', '1', '2024-07-09 15:26:43', '1', '2024-07-09 15:26:43', 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('5a38df63fd234b4f895ea7611d8d6b52', 0, '待提交', '0', 'xs_sh_status', NULL, NULL, 'N', '0', '1', '2024-07-09 15:26:32', '1', '2024-07-09 15:26:32', 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('7897f8a957074e7d94bd83691ae2caef', 0, '其他', '2', 'xs_yh_supplement', NULL, NULL, 'N', '0', '1', '2024-07-09 15:26:00', '1', '2024-07-09 15:26:00', 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('ca0c62c7f11c492398c39bf0216da0ea', 0, '自筹资金', '1', 'xs_yh_supplement', NULL, NULL, 'N', '0', '1', '2024-07-09 15:25:50', '1', '2024-07-09 15:25:50', 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('b727f0e9425140e29c3e7473d2f57c3e', 0, '国补资金', '0', 'xs_yh_supplement', NULL, NULL, 'N', '0', '1', '2024-07-09 15:25:40', '1', '2024-07-09 15:25:40', 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('63de4dd595bd4a1aa055ff124c159ed2', 0, '大修', '2', 'xs_yh_type', NULL, NULL, 'N', '0', '1', '2024-07-09 15:25:06', '1', '2024-07-09 15:25:06', 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('e74bec3f7ec84218bd28944b7df69313', 0, '岁修', '1', 'xs_yh_type', NULL, NULL, 'N', '0', '1', '2024-07-09 15:24:54', '1', '2024-07-09 15:24:54', 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('c7f23f61975340c5ab92dd2e2e93acbb', 0, '日常维修', '0', 'xs_yh_type', NULL, NULL, 'N', '0', '1', '2024-07-09 15:24:42', '1', '2024-07-09 15:24:42', NULL);


