SET NAMES utf8mb4;
CREATE TABLE `bs_sgc_df_xs` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防巡视检查编号',
  `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '巡查名称',
  `TYPE` int DEFAULT 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='堤防巡视检查表';

CREATE TABLE `bs_sgc_df_xspj` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防巡视检查与堤防绑定编号',
  `XC_ID` int NOT NULL COMMENT '巡查ID',
  `TYPE` int DEFAULT NULL COMMENT '巡查类型',
  `DIKE_CODE` varchar(18) COLLATE utf8mb4_general_ci 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_df_xsx` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防巡查内容编号',
  `XC_ID` int NOT NULL COMMENT '巡查ID',
  `PARTS` varchar(100) COLLATE utf8mb4_general_ci COMMENT '检查部位',
  `CONTENT` varchar(500) COLLATE utf8mb4_general_ci 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='堤防巡视检查项表';

CREATE TABLE `bs_sgc_df_xsjh` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防巡视检查计划编号',
  `XC_ID` int NOT NULL COMMENT '巡查ID',
  `DIKE_CODE` varchar(18) COLLATE utf8mb4_general_ci NOT NULL COMMENT '堤防代码',
  `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '巡查计划名称',
  `TYPE` int DEFAULT NULL COMMENT '巡查类型',
  `FREQUENCY` int COLLATE utf8mb4_general_ci COMMENT '检查次数',
  `CYCLE_TYPE` int COLLATE utf8mb4_general_ci COMMENT '周期',
  `IS_REMINDER` int  COLLATE utf8mb4_general_ci COMMENT '是否提醒',
  `REMINDER_TIME` datetime DEFAULT NULL COMMENT '提醒时间',
  `OTHER_CONFIG` text COLLATE utf8mb4_general_ci COMMENT '附加配置',
  `FILES` text COLLATE utf8mb4_general_ci 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='堤防巡视检查计划表';

CREATE TABLE `bs_sgc_df_xsjhzx` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防巡视检查计划执行者编号',
  `PLAN_ID` int NOT NULL COMMENT '巡查计划ID',
  `OPERATOR_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '执行人ID',
  `OPERATOR_NAME` varchar(50) COLLATE utf8mb4_general_ci 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='堤防巡视检查计划执行人表';

CREATE TABLE `bs_sgc_df_xsjhdw` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防巡视检查计划点位编号',
  `PLAN_ID` int NOT NULL COMMENT '巡查计划ID',
  `LONGITUDE` decimal(11,8) DEFAULT NULL COMMENT '经度',
  `LATITUDE` decimal(10,8) DEFAULT NULL COMMENT '纬度',
  `ALTITUDE` decimal(10,2) 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='堤防巡视检查计划点位表';


CREATE TABLE `bs_sgc_df_xsjhjl` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防巡视检查检查记录编号',
  `PLAN_ID` int  COMMENT '巡查计划ID',
  `DIKE_CODE` varchar(18) COLLATE utf8mb4_general_ci NOT NULL COMMENT '堤防代码',
  `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL 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='堤防巡视检查记录表';

CREATE TABLE `bs_sgc_df_xsjhjlz` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防巡视检查检查记录子项编号',
  `RECORD_ID` int NOT NULL COMMENT '巡查记录ID',
  `PARTS` varchar(100) COLLATE utf8mb4_general_ci COMMENT '检查部位',
  `CONTENT` varchar(500) COLLATE utf8mb4_general_ci COMMENT '检查内容',
  `STATUS` int NOT NULL COMMENT '状态',
  `PROBLEM` varchar(500) COLLATE utf8mb4_general_ci COMMENT '存在问题',
  `REMARK` text COLLATE utf8mb4_general_ci COMMENT '备注',
  `DOC` 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='堤防巡视检查检查记录子项表';

CREATE TABLE `bs_sgc_df_xsjhjgj` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防巡视检查检查记录轨迹编号',
  `RECORD_ID` int NOT NULL COMMENT '巡查记录ID',
  `LONGITUDE` decimal(11,8) DEFAULT NULL COMMENT '经度',
  `LATITUDE` decimal(10,8) DEFAULT NULL COMMENT '纬度',
  `ALTITUDE` decimal(10,2) DEFAULT NULL COMMENT '海拔',
  `CREATE_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
  `CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='堤防巡视检查检查记录轨迹表';


CREATE TABLE `bs_sgc_df_yhjh` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防维修养护计划编号',
  `DIKE_CODE` varchar(18) COLLATE utf8mb4_general_ci NOT NULL COMMENT '堤防代码',
  `NAME` varchar(100) COLLATE utf8mb4_general_ci COMMENT '名称',
  `PLAN_TIME` datetime DEFAULT NULL COMMENT '计划时间',
  `NATIONAL_SUPPLEMENT` float DEFAULT NULL COMMENT '国补资金',
  `SELF_SUPPLEMENT` float DEFAULT NULL COMMENT '自筹资金',
  `LOCATION` varchar(500) COLLATE utf8mb4_general_ci COMMENT '具体地点',
  `CONTENT` varchar(500) COLLATE utf8mb4_general_ci 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='堤防维修养护计划表';

CREATE TABLE `bs_sgc_df_yhjl` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防维修养护记录编号',
  `DIKE_CODE` varchar(18) COLLATE utf8mb4_general_ci  COMMENT '堤防代码',
  `PLAN_ID` varchar(18) COLLATE utf8mb4_general_ci  COMMENT '计划代码',
  `NAME` varchar(100) COLLATE utf8mb4_general_ci COMMENT '名称',
  `BEFORE` varchar(100) COLLATE utf8mb4_general_ci COMMENT '维护前',
  `MIDDLE` varchar(100) COLLATE utf8mb4_general_ci COMMENT '维护过程',
  `AFTER` varchar(100) COLLATE utf8mb4_general_ci COMMENT '维护结束',
  `MAINTENANCE_FUNDS` float DEFAULT NULL COMMENT '养护费用',
  `IMPLEMENT` varchar(500) COLLATE utf8mb4_general_ci COMMENT '落实情况',
  `REMARK` text COLLATE utf8mb4_general_ci COMMENT '备注',
  `STATUS` int NOT NULL COMMENT '状态',
  `DOC` 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='堤防维修养护记录表';

CREATE TABLE `bs_sgc_df_yhjlzx` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防维修养护执行者编号',
  `RECORD_ID` int NOT NULL COMMENT '养护记录ID',
  `OPERATOR_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '执行人ID',
  `OPERATOR_NAME` varchar(50) COLLATE utf8mb4_general_ci 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='堤防维修养护执行人表';

CREATE TABLE `bs_sgc_df_hdjh` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '害堤动物防治计划编号',
  `DIKE_CODE` varchar(18) COLLATE utf8mb4_general_ci NOT NULL COMMENT '堤防代码',
  `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '害堤动物防治计划名称',
  `TYPE` int DEFAULT NULL COMMENT '防治类型',
  `INSTRUCTION` varchar(500) COLLATE utf8mb4_general_ci  COMMENT '防治说明',
  `MONTH` int  COLLATE utf8mb4_general_ci COMMENT '工作月份',
  `FREQUENCY` int COLLATE utf8mb4_general_ci COMMENT '检查次数',
  `CYCLE_TYPE` int COLLATE utf8mb4_general_ci COMMENT '周期',
  `IS_REMINDER` int  COLLATE utf8mb4_general_ci COMMENT '是否提醒',
  `REMINDER_TIME` datetime DEFAULT NULL COMMENT '提醒时间',
  `OTHER_CONFIG` text COLLATE utf8mb4_general_ci COMMENT '附加配置',
  `REMARK` text COLLATE utf8mb4_general_ci COMMENT '备注',
  `PLAN_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_df_hdjhxq` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '害堤动物防治计划详情编号',
  `PLAN_ID` int NOT NULL COMMENT '害堤动物防治计划ID',
  `JOB_CONTENT` varchar(500) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '工作内容',
  `CONSTRUCTION_DATE` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '施工日期',
  `PLAN_DAYS` float NULL  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_df_hdjhzx` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '害堤动物防治计划执行者编号',
  `PLAN_ID` int NOT NULL COMMENT '害堤动物防治计划ID',
  `OPERATOR_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '执行人ID',
  `OPERATOR_NAME` varchar(50) COLLATE utf8mb4_general_ci 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='害堤动物防治计划执行人表';

CREATE TABLE `bs_sgc_df_hdjl` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '害堤动物防治计划执行记录编号',
  `DIKE_CODE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '堤防编码',
  `PLAN_ID` varchar(18) COLLATE utf8mb4_general_ci NOT NULL COMMENT '计划代码',
  `PLAN_NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '计划名称',
  `LOCATION` int COLLATE utf8mb4_general_ci COMMENT '施工地点',
  `CONSTRUCTION_STATUS` varchar(100) COLLATE utf8mb4_general_ci COMMENT '检查施工情况',
  `PEST` int COLLATE utf8mb4_general_ci COMMENT '有害生物',
  `REMARK` 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_df_hdjltp` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '害堤动物防治计划执行记录图片编号',
  `RECORD_ID` varchar(18) COLLATE utf8mb4_general_ci NOT NULL COMMENT '记录代码',
  `URL` varchar(500) 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='害堤动物防治计划执行记录图片表';

