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(255) 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 '堤防巡视检查计划编号',
  `DIKE_CODE` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '堤防代码',
  `DIKE_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '堤防名称',
  `DIKE_TYPE` int  COMMENT '堤防类型',
  `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '巡查计划名称',
  `TYPE` int DEFAULT NULL COMMENT '巡查计划类型',
  `STATUS` int NOT 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 '备注',
  `START_DATE` datetime DEFAULT NULL COMMENT '计划开始时间',
  `END_DATE` 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_xsjhzx` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防巡视检查计划执行者编号',
  `PLAN_ID` int NOT NULL COMMENT '巡查计划ID',
  `SUB_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_xsjhjl` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防巡视检查检查记录编号',
  `PLAN_ID` int  COMMENT '巡查计划ID',
  `PLAN_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '计划名称',
  `SUB_PLAN_ID` int  COMMENT '子计划ID',
  `SUB_PLAN_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '子计划名称',
  `SUB_PLAN_START_DATE` datetime DEFAULT NULL COMMENT '子计划开始时间',
  `SUB_PLAN_END_DATE` datetime DEFAULT NULL COMMENT '子计划结束时间',
  `LINE_ID` int  COMMENT '巡查路线ID',
  `LINE_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '路线名称',
  `LINE_TYPE` int  COMMENT '路线类型',
  `DUTY_HOLDER_TYPE` int DEFAULT NULL COMMENT '巡查责任人类型',
  `START_DATE` datetime DEFAULT NULL COMMENT '巡查开始时间',
  `END_DATE` datetime DEFAULT NULL COMMENT '巡查结束时间',
  `DIKE_CODE` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '堤防代码',
  `DIKE_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '堤防名称',
  `DIKE_TYPE` int  COMMENT '堤防类型',
  `REMAINING` int  COMMENT '剩余巡查项'
  `SCOPE` varchar(50) COLLATE utf8mb4_general_ci COMMENT '巡查范围',
  `NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '巡查记录名称',
  `HANDLE_STATUS` int 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_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_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(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_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 '文档',
  `HANDLE_IMAGES` text COLLATE utf8mb4_general_ci COMMENT '处置图片',
  `HANDLE_CONTENT` varchar(500) COLLATE utf8mb4_general_ci COMMENT '处置描述',
  `HANDLE_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_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(100) COLLATE utf8mb4_general_ci NOT NULL COMMENT '堤防代码',
  `DIKE_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '堤防名称',
  `DIKE_TYPE` int  COMMENT '堤防类型',
  `NAME` varchar(100) COLLATE utf8mb4_general_ci COMMENT '名称',
  `TYPE` int DEFAULT NULL COMMENT '维修养护类型',
  `START_DATE` datetime DEFAULT NULL COMMENT '计划开始时间',
  `END_DATE` datetime DEFAULT NULL COMMENT '计划结束时间',
  `SUPPLEMENT` varchar(500) DEFAULT NULL COMMENT '资金',
  `DOC` text COLLATE utf8mb4_general_ci COMMENT '文档',
  `ENGINEERING_UNIT` varchar(100) COLLATE utf8mb4_general_ci COMMENT '工程单位',
  `RESPONSIBLE_PERSON` varchar(100) COLLATE utf8mb4_general_ci COMMENT '负责人',
  `REMINDER_TIME` datetime DEFAULT NULL 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_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_df_yhjl` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防维修养护记录编号',
  `DIKE_CODE` varchar(255) COLLATE utf8mb4_general_ci  COMMENT '堤防代码',
  `DIKE_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '堤防名称',
  `DIKE_TYPE` int  COMMENT '堤防类型',
  `PLAN_ID` varchar(18) COLLATE utf8mb4_general_ci  COMMENT '计划代码',
  `PLAN_NAME` varchar(100) COLLATE utf8mb4_general_ci  COMMENT '计划名称',
  `NAME` varchar(100) COLLATE utf8mb4_general_ci COMMENT '名称',
  `SUPPLEMENT` varchar(500) DEFAULT NULL COMMENT '资金',
  `DOC` text COLLATE utf8mb4_general_ci COMMENT '维养文档',
  `LEDGER_DOC` text 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_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(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '堤防代码',
  `NAME` varchar(100) 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 '状态',
       `FINISH_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_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(255) 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_sz_xspj` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸巡视检查与水闸绑定编号',
  `XC_ID` int NOT NULL COMMENT '巡查ID',
  `TYPE` int DEFAULT NULL COMMENT '巡查类型',
  `WAGA_CODE` varchar(255) 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(255) 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 '名称',
  `WAGA_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '水闸名称',
  `WAGA_TYPE` int  COMMENT '水闸类型',
  `TYPE` int DEFAULT NULL COMMENT '维修养护类型',
  `START_DATE` datetime DEFAULT NULL COMMENT '计划开始时间',
  `END_DATE` datetime DEFAULT NULL COMMENT '计划结束时间',
  `SUPPLEMENT` varchar(500) DEFAULT NULL COMMENT '资金',
  `DOC` text COLLATE utf8mb4_general_ci COMMENT '文档',
  `ENGINEERING_UNIT` varchar(100) COLLATE utf8mb4_general_ci COMMENT '工程单位',
  `RESPONSIBLE_PERSON` varchar(100) COLLATE utf8mb4_general_ci COMMENT '负责人',
  `REMINDER_TIME` datetime DEFAULT 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_yhjl` (
  `ID` int NOT NULL AUTO_INCREMENT COMMENT '水闸维修养护记录编号',
  `WAGA_CODE` varchar(255) COLLATE utf8mb4_general_ci COMMENT '水闸代码',
  `WAGA_NAME` varchar(50) COLLATE utf8mb4_general_ci COMMENT '水闸名称',
  `WAGA_TYPE` int  COMMENT '水闸类型',
  `PLAN_ID` varchar(18) COLLATE utf8mb4_general_ci  COMMENT '计划代码',
  `PLAN_NAME` varchar(100) COLLATE utf8mb4_general_ci COMMENT '计划名称',
  `SUPPLEMENT` varchar(500) DEFAULT NULL COMMENT '资金',
  `REMARK` text COLLATE utf8mb4_general_ci COMMENT '备注',
  `STATUS` int NOT NULL COMMENT '状态',
  `DOC` text COLLATE utf8mb4_general_ci COMMENT '文档',
  `LEDGER_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 '状态',
    `FINISH_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_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



CREATE TABLE `bs_sgc_qqjd_dir` (
                                   `id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键',
                                   `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '目录名称',
                                   `parent_id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '父节点ID',
                                   `xpath` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '节点路径',
                                   `dir_seq` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '目录序列',
                                   `order_nm` decimal(8,0) DEFAULT NULL COMMENT '排序',
                                   `pub_date` datetime DEFAULT NULL COMMENT '发布时间',
                                   `create_user` varchar(255) DEFAULT NULL COMMENT '创建人',
                                   `directory_description` longtext CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '图层目录描述',
                                   `is_valid` int DEFAULT NULL COMMENT '数据是否有效，用来标识逻辑删除，1：可用，0：已被逻辑删除',
                                   PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

CREATE TABLE `bs_sgc_qqjd_dir_layer` (
                                         `id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键',
                                         `dir_id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '目录id，和sy_dir的主键进行关联',
                                         `layer_id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '图层id，和sy_layer的主键进行关联',
                                         `order_nm` decimal(8,0) DEFAULT NULL COMMENT '排序序号值',
                                         `is_valid` int DEFAULT NULL COMMENT '数据是否有效，用来标识逻辑删除，1：可用，0：已被逻辑删除',
                                         PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

CREATE TABLE `bs_sgc_qqjd_layer` (
                                     `id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键',
                                     `service_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '图层名称',
                                     `service_name_alias` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '图层别名',
                                     `service_url` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '图层服务URL',
                                     `service_type` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '图层服务类型',
                                     `service_index` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '图层索引，对于iserver发布的wfs服务，索引值为`工作空间:图层名称`',
                                     `pub_date` datetime DEFAULT NULL COMMENT '发布日期',
                                     `create_user` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '创建人',
                                     `layer_3d_type` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '3d图层类型 白膜/BIM/倾斜摄影/点云/人工建模',
                                     `tile_size` int DEFAULT NULL COMMENT '瓦片大小,wmts服务需要填写',
                                     `tile_matrix_set` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '矩阵集,wmts服务需要填写',
                                     `dir_id` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '所属目录id',
                                     `dir_name` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '所属目录名称',
                                     `remark` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
                                     `format` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '后缀名，wmts服务需要填写',
                                     `data` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '图层表扩展字段集合的json',
                                     `annotation_url` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '图层服务注记URL(底图)',
                                     `service_token` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '图层服务token(底图)',
                                     `annotation_service_index` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '注记图层服务索引(底图)',
                                     `tileset_option` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '3D tiles性能调试参数',
                                     `is_layer_group` tinyint(1) DEFAULT '0' COMMENT '是否为图层组（配置geoserver图层组时需要判断，如果为图层组，则不加载图层组默认的样式）',
                                     `relation_service_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '关联服务id',
                                     `relation_service_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '关联服务名称',
                                     `relation_style_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '关联图层样式id',
                                     `relation_style_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '关联图层样式名称',
                                     `is_valid` int DEFAULT NULL COMMENT '数据是否有效，用来标识逻辑删除，1：可用，0：已被逻辑删除',
                                     `extend_data` longtext COMMENT '扩展字段，主要用来标识关联关系',
                                     PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;


CREATE TABLE `bs_sgc_qqjd_layer_field` (
                                           `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键id',
                                           `layer_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '图层id',
                                           `field` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '字段名称',
                                           `field_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '字段名称',
                                           `field_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '字段类型',
                                           `is_show` tinyint DEFAULT NULL COMMENT '0：false；1：true',
                                           `order_nm` int DEFAULT NULL COMMENT '排序',
                                           PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `bs_sgc_qqjd_layer_style` (
                                           `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键id',
                                           `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '样式名称',
                                           `layer_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '图层类型',
                                           `information` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '样式信息',
                                           `remark` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '样式备注',
                                           `style_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '适用类型',
                                           `view_img` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '样式图片Url',
                                           `create_time` datetime DEFAULT NULL COMMENT '创建时间',
                                           `modify_time` datetime DEFAULT NULL COMMENT '修改时间',
                                           `is_valid` int DEFAULT NULL COMMENT '数据是否有效，用来标识逻辑删除，1：可用，0：已被逻辑删除',
                                           PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `bs_sgc_qqjd_scene` (
                                     `id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键',
                                     `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '目录名称',
                                     `pub_date` datetime DEFAULT NULL COMMENT '发布时间',
                                     `create_user` varchar(255) DEFAULT NULL COMMENT '创建人',
                                     `interface_address` longtext CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '接口地址',
                                     `description` longtext COMMENT '描述',
                                     `is_valid` int DEFAULT NULL COMMENT '数据是否有效，用来标识逻辑删除，1：可用，0：已被逻辑删除',
                                     PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

CREATE TABLE `bs_sgc_qqjd_scene_config_relation` (
                                                     `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键',
                                                     `scene_id` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '场景id',
                                                     `init_time` datetime DEFAULT NULL COMMENT '初始时间',
                                                     `init_weather` int DEFAULT NULL COMMENT '初始天气，晴天:1、多云:2、阴天:3、小雨:4、中雨:5、暴雨:6、雪天:7、雾天:8',
                                                     `weather_intensity` int DEFAULT NULL COMMENT '天气强度',
                                                     `ambient_light_intensity` int DEFAULT NULL COMMENT '环境光强度',
                                                     `movement_sensitivity` int DEFAULT NULL COMMENT '移动灵敏度',
                                                     `rotation_sensitivity` int DEFAULT NULL COMMENT '旋转灵敏度',
                                                     `zoom_sensitivity` int DEFAULT NULL COMMENT '缩放灵敏度\r\n',
                                                     `view_img` longtext COLLATE utf8mb4_general_ci COMMENT '视点预览图',
                                                     `layer_id` text COLLATE utf8mb4_general_ci COMMENT '关联图层id',
                                                     `camera_posture` json DEFAULT NULL COMMENT '相机姿态信息',
                                                     `is_valid` int DEFAULT NULL COMMENT '数据是否有效，用来标识逻辑删除，1：可用，0：已被逻辑删除',
                                                     PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `bs_sgc_qqjd_scene_dir_relation` (
                                                  `id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键',
                                                  `scene_id` varchar(255) DEFAULT NULL COMMENT '场景id',
                                                  `dir_id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '目录id，和sy_dir的主键进行关联',
                                                  `relate_date` datetime DEFAULT NULL COMMENT '场景和图层目录关联日期',
                                                  `is_valid` int DEFAULT NULL COMMENT '数据是否有效，用来标识逻辑删除，1：可用，0：已被逻辑删除',
                                                  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;