SET NAMES utf8mb4;
ALTER TABLE `bs_sgc_df_yhjl` MODIFY COLUMN DIKE_CODE varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '堤防代码';
ALTER TABLE `bs_sgc_df_yhjl` MODIFY COLUMN `PLAN_ID` varchar(18) COLLATE utf8mb4_general_ci  COMMENT '计划代码';
ALTER TABLE `bs_sgc_sz_yhjl` MODIFY COLUMN WAGA_CODE varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '水闸代码';
ALTER TABLE `bs_sgc_sz_yhjl` MODIFY COLUMN `PLAN_ID` varchar(18) COLLATE utf8mb4_general_ci  COMMENT '计划代码';

ALTER TABLE `bs_sgc_df_hdjh` ADD  `PLAN_TIME` datetime DEFAULT NULL COMMENT '计划时间';

ALTER TABLE `bs_sgc_df_xsjhjl` ADD  `DIKE_CODE` varchar(18) COLLATE utf8mb4_general_ci NOT NULL COMMENT '堤防代码';
ALTER TABLE `bs_sgc_df_xsjh` ADD  `DIKE_CODE` varchar(18) COLLATE utf8mb4_general_ci NOT NULL COMMENT '堤防代码';
ALTER TABLE `bs_sgc_df_hdjl` ADD  `DIKE_CODE` varchar(18) COLLATE utf8mb4_general_ci NOT NULL COMMENT '堤防代码';

ALTER TABLE `bs_sgc_df_xsjhjlz` ADD  `DOC` text COLLATE utf8mb4_general_ci COMMENT '文档';
ALTER TABLE `bs_sgc_sz_xsjhjlz` ADD  `DOC` text COLLATE utf8mb4_general_ci COMMENT '文档';

ALTER TABLE `bs_sgc_df_yhjl` ADD  `DIKE_CODE` varchar(18) COLLATE utf8mb4_general_ci NOT NULL COMMENT '堤防代码';
ALTER TABLE `bs_sgc_df_yhjl` ADD  `DOC` text COLLATE utf8mb4_general_ci COMMENT '文档';


ALTER TABLE `bs_sgc_sz_yhjl` ADD  `WAGA_CODE` varchar(18) COLLATE utf8mb4_general_ci NOT NULL COMMENT '水闸代码';
ALTER TABLE `bs_sgc_sz_yhjl` ADD  `DOC` text COLLATE utf8mb4_general_ci COMMENT '文档';

ALTER TABLE `bs_sgc_sz_xsjhjl` ADD   `WAGA_CODE` varchar(18) COLLATE utf8mb4_general_ci NOT NULL COMMENT '水闸代码';
ALTER TABLE `bs_sgc_sz_xsjh` ADD   `WAGA_CODE` varchar(18) COLLATE utf8mb4_general_ci NOT NULL 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_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_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 '文档',
  `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 '文档',
  `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='水闸水雨情检测表';