CREATE TABLE `bs_sgc_df_hdjlyy` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '害堤动物防治计划执行记录用药编号',
  `RECORD_ID` varchar(18) COLLATE utf8mb4_general_ci NOT NULL COMMENT '记录代码',
  `DRUG_NAME` varchar(100) COLLATE utf8mb4_general_ci COMMENT '药物名称',
  `CONCENTRATION` varchar(100) COLLATE utf8mb4_general_ci COMMENT '浓度',
  `DOSE` varchar(100) 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='害堤动物防治计划执行记录用药表';

CREATE TABLE `bs_sgc_df_syq` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防水雨情监测编号',
  `DIKE_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '堤防名称',
  `ADCD_START` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '起点行政区划',
  `DIKE_CODE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '堤防编码',
  `ADCD_END` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '终点行政区划',
  `DIKE_TYPE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '堤防类型',
  `DIKE_PATT` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '堤防型式',
  `ENG_TASK` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '工程任务',
  `WEATHER_CONDITION` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '天气情况',
  `WATER_LEVEL` float  NULL DEFAULT NULL COMMENT '水位高度',
  `RAIN_FALL` float  NULL DEFAULT NULL COMMENT '雨量监测',
  `GATE_FLOW`   float  NULL DEFAULT NULL COMMENT '过闸流量',
  `DOC` text COLLATE utf8mb4_general_ci COMMENT '文档',
  `ESCALATION_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '上报人',
  `ESCALATION_NAME` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '上报人名称',
  `ABNORMAL_CONDITION` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL 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='堤防水雨情检测表';

CREATE TABLE `bs_sgc_df_jdjcbf` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防监督检查办法编号',
    `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称',
    `STATUS` int NOT NULL COMMENT '状态',
    `SUPERVISE_CHECK_WAY` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci 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='堤防监督检查办法表';

CREATE TABLE `bs_sgc_df_jdjcbfxm` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防监督检查办法项目编号',
    `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称',
    `WAY_ID` int NOT NULL COMMENT '监督检查办法ID',
    `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='堤防监督检查办法项目表';

CREATE TABLE `bs_sgc_df_jdjcbfxmnr` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防监督检查办法项目内容编号',
    `PROJECT_ID` int NOT NULL COMMENT '监督检查办法项目ID',
    `CONTENT` varchar(500) COLLATE utf8mb4_general_ci COMMENT '检查内容',
    `SAME_GRADE` varchar(255) COLLATE utf8mb4_general_ci COMMENT '一般问题等级',
    `HEAVY_GRADE` varchar(255) COLLATE utf8mb4_general_ci COMMENT '较重问题等级',
    `SERIOUS_GRADE` varchar(255) COLLATE utf8mb4_general_ci 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='堤防监督检查办法项目内容表';


CREATE TABLE `bs_sgc_df_jdjcrw` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防监督检查任务编号',
    `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '监督检查任务名称',
    `DIKE_CODE` varchar(255)  COLLATE utf8mb4_general_ci COMMENT '堤防编码',
    `START_TIME` datetime DEFAULT NULL COMMENT '开始时间',
    `DONE_TIME` datetime DEFAULT NULL COMMENT '结束时间',
    `TASK_TIME` varchar(255)  COLLATE utf8mb4_general_ci COMMENT '任务时间',
    `INSPECTORS` varchar(500) COLLATE utf8mb4_general_ci COMMENT '检查人员',
    `CONTENT` varchar(500) COLLATE utf8mb4_general_ci COMMENT '检查任务背景',
    `WAY_ID` int  COMMENT '监督检查办法ID',
    `STATE` varchar(50) DEFAULT NULL COMMENT '状态',
    `PATROL_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '巡查人员ID',
    `PATROL_NAME` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '巡查人员名称',
    `WEATHER` varchar(50) COLLATE utf8mb4_general_ci 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='堤防监督检查任务管理表';

CREATE TABLE `bs_sgc_df_jdjcgc` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防监督检查工程编号',
    `TASK_ID` int NOT NULL COMMENT '监督检查任务ID',
    `PROJECT_ID` int NOT NULL COMMENT '监督检查办法项目ID',
    `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='堤防监督检查工程管理表';

