SET NAMES utf8mb4;

CREATE TABLE `bs_sgc_st_mon` (
    `STCD` VARCHAR(18) COLLATE utf8mb4_general_ci COMMENT '测站编码',
    `MON_PROJ` VARCHAR(50) 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 '最近修改时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='水文水工程测站监测要素';

CREATE INDEX bs_sgc_st_mon_STCD_IDX USING BTREE ON bs_sgc_st_mon (STCD);


CREATE TABLE `att_res_code` (
    `ID` VARCHAR(30) COLLATE utf8mb4_general_ci COMMENT '主键',
    `RES_CODE` VARCHAR(18) COLLATE utf8mb4_general_ci COMMENT '水库编码',
    `STCD` VARCHAR(18) 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 `att_res_rfkwlv` (
    `ID` VARCHAR(30) COLLATE utf8mb4_general_ci COMMENT '主键',
    `RES_CODE` VARCHAR(18) COLLATE utf8mb4_general_ci COMMENT '水库编码',
    `ACTYR` VARCHAR(18) COLLATE utf8mb4_general_ci COMMENT '开启年份',
    `BGMD` VARCHAR(18) COLLATE utf8mb4_general_ci COMMENT '开启日期',
    `FSLTDZ` VARCHAR(18) COLLATE utf8mb4_general_ci COMMENT '汛限水位',
    `EDMD` VARCHAR(18) COLLATE utf8mb4_general_ci COMMENT '结束日期',
    `FLSTDW` VARCHAR(18) COLLATE utf8mb4_general_ci COMMENT '汛限制库容',
    `ENABLE_FLAG` VARCHAR(18) COLLATE utf8mb4_general_ci COMMENT '启用标识',
    `NOTE` 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_st_alarm` (
    `ID` VARCHAR(30) COLLATE utf8mb4_general_ci COMMENT '主键',
    `RES_NAME` VARCHAR(100) COLLATE utf8mb4_general_ci COMMENT '水库名称',
    `RES_CODE` VARCHAR(18) COLLATE utf8mb4_general_ci COMMENT '水库编码',
    `STNM` VARCHAR(100) COLLATE utf8mb4_general_ci COMMENT '测站名称',
    `STCD` VARCHAR(18) COLLATE utf8mb4_general_ci COMMENT '测站编码',
    `STTP` VARCHAR(20) COLLATE utf8mb4_general_ci COMMENT '测站类型',
    `ALARM_TYPE` VARCHAR(50) COLLATE utf8mb4_general_ci COMMENT '预警类型',
    `MONITOR_DATA` VARCHAR(255) COLLATE utf8mb4_general_ci COMMENT '监测数据',
    `ALARM_VALUE` VARCHAR(50) COLLATE utf8mb4_general_ci COMMENT '预警值',
    `ALARM_TIME` DATETIME COMMENT '预警时间',
    `ALARM_STATUS` VARCHAR(10) COLLATE utf8mb4_general_ci COMMENT '预警状态',
    `ALARM_DISPOSAL` VARCHAR(255) COLLATE utf8mb4_general_ci COMMENT '告警处置',
    `CREATE_UID` VARCHAR(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建者',
    `CREATE_TIME` DATETIME DEFAULT NULL COMMENT '创建时间',
    `UPDATE_UID` VARCHAR(64) 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_st_micfg` (
    `ID` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
    `RES_CODE` VARCHAR(18) COLLATE utf8mb4_general_ci COMMENT '水库编码',
    `RES_NAME` VARCHAR(255) COLLATE utf8mb4_general_ci COMMENT '水库名称',
    `MP_TYPE` VARCHAR(40) COLLATE utf8mb4_general_ci COMMENT '监测类型',
    `STCD` VARCHAR(18) COLLATE utf8mb4_general_ci COMMENT '测站编码',
    `WARN_TYPE` VARCHAR(40) COLLATE utf8mb4_general_ci COMMENT '预警类型',
    `WARN_VALUE` VARCHAR(40) COLLATE utf8mb4_general_ci COMMENT '预警值',
    `WARN_OPERATORS` TEXT COLLATE utf8mb4_general_ci COMMENT '预警通知人',
    `MSG_TYPE` VARCHAR(100) COLLATE utf8mb4_general_ci COMMENT '预警通知方式',
    `MSG_TEMPLATE` TEXT COLLATE utf8mb4_general_ci COMMENT '信息模板',
    `WARN_INTERVAL` VARCHAR(100) COLLATE utf8mb4_general_ci COMMENT '预警通知间隔',
    `WARN_TIME_UNIT` VARCHAR(10) COLLATE utf8mb4_general_ci COMMENT '预警时间单位',
    `CREATE_UID` VARCHAR(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建者',
    `CREATE_TIME` DATETIME DEFAULT NULL COMMENT '创建时间',
    `UPDATE_UID` VARCHAR(64) 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='监测配置信息';