CREATE TABLE `bs_sgc_df_jdjcgcwt` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防监督检查工程内容编号',
    `TASK_ID` int NOT NULL COMMENT '监督检查任务ID',
    `PROJECT_ID` int NOT NULL COMMENT '监督检查办法项目ID',
    `PROJECT_ITEM_ID` int NOT NULL COMMENT '监督检查办法项目内容ID',
    `LEVEL` varchar(100) DEFAULT NULL COMMENT '问题等级',
     `PROBLEM_DESCRIBE` text COLLATE utf8mb4_general_ci COMMENT '问题描述',
     `SITE_SITUATION_RECORDS` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '现场记录情况',
    `STATUS` varchar(32) DEFAULT NULL COMMENT '状态',
    `HANDLE_RECORD` text COLLATE utf8mb4_general_ci COMMENT '处理记录',
    `HANDLE_SITUATION_RECORDS` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '处理记录情况',
    `HANDLE_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '处理人员ID',
    `HANDLE_NAME` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '处理人员名称',
    `HANDLE_TIME` datetime DEFAULT NULL COMMENT '处理时间',
    `CONFIRM_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '确认人员ID',
    `CONFIRM_NAME` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '确认人员名称',
    `CONFIRM_TIME` 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='堤防监督检查工程问题表';


CREATE TABLE `bs_sgc_df_dtsb` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防动态检测设备编号',
    `DIKE_CODE` varchar(255)  COLLATE utf8mb4_general_ci COMMENT '堤防编码',
    `TYPE` int NOT NULL COMMENT '设备类型',
    `NAME`  varchar(100) DEFAULT NULL COMMENT '设备名称',
    `DEVICE_ID`  varchar(100) DEFAULT NULL COMMENT '设备id',
    `MESSAGE` varchar(500) DEFAULT NULL COMMENT '设备信息',
    `WARNING_TYPE` varchar(32) DEFAULT NULL COMMENT '预警类型',
    `WARNING_LEVEL` varchar(32) DEFAULT NULL COMMENT '预警等级',
    `CONFIG` text COLLATE utf8mb4_general_ci 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='堤防动态检测设备表';

CREATE TABLE `bs_sgc_df_dtsbr` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防动态检测记录编号',
    `DIKE_CODE` varchar(255)  COLLATE utf8mb4_general_ci COMMENT '堤防编码',
    `DEVICE_ID`  varchar(100) DEFAULT NULL COMMENT '设备id',
    `DEVICE_NAME`  varchar(100) DEFAULT NULL COMMENT '设备名称',
    `DEVICE_TYPE` int NOT NULL COMMENT '设备类型',
    `WARNING_TYPE` varchar(32) DEFAULT NULL COMMENT '预警类型',
    `WARNING_LEVEL` varchar(32) DEFAULT NULL COMMENT '预警等级',
    `WARNING_TIME` datetime DEFAULT NULL COMMENT '预警时间',
    `WARNING_DATA` varchar(100) 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='堤防动态检测记录表';

CREATE TABLE `bs_sgc_df_bxgcxm` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '病险工程核查项目编号',
    `NAME` varchar(50) COLLATE utf8mb4_general_ci 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='堤防病险工程核查项目表';

CREATE TABLE `bs_sgc_df_bxgcxmnr` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防病险工程核查项目内容编号',
    `PROJECT_ID` int NOT NULL COMMENT '病险工程核查项目ID',
    `CONTENT` varchar(500) COLLATE utf8mb4_general_ci 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='堤防病险工程核查项目内容表';

CREATE TABLE `bs_sgc_df_bxgcfz` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防病险工程核查分组编号',
    `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '小组名称',
		`DEPT_ID` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单位id',
    `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='堤防病险工程核查分组表';

CREATE TABLE `bs_sgc_df_bxgcfzcy` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防病险工程核查分组成员编号',
		`GROUP_ID` int NOT NULL COMMENT '病险工程核查分组ID',
		`GROUP_UID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '小组成员ID',
		`GROUP_NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '小组成员名称',
		`DEPT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '所属单位ID',
    `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='堤防病险工程核查分组成员关系表';

CREATE TABLE `bs_sgc_df_bxgcrw` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '病险工程核查任务编号',
    `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '任务名称',
	`GROUP_ID` int NOT NULL COMMENT '病险工程核查分组ID',
    `DIKE_CODE` varchar(255)  COLLATE utf8mb4_general_ci COMMENT '堤防编码',
    `START_TIME` datetime DEFAULT NULL COMMENT '开始时间',
    `DONE_TIME` datetime DEFAULT NULL COMMENT '结束时间',
    `CONTENT` varchar(500) COLLATE utf8mb4_general_ci COMMENT '检查任务背景',
    `STATE` varchar(50) 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='堤防病险工程核查任务表';

CREATE TABLE `bs_sgc_df_bxgcnrgl` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '病险工程项目任务关联编号',
    `TASK_ID` int NOT NULL COMMENT '任务ID',
    `PROJECT_ID` int NOT NULL COMMENT '项目ID',
    `PROJECT_ITEM_ID` int NOT NULL COMMENT '项目内容ID',
    `LEVEL` varchar(100) DEFAULT NULL COMMENT '问题等级',
    `PROBLEM_DESCRIBE` text COLLATE utf8mb4_general_ci COMMENT '问题描述',
    `SITE_SITUATION_RECORDS` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '现场记录情况',
    `STATUS` varchar(32) 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_sz_xs` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸巡视检查编号',
  `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '巡查名称',
  `TYPE` int 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='水闸巡视检查表';


CREATE TABLE `bs_sgc_sz_xsx` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸巡查内容编号',
  `XC_ID` int NOT NULL COMMENT '巡查ID',
  `PARTS` varchar(100) COLLATE utf8mb4_general_ci COMMENT '检查部位',
  `CONTENT` varchar(500) COLLATE utf8mb4_general_ci 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='水闸巡视检查项表';

CREATE TABLE `bs_sgc_sz_xsjh` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸巡视检查计划编号',
  `XC_ID` int NOT NULL COMMENT '巡查ID',
  `WAGA_CODE` varchar(18) COLLATE utf8mb4_general_ci NOT NULL COMMENT '水闸代码',
  `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '巡查计划名称',
  `TYPE` int DEFAULT NULL COMMENT '巡查类型',
  `FREQUENCY` int COLLATE utf8mb4_general_ci COMMENT '检查次数',
  `CYCLE_TYPE` int COLLATE utf8mb4_general_ci COMMENT '周期',
  `IS_REMINDER` int  COLLATE utf8mb4_general_ci COMMENT '是否提醒',
  `REMINDER_TIME` datetime DEFAULT NULL COMMENT '提醒时间',
  `OTHER_CONFIG` text COLLATE utf8mb4_general_ci 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='水闸巡视检查计划表';

CREATE TABLE `bs_sgc_sz_xspj` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸巡视检查与水闸绑定编号',
  `XC_ID` int NOT NULL COMMENT '巡查ID',
  `TYPE` int DEFAULT NULL COMMENT '巡查类型',
  `WAGA_CODE` varchar(18) COLLATE utf8mb4_general_ci 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_sz_xsjhzx` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸巡视检查计划执行者编号',
  `PLAN_ID` int NOT NULL COMMENT '巡查计划ID',
  `OPERATOR_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '执行人',
  `OPERATOR_NAME` varchar(50) COLLATE utf8mb4_general_ci 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='水闸巡视检查计划执行人表';

CREATE TABLE `bs_sgc_sz_xsjhdw` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸巡视检查计划点位编号',
  `PLAN_ID` int NOT NULL COMMENT '巡查计划ID',
  `LONGITUDE` decimal(11,8) DEFAULT NULL COMMENT '经度',
  `LATITUDE` decimal(10,8) DEFAULT NULL COMMENT '纬度',
  `ALTITUDE` decimal(10,2) 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='水闸巡视检查计划点位表';


CREATE TABLE `bs_sgc_sz_xsjhjl` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸巡视检查检查记录编号',
  `PLAN_ID` int  COMMENT '巡查计划ID',
  `WAGA_CODE` varchar(18) COLLATE utf8mb4_general_ci NOT NULL COMMENT '水闸代码',
  `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL 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='水闸巡视检查记录表';

CREATE TABLE `bs_sgc_sz_xsjhjlz` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸巡视检查检查记录子项编号',
  `RECORD_ID` int NOT NULL COMMENT '巡查记录ID',
  `PARTS` varchar(100) COLLATE utf8mb4_general_ci COMMENT '检查部位',
  `CONTENT` varchar(500) COLLATE utf8mb4_general_ci COMMENT '检查内容',
  `STATUS` int NOT NULL COMMENT '状态',
  `PROBLEM` varchar(500) COLLATE utf8mb4_general_ci COMMENT '存在问题',
  `REMARK` text COLLATE utf8mb4_general_ci COMMENT '备注',
  `DOC` 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='水闸巡视检查检查记录子项表';

CREATE TABLE `bs_sgc_sz_xsjhjgj` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸巡视检查检查记录轨迹编号',
  `RECORD_ID` int NOT NULL COMMENT '巡查记录ID',
  `LONGITUDE` decimal(11,8) DEFAULT NULL COMMENT '经度',
  `LATITUDE` decimal(10,8) DEFAULT NULL COMMENT '纬度',
  `ALTITUDE` decimal(10,2) DEFAULT NULL COMMENT '海拔',
  `CREATE_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
  `CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='水闸巡视检查检查记录轨迹表';

CREATE TABLE `bs_sgc_sz_yhjh` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸维修养护计划编号',
  `WAGA_CODE` varchar(18) COLLATE utf8mb4_general_ci NOT NULL COMMENT '水闸代码',
  `NAME` varchar(100) COLLATE utf8mb4_general_ci COMMENT '名称',
  `PLAN_TIME` datetime DEFAULT NULL COMMENT '计划时间',
  `NATIONAL_SUPPLEMENT` float DEFAULT NULL COMMENT '国补资金',
  `SELF_SUPPLEMENT` float DEFAULT NULL COMMENT '自筹资金',
  `LOCATION` varchar(500) COLLATE utf8mb4_general_ci COMMENT '具体地点',
  `CONTENT` varchar(500) COLLATE utf8mb4_general_ci 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='水闸维修养护计划表';

CREATE TABLE `bs_sgc_sz_yhjl` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸维修养护记录编号',
  `WAGA_CODE` varchar(18) COLLATE utf8mb4_general_ci COMMENT '水闸代码',
  `PLAN_ID` varchar(18) COLLATE utf8mb4_general_ci  COMMENT '计划代码',
  `NAME` varchar(100) COLLATE utf8mb4_general_ci COMMENT '名称',
  `BEFORE` varchar(100) COLLATE utf8mb4_general_ci COMMENT '维护前',
  `MIDDLE` varchar(100) COLLATE utf8mb4_general_ci COMMENT '维护过程',
  `AFTER` varchar(100) COLLATE utf8mb4_general_ci COMMENT '维护结束',
  `MAINTENANCE_FUNDS` float DEFAULT NULL COMMENT '养护费用',
  `IMPLEMENT` varchar(500) COLLATE utf8mb4_general_ci COMMENT '落实情况',
  `REMARK` text COLLATE utf8mb4_general_ci COMMENT '备注',
  `STATUS` int NOT NULL COMMENT '状态',
  `DOC` 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='水闸维修养护记录表';

CREATE TABLE `bs_sgc_sz_yhjlzx` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸维修养护执行者编号',
  `RECORD_ID` int NOT NULL COMMENT '养护记录ID',
  `OPERATOR_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '执行人ID',
  `OPERATOR_NAME` varchar(50) COLLATE utf8mb4_general_ci 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='水闸维修养护执行人表';

CREATE TABLE `bs_sgc_sz_syq` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸水雨情监测编号',
  `WAGA_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '堤防名称',
  `ADCD` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '行政区划',
  `WAGA_CODE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '堤防编码',
  `REMARK` text COLLATE utf8mb4_general_ci COMMENT '备注',
  `STATUS` int NOT NULL COMMENT '状态',
  `DOOR_STATUS` int NOT NULL COMMENT '闸门状态',
  `WEATHER_CONDITION` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '天气情况',
  `WATER_LEVEL` float  NULL DEFAULT NULL COMMENT '水位高度',
  `RAIN_FALL`   float NULL DEFAULT NULL COMMENT '降雨量',
  `GATE_FLOW`   float  NULL DEFAULT NULL COMMENT '过闸流量',
  `DOC` text COLLATE utf8mb4_general_ci COMMENT '文档',
  `ESCALATION_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '上报人',
  `ESCALATION_NAME` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '上报人名称',
  `ABNORMAL_CONDITION` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL 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_sz_jdjcbf` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸监督检查办法编号',
    `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称',
    `STATUS` int NOT NULL COMMENT '状态',
    `SUPERVISE_CHECK_WAY` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci 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='水闸监督检查办法表';

CREATE TABLE `bs_sgc_sz_jdjcbfxm` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸监督检查办法项目编号',
    `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称',
    `WAY_ID` int NOT NULL COMMENT '监督检查办法ID',
    `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='水闸监督检查办法项目表';

CREATE TABLE `bs_sgc_sz_jdjcbfxmnr` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸监督检查办法项目内容编号',
    `PROJECT_ID` int NOT NULL COMMENT '监督检查办法项目ID',
    `CONTENT` varchar(500) COLLATE utf8mb4_general_ci COMMENT '检查内容',
    `SAME_GRADE` varchar(255) COLLATE utf8mb4_general_ci COMMENT '一般问题等级',
    `HEAVY_GRADE` varchar(255) COLLATE utf8mb4_general_ci COMMENT '较重问题等级',
    `SERIOUS_GRADE` varchar(255) COLLATE utf8mb4_general_ci 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='水闸监督检查办法项目内容表';

CREATE TABLE `bs_sgc_sz_jdjcrw` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸监督检查任务编号',
    `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '监督检查任务名称',
    `WAGA_CODE` varchar(255)  COLLATE utf8mb4_general_ci COMMENT '水闸编码',
    `START_TIME` datetime DEFAULT NULL COMMENT '开始时间',
    `DONE_TIME` datetime DEFAULT NULL COMMENT '结束时间',
    `TASK_TIME` varchar(255)  COLLATE utf8mb4_general_ci COMMENT '任务时间',
    `INSPECTORS` varchar(500) COLLATE utf8mb4_general_ci COMMENT '检查人员',
    `CONTENT` varchar(500) COLLATE utf8mb4_general_ci COMMENT '检查任务背景',
    `WAY_ID` int  COMMENT '监督检查办法ID',
    `STATE` varchar(50) DEFAULT NULL COMMENT '状态',
    `PATROL_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '巡查人员ID',
    `PATROL_NAME` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '巡查人员名称',
    `WEATHER` varchar(50) COLLATE utf8mb4_general_ci 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='水闸监督检查任务管理表';


CREATE TABLE `bs_sgc_sz_jdjcgcwt` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸监督检查工程内容编号',
    `TASK_ID` int NOT NULL COMMENT '监督检查任务ID',
    `PROJECT_ID` int NOT NULL COMMENT '监督检查办法项目ID',
    `PROJECT_ITEM_ID` int NOT NULL COMMENT '监督检查办法项目内容ID',
    `LEVEL` varchar(100) DEFAULT NULL COMMENT '问题等级',
    `PROBLEM_DESCRIBE` text COLLATE utf8mb4_general_ci COMMENT '问题描述',
    `SITE_SITUATION_RECORDS` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '现场记录情况',
    `STATUS` varchar(32) DEFAULT NULL COMMENT '状态',
    `HANDLE_RECORD` text COLLATE utf8mb4_general_ci COMMENT '处理记录',
    `HANDLE_SITUATION_RECORDS` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '处理记录情况',
    `HANDLE_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '处理人员ID',
    `HANDLE_NAME` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '处理人员名称',
    `HANDLE_TIME` datetime DEFAULT NULL COMMENT '处理时间',
    `CONFIRM_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '确认人员ID',
    `CONFIRM_NAME` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '确认人员名称',
    `CONFIRM_TIME` 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='水闸监督检查工程问题表';

CREATE TABLE `bs_sgc_sz_dtsb` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸动态检测设备编号',
    `WAGA_CODE` varchar(255)  COLLATE utf8mb4_general_ci COMMENT '水闸编码',
    `TYPE` int NOT NULL COMMENT '设备类型',
    `NAME`  varchar(100) DEFAULT NULL COMMENT '设备名称',
    `DEVICE_ID`  varchar(100) DEFAULT NULL COMMENT '设备id',
    `MESSAGE` varchar(500) DEFAULT NULL COMMENT '设备信息',
    `WARNING_TYPE` varchar(32) DEFAULT NULL COMMENT '预警类型',
    `WARNING_LEVEL` varchar(32) DEFAULT NULL COMMENT '预警等级',
    `CONFIG` text COLLATE utf8mb4_general_ci 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='水闸动态检测设备表';

CREATE TABLE `bs_sgc_sz_dtsbr` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸动态检测记录编号',
    `WAGA_CODE` varchar(255)  COLLATE utf8mb4_general_ci COMMENT '水闸编码',
    `DEVICE_ID`  varchar(100) DEFAULT NULL COMMENT '设备id',
    `DEVICE_NAME`  varchar(100) DEFAULT NULL COMMENT '设备名称',
    `DEVICE_TYPE` int NOT NULL COMMENT '设备类型',
    `WARNING_TYPE` varchar(32) DEFAULT NULL COMMENT '预警类型',
    `WARNING_LEVEL` varchar(32) DEFAULT NULL COMMENT '预警等级',
    `WARNING_TIME` datetime DEFAULT NULL COMMENT '预警时间',
    `WARNING_DATA` varchar(100) COLLATE utf8mb4_general_ci COMMENT '预警数据',
    `STATUS` int DEFAULT 0 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_sz_ddjh` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸调度计划编号',
    `WAGA_CODE` varchar(255)  COLLATE utf8mb4_general_ci COMMENT '水闸编码',
    `NAME`  varchar(100) DEFAULT NULL COMMENT '计划名称',
    `DOC` 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='水闸调度计划表';

CREATE TABLE `bs_sgc_sz_czjl` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸操作记录编号',
    `WAGA_CODE` varchar(255)  COLLATE utf8mb4_general_ci COMMENT '水闸编码',
    `GATE` varchar(255)  COLLATE utf8mb4_general_ci COMMENT '闸门',
    `GATE_NUM` varchar(255)  COLLATE utf8mb4_general_ci COMMENT '闸号',
    `COMMAND_NUM` varchar(255)  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 '最近修改时间',
    `CONTROL_LEVEL` float  NULL DEFAULT NULL COMMENT '控制水位',
    `LEFT_DRY` float  NULL DEFAULT NULL COMMENT '左干',
    `RIGHT_DRY` float  NULL DEFAULT NULL COMMENT '右干',
    `UPSTREAM_LEVEL` float  NULL DEFAULT NULL COMMENT '上游水位',
    `DOWNSTREAM_LEVEL` float  NULL DEFAULT NULL COMMENT '下游水位',
    `OPENING` float  NULL DEFAULT NULL COMMENT '开度',
    `OPERATOR_TIME` datetime DEFAULT NULL COMMENT '操作时间',
    PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='水闸操作记录表';


CREATE TABLE `bs_sgc_sz_bxgcxm` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '病险工程核查项目编号',
    `NAME` varchar(50) COLLATE utf8mb4_general_ci 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='水闸病险工程核查项目表';

CREATE TABLE `bs_sgc_sz_bxgcxmnr` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '病险工程核查项目内容编号',
    `PROJECT_ID` int NOT NULL COMMENT '病险工程核查项目ID',
    `CONTENT` varchar(500) COLLATE utf8mb4_general_ci 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='水闸病险工程核查项目内容表';


CREATE TABLE `bs_sgc_sz_bxgcfz` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '病险工程核查分组编号',
    `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '小组名称',
		`DEPT_ID` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单位id',
    `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='水闸病险工程核查分组表';


CREATE TABLE `bs_sgc_sz_bxgcfzcy` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '病险工程核查分组成员编号',
	`GROUP_ID` int NOT NULL COMMENT '病险工程核查分组ID',
	`GROUP_UID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '小组成员ID',
	`GROUP_NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '小组成员名称',
	`DEPT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '所属单位ID',
    `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='水闸病险工程核查分组成员关系表';

CREATE TABLE `bs_sgc_sz_bxgcrw` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '病险工程核查任务编号',
    `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '任务名称',
	`GROUP_ID` int NOT NULL COMMENT '病险工程核查分组ID',
    `WAGA_CODE` varchar(255)  COLLATE utf8mb4_general_ci COMMENT '水闸编码',
    `START_TIME` datetime DEFAULT NULL COMMENT '开始时间',
    `DONE_TIME` datetime DEFAULT NULL COMMENT '结束时间',
    `CONTENT` varchar(500) COLLATE utf8mb4_general_ci COMMENT '检查任务背景',
    `STATE` varchar(50) 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='水闸病险工程核查任务表';

CREATE TABLE `bs_sgc_sz_bxgcnrgl` (
    `ID` int NOT NULL AUTO_INCREMENT COMMENT '病险工程项目任务关联编号',
    `TASK_ID` int NOT NULL COMMENT '任务ID',
    `PROJECT_ID` int NOT NULL COMMENT '项目ID',
    `PROJECT_ITEM_ID` int NOT NULL COMMENT '项目内容ID',
    `LEVEL` varchar(100) DEFAULT NULL COMMENT '问题等级',
    `PROBLEM_DESCRIBE` text COLLATE utf8mb4_general_ci COMMENT '问题描述',
    `SITE_SITUATION_RECORDS` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '现场记录情况',
    `STATUS` varchar(32) 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 OR REPLACE VIEW `v_bs_sgc_dtsbr` AS
SELECT df.`ID`, df.`DIKE_CODE` AS `CODE`,gc.`DIKE_NAME` AS `NAME`,'1' AS `TYPE`,df.`STATUS` AS `STATUS`,df.`DEVICE_ID`,df.`DEVICE_NAME`,gc.`ADCD` AS ADCD, df.`WARNING_TYPE` AS `WARNING_TYPE`, df.`WARNING_LEVEL` AS `WARNING_LEVEL`, df.`WARNING_TIME` AS `WARNING_TIME`
FROM `bs_sgc_df_dtsbr` AS df
LEFT JOIN `bs_sgc_df_gcda` AS gc ON df.`DIKE_CODE` = gc.`DIKE_CODE` AND gc.`EXPR_DATE` is null
union all
SELECT sz.`ID`, sz.`WAGA_CODE` AS `CODE`,jb.`WAGA_NAME` AS `NAME`,'2' AS `TYPE`,sz.`STATUS` AS `STATUS`,sz.`DEVICE_ID`,sz.`DEVICE_NAME`,jb.`ADCD` AS ADCD, sz.`WARNING_TYPE` AS `WARNING_TYPE`, sz.`WARNING_LEVEL` AS `WARNING_LEVEL`, sz.`WARNING_TIME` AS `WARNING_TIME`
FROM `bs_sgc_sz_dtsbr` AS sz
LEFT JOIN `bs_sgc_sz_jbxx` AS jb ON sz.`WAGA_CODE` = jb.`WAGA_CODE` and jb.`EXPR_DATE` is null