diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java index b13402e..ae36e3d 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java @@ -98,7 +98,8 @@ public class EmInfoController extends BladeController { if(stationListR.isSuccess() && CollectionUtil.isNotEmpty(stationListR.getData())) { List stationList = stationListR.getData(); pages.getRecords().forEach(emInfoEntity -> { - Optional stationOptional = stationList.stream().filter(station -> station.getRefDept().equals(emInfoEntity.getDepartment())).findAny(); + Optional stationOptional = stationList.stream() + .filter(station -> Func.isNotEmpty(station.getRefDept()) && station.getRefDept().equals(emInfoEntity.getDepartment())).findAny(); if(stationOptional.isPresent()) { StationEntity stationEntity = stationOptional.get(); emInfoEntity.setStationCode(stationEntity.getCode()); diff --git a/hzims-service/operational/src/main/resources/db/1.0.0.sql b/hzims-service/operational/src/main/resources/db/1.0.0.sql index ae33b30..9674a0a 100644 --- a/hzims-service/operational/src/main/resources/db/1.0.0.sql +++ b/hzims-service/operational/src/main/resources/db/1.0.0.sql @@ -7,46 +7,46 @@ ALTER TABLE `dev_hzims_operation`.`hy_st_alarm_record` MODIFY COLUMN `CREATE_TIM ALTER TABLE `dev_hzims_operation`.`hy_st_alarm_record` MODIFY COLUMN `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间' AFTER `CREATE_TIME`; CREATE TABLE `dev_hzims_operation`.`hz_ims_duty_analyse_example` ( - `ID` bigint(20) NOT NULL, - `SITE_ID` bigint(22) NULL DEFAULT NULL COMMENT '站点ID', - `SITE_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称', - `EQUIPMENT_ID` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备ID', - `EQUIPMENT_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备名称', - `DEVICE_CODE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分析实例ID', - `ANALYSE_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分析实例名称', - `PROPERTY_IDS` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '属性ID以^隔开', - `TENANT_ID` int(11) NULL DEFAULT NULL COMMENT '租户ID', - `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态(0 待值班 1 值班中 2 已完成)', - `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', - `IS_DELETED` tinyint(4) NULL DEFAULT 0 COMMENT '是否删除', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门ID', - PRIMARY KEY (`ID`) USING BTREE, - INDEX `CLASS_ID_INDEX`(`SITE_ID`) USING BTREE, - INDEX `EQUIPMENT_ID_INDEX`(`EQUIPMENT_ID`) USING BTREE + `ID` bigint(20) NOT NULL, + `SITE_ID` bigint(22) NULL DEFAULT NULL COMMENT '站点ID', + `SITE_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称', + `EQUIPMENT_ID` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备ID', + `EQUIPMENT_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备名称', + `DEVICE_CODE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分析实例ID', + `ANALYSE_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分析实例名称', + `PROPERTY_IDS` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '属性ID以^隔开', + `TENANT_ID` int(11) NULL DEFAULT NULL COMMENT '租户ID', + `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态(0 待值班 1 值班中 2 已完成)', + `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', + `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', + `IS_DELETED` tinyint(4) NULL DEFAULT 0 COMMENT '是否删除', + `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门ID', + PRIMARY KEY (`ID`) USING BTREE, + INDEX `CLASS_ID_INDEX`(`SITE_ID`) USING BTREE, + INDEX `EQUIPMENT_ID_INDEX`(`EQUIPMENT_ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; CREATE TABLE `dev_hzims_operation`.`hz_ims_duty_emergency` ( - `ID` bigint(20) NOT NULL COMMENT '突发事件登记表', - `DUTY_TIME` datetime(0) NOT NULL COMMENT '值班日期', - `DUTY_CLASS` bigint(20) NOT NULL COMMENT '班次', - `REGISTRANT` bigint(20) NOT NULL COMMENT '登记人', - `CHARGE_PERSON` bigint(20) NULL DEFAULT NULL COMMENT '值班长', - `REGISTER_TIME` datetime(0) NULL DEFAULT NULL COMMENT '登记时间', - `EVENT_TITLE` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '事件主题', - `EVENT_INFO` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '事件内容', - `EVENT_TYPE` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '事件方式', - `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态(1 未提交,2流程审核中,3已完成。)', - `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', - `IS_DELETED` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除', - `CREATE_DEPT` bigint(20) UNSIGNED NULL DEFAULT NULL, - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - PRIMARY KEY (`ID`) USING BTREE + `ID` bigint(20) NOT NULL COMMENT '突发事件登记表', + `DUTY_TIME` datetime(0) NOT NULL COMMENT '值班日期', + `DUTY_CLASS` bigint(20) NOT NULL COMMENT '班次', + `REGISTRANT` bigint(20) NOT NULL COMMENT '登记人', + `CHARGE_PERSON` bigint(20) NULL DEFAULT NULL COMMENT '值班长', + `REGISTER_TIME` datetime(0) NULL DEFAULT NULL COMMENT '登记时间', + `EVENT_TITLE` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '事件主题', + `EVENT_INFO` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '事件内容', + `EVENT_TYPE` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '事件方式', + `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态(1 未提交,2流程审核中,3已完成。)', + `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', + `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', + `IS_DELETED` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除', + `CREATE_DEPT` bigint(20) UNSIGNED NULL DEFAULT NULL, + `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', + PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; ALTER TABLE `dev_hzims_operation`.`hz_ims_duty_main` MODIFY COLUMN `DUTY_PERSON_IDS` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '值班人IDS, ID之间用^隔开' AFTER `CLASS_ID`; @@ -54,25 +54,25 @@ ALTER TABLE `dev_hzims_operation`.`hz_ims_duty_main` MODIFY COLUMN `DUTY_PERSON_ ALTER TABLE `dev_hzims_operation`.`hz_ims_duty_main` MODIFY COLUMN `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID' AFTER `REMARK`; CREATE TABLE `dev_hzims_operation`.`hz_ims_duty_main_person` ( - `ID` bigint(20) NOT NULL COMMENT '主键ID(排班计划-人员表)', - `DUTY_MAIN_ID` bigint(20) NULL DEFAULT NULL COMMENT '值班-班组表ID', - `DUTY_GROUP_ID` bigint(20) NULL DEFAULT NULL COMMENT '值班组id(灵活排版无ID)', - `DUTY_GROUP_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '值班班组名称', - `DUTY_DATE` date NOT NULL COMMENT '值班日期', - `CLASS_ID` bigint(20) NOT NULL COMMENT '班次ID', - `DUTY_PERSON` bigint(20) NULL DEFAULT NULL COMMENT '值班人ID(一个值班人对应一条)', - `DUTY_CHARGE_PERSON` bigint(20) NULL DEFAULT NULL COMMENT '值班负责人', - `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态(0 待值班 1 值班中 2 已完成)', - `REMARK` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', - `IS_DELETED` tinyint(4) NULL DEFAULT 0 COMMENT '是否删除', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门ID', - PRIMARY KEY (`ID`) USING BTREE, - INDEX `index_person`(`DUTY_PERSON`) USING BTREE + `ID` bigint(20) NOT NULL COMMENT '主键ID(排班计划-人员表)', + `DUTY_MAIN_ID` bigint(20) NULL DEFAULT NULL COMMENT '值班-班组表ID', + `DUTY_GROUP_ID` bigint(20) NULL DEFAULT NULL COMMENT '值班组id(灵活排版无ID)', + `DUTY_GROUP_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '值班班组名称', + `DUTY_DATE` date NOT NULL COMMENT '值班日期', + `CLASS_ID` bigint(20) NOT NULL COMMENT '班次ID', + `DUTY_PERSON` bigint(20) NULL DEFAULT NULL COMMENT '值班人ID(一个值班人对应一条)', + `DUTY_CHARGE_PERSON` bigint(20) NULL DEFAULT NULL COMMENT '值班负责人', + `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态(0 待值班 1 值班中 2 已完成)', + `REMARK` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注', + `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', + `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', + `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', + `IS_DELETED` tinyint(4) NULL DEFAULT 0 COMMENT '是否删除', + `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门ID', + PRIMARY KEY (`ID`) USING BTREE, + INDEX `index_person`(`DUTY_PERSON`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; ALTER TABLE `dev_hzims_operation`.`hz_ims_duty_main_template` ADD COLUMN `TYPE` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1 班组,2灵活排班' AFTER `TEMPLATE_NAME`; @@ -92,21 +92,21 @@ ALTER TABLE `dev_hzims_operation`.`hzims_alarm_handle_detail` ADD COLUMN `HANDLE ALTER TABLE `dev_hzims_operation`.`hzims_app_version` MODIFY COLUMN `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间' AFTER `IS_DELETED`; CREATE TABLE `dev_hzims_operation`.`hzims_fill_generate` ( - `ID` bigint(20) NOT NULL COMMENT '主键ID', - `STATION_CODE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点编号', - `STATION_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称', - `DATA_ORIGIN` varchar(4) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点数据类型: 0 - 接入站点 1 - 未接入站点', - `FILL_DATE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '填报日期', - `GENERATE` decimal(15, 2) NULL DEFAULT NULL COMMENT '发电量', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', - `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', - `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态 0-启用 1-停用', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', - PRIMARY KEY (`ID`) USING BTREE + `ID` bigint(20) NOT NULL COMMENT '主键ID', + `STATION_CODE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点编号', + `STATION_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称', + `DATA_ORIGIN` varchar(4) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点数据类型: 0 - 接入站点 1 - 未接入站点', + `FILL_DATE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '填报日期', + `GENERATE` decimal(15, 2) NULL DEFAULT NULL COMMENT '发电量', + `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', + `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', + `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', + `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', + `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态 0-启用 1-停用', + `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; ALTER TABLE `dev_hzims_operation`.`hzims_fill_over` MODIFY COLUMN `ENCL_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件名称' AFTER `ENCL_PATH`; @@ -118,55 +118,55 @@ ALTER TABLE `dev_hzims_operation`.`hzims_fill_over_config` ADD UNIQUE INDEX `OVE ALTER TABLE `dev_hzims_operation`.`hzims_fill_power` MODIFY COLUMN `POWER_MON` double(20, 2) NULL DEFAULT 0.00 COMMENT '月发电量' AFTER `PLANNED_POWER_MON`; CREATE TABLE `dev_hzims_operation`.`hzims_fill_rainfall` ( - `ID` bigint(20) NOT NULL COMMENT '主键ID', - `STATION_CODE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点编号', - `STATION_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称', - `RAIN` decimal(15, 2) NULL DEFAULT NULL COMMENT '降雨量', - `FILL_DATE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '填报日期', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', - `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', - `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态 0-启用 1-停用', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', - PRIMARY KEY (`ID`) USING BTREE + `ID` bigint(20) NOT NULL COMMENT '主键ID', + `STATION_CODE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点编号', + `STATION_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称', + `RAIN` decimal(15, 2) NULL DEFAULT NULL COMMENT '降雨量', + `FILL_DATE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '填报日期', + `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', + `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', + `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', + `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', + `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态 0-启用 1-停用', + `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; CREATE TABLE `dev_hzims_operation`.`hzims_fill_storage` ( - `ID` bigint(20) NOT NULL COMMENT '主键ID', - `STATION_CODE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点编号', - `STATION_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称', - `POWER` decimal(15, 2) NULL DEFAULT NULL COMMENT '发电量', - `FILL_DATE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '填报日期', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', - `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', - `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态 0-启用 1-停用', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', - PRIMARY KEY (`ID`) USING BTREE + `ID` bigint(20) NOT NULL COMMENT '主键ID', + `STATION_CODE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点编号', + `STATION_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称', + `POWER` decimal(15, 2) NULL DEFAULT NULL COMMENT '发电量', + `FILL_DATE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '填报日期', + `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', + `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', + `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', + `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', + `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态 0-启用 1-停用', + `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; CREATE TABLE `dev_hzims_operation`.`hzims_fill_use` ( - `ID` bigint(20) NOT NULL COMMENT '主键ID', - `STATION_CODE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点编号', - `STATION_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称', - `DATA_ORIGIN` varchar(4) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点数据类型: 0 - 接入站点 1 - 未接入站点', - `FILL_DATE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '填报日期', - `EMPLOY` decimal(15, 2) NULL DEFAULT NULL COMMENT '发电量', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', - `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', - `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态 0-启用 1-停用', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', - PRIMARY KEY (`ID`) USING BTREE + `ID` bigint(20) NOT NULL COMMENT '主键ID', + `STATION_CODE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点编号', + `STATION_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称', + `DATA_ORIGIN` varchar(4) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点数据类型: 0 - 接入站点 1 - 未接入站点', + `FILL_DATE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '填报日期', + `EMPLOY` decimal(15, 2) NULL DEFAULT NULL COMMENT '发电量', + `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', + `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', + `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', + `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', + `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态 0-启用 1-停用', + `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; ALTER TABLE `dev_hzims_operation`.`hzims_history_abnormal_alarm` ADD COLUMN `ALARM_ID` bigint(20) NULL DEFAULT NULL COMMENT '告警编号' AFTER `STATION_NAME`; @@ -188,25 +188,25 @@ ALTER TABLE `dev_hzims_operation`.`hzims_history_abnormal_alarm` MODIFY COLUMN ` ALTER TABLE `dev_hzims_operation`.`hzims_history_abnormal_alarm` MODIFY COLUMN `IS_DELETED` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除' AFTER `UPDATE_TIME`; CREATE TABLE `dev_hzims_operation`.`hzims_history_level_alarm` ( - `ID` bigint(20) NOT NULL COMMENT '主键ID', - `STATION_ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点ID', - `STATION_NAME` varchar(168) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称', - `DEVICE_CODE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备编码', - `DEVICE_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备名称', - `ALARM_LEVEL` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '告警等级', - `ALARM_ID` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '告警编号', - `REAL_ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '告警点位', - `ALARM_TIME` datetime(0) NULL DEFAULT NULL COMMENT '告警开始时间', - `TYPE` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '告警类型 13-连接中断 14-数据异常', - `SOE_EXPLAIN` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '告警标题', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '业务状态', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `IS_DELETED` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除', + `ID` bigint(20) NOT NULL COMMENT '主键ID', + `STATION_ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点ID', + `STATION_NAME` varchar(168) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称', + `DEVICE_CODE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备编码', + `DEVICE_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备名称', + `ALARM_LEVEL` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '告警等级', + `ALARM_ID` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '告警编号', + `REAL_ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '告警点位', + `ALARM_TIME` datetime(0) NULL DEFAULT NULL COMMENT '告警开始时间', + `TYPE` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '告警类型 13-连接中断 14-数据异常', + `SOE_EXPLAIN` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '告警标题', + `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', + `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '业务状态', + `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位', + `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', + `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', + `IS_DELETED` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除', PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; @@ -272,55 +272,21 @@ ALTER TABLE `dev_hzims_operation`.`hzims_oper_phenomenon` MODIFY COLUMN `HANDLER ALTER TABLE `dev_hzims_operation`.`hzims_oper_phenomenon` MODIFY COLUMN `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人' AFTER `UPDATE_TIME`; -CREATE TABLE `dev_hzims_operation`.`hzims_oper_repair` ( - `ID` bigint(20) NOT NULL COMMENT '主键ID', - `EM_CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备code', - `NUMBER` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编号', - `COMPANY` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单位', - `HANDLE_STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '处理状态', - `CHARGE` bigint(20) NULL DEFAULT NULL COMMENT '应急抢修负责人', - `REPAIR_TEAM` bigint(20) NULL DEFAULT NULL COMMENT '应急抢修班组', - `REPAIR_PERSONNEL` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '应急抢修人员', - `REPAIR_TASK` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '应急抢修任务描述', - `ORIGINATOR` bigint(20) NULL DEFAULT NULL COMMENT '应急抢修发起人', - `SAFETY_MEASURES` varchar(2080) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '安全措施', - `POINTS_ATTENTION` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '注意事项', - `LICENSOR` bigint(20) NULL DEFAULT NULL COMMENT '许可人', - `LICENSOR_TIME` datetime(0) NULL DEFAULT NULL COMMENT '许可时间', - `LICENSOR_MEASURES` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '许可建议安全措施', - `LICENSOR_MEMO` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '抢修完成许可描述', - `LICENSOR_COMPLETE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '抢修完成许可时间', - `IMPLEMENT_HOURS` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '抢修工时', - `IMPLEMENT_START_TIME` datetime(0) NULL DEFAULT NULL COMMENT '抢修开始时间', - `IMPLEMENT_END_TIME` datetime(0) NULL DEFAULT NULL COMMENT '抢修结束时间', - `IMPLEMENT_DESC` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '抢修描述', - `PROCESS_INSTANCE_ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程实例ID', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', - `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', - `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态 ', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - CREATE TABLE `dev_hzims_operation`.`hzims_review_standard` ( - `id` bigint(20) NOT NULL COMMENT '主键ID', - `review_id` bigint(20) NOT NULL COMMENT '评审ID', - `standard_id` tinyint(4) NOT NULL COMMENT '标准ID', - `standard_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标准名称', - `score` tinyint(4) NULL DEFAULT NULL COMMENT '分数', - `status` tinyint(4) NULL DEFAULT NULL COMMENT '业务状态', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `IS_DELETED` tinyint(4) NULL DEFAULT NULL, - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE + `id` bigint(20) NOT NULL COMMENT '主键ID', + `review_id` bigint(20) NOT NULL COMMENT '评审ID', + `standard_id` tinyint(4) NOT NULL COMMENT '标准ID', + `standard_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标准名称', + `score` tinyint(4) NULL DEFAULT NULL COMMENT '分数', + `status` tinyint(4) NULL DEFAULT NULL COMMENT '业务状态', + `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位', + `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', + `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', + `IS_DELETED` tinyint(4) NULL DEFAULT NULL, + `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; ALTER TABLE `dev_hzims_operation`.`hzims_station` ADD COLUMN `SEND_MESSAGE_FLAG` tinyint(4) NULL DEFAULT NULL COMMENT '0-不推送告警短信 1-推送告警短信' AFTER `CONTACTOR`; @@ -349,38 +315,6 @@ ALTER TABLE `dev_hzims_operation`.`hzims_station_attribute` ADD COLUMN `SIGNAGE_ ALTER TABLE `dev_hzims_operation`.`hzims_station_attribute` MODIFY COLUMN `GROUP_ID` tinyint(4) NULL DEFAULT NULL COMMENT '属性分组ID' AFTER `EM_NAME`; -CREATE TABLE `dev_hzims_operation`.`hzims_station_bak1115` ( - `ID` bigint(20) NOT NULL COMMENT '主键', - `REF_DOMAIN` smallint(6) NULL DEFAULT NULL COMMENT '所属行业(来源于字典表如水电)', - `REF_BASIN` smallint(6) NULL DEFAULT NULL COMMENT '所属流域(来源于字典表如长江流域)', - `REF_AREA` smallint(6) NULL DEFAULT NULL COMMENT '所属区域(来源于字典表如华北区)', - `AREA_CODE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '行政区划(来源于平台的行政区划表)', - `REF_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '所属机构', - `CODE` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编号(原站点ID)', - `NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称', - `SERVE_TYPE` bigint(4) NULL DEFAULT 1 COMMENT '站点服务类型:1、云服务; 2、运维服务', - `COMMISSION_TIME` datetime(0) NULL DEFAULT NULL COMMENT '投运时间,用于计算安全运行天数', - `PIC` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点图片,用于展示', - `TYPE` smallint(6) NULL DEFAULT NULL COMMENT '类型(1电站2泵站3水厂)', - `LGTD` decimal(13, 10) NULL DEFAULT NULL COMMENT '经度(东经)', - `LTTD` decimal(12, 10) NULL DEFAULT NULL COMMENT '纬度(北纬)', - `ENABLE_CONTROL` tinyint(4) NULL DEFAULT NULL COMMENT '允许监控,1时为允许,其它为不允许', - `REMARK` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', - `CONTACT` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '联系方式', - `ADDRESS` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '详细地址', - `COMPANY` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '公司名字', - `CONTACTOR` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '联系人', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', - `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', - `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态 ', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '站点表' ROW_FORMAT = Dynamic; - ALTER TABLE `dev_hzims_operation`.`hzims_station_user` COMMENT = '站点-用户关系绑定表'; ALTER TABLE `dev_hzims_operation`.`hzims_station_user` MODIFY COLUMN `ID` bigint(20) NOT NULL COMMENT '主键' FIRST; @@ -399,539 +333,27 @@ ALTER TABLE `dev_hzims_operation`.`hzims_station_video_type` ADD COLUMN `STATION ALTER TABLE `dev_hzims_operation`.`hzims_station_video_type` MODIFY COLUMN `video_type` tinyint(4) NULL DEFAULT NULL COMMENT '视频类型;默认为1:清污机类型' AFTER `SORT`; -CREATE TABLE `dev_hzims_operation`.`hzims_station_video_type_bak0302` ( - `ID` bigint(20) NOT NULL COMMENT '主键ID', - `NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '视频源名称', - `STATION_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点ID', - `DEPT_ID` bigint(20) NULL DEFAULT NULL COMMENT '机构ID', - `IS_HIKVIDEO` tinyint(4) NULL DEFAULT NULL COMMENT '是否平台接入 1=是 0=否(关联hznet.hznet`.`sys_station_video_set;isc为平台接入)', - `ADDRESS` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '地址', - `TYPE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型', - `LIVE_SOURCE_ADDRESS` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据源地址', - `POINT_CODE` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '视频源编码', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', - `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', - `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态 ', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', - `VIDEO_HOST` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '代理API网关nginx服务器ip端口', - `APP_KEY` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '秘钥appkey', - `APP_SECRET` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '秘钥appSecret', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `dev_hzims_operation`.`hzims_station_video_type_copy1` ( - `ID` bigint(20) NOT NULL COMMENT '主键ID', - `NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '视频源名称', - `STATION_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点ID', - `DEPT_ID` bigint(20) NULL DEFAULT NULL COMMENT '机构ID', - `IS_HIKVIDEO` tinyint(4) NULL DEFAULT NULL COMMENT '是否平台接入 1=是 0=否(关联hznet.hznet`.`sys_station_video_set;isc为平台接入)', - `ADDRESS` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '地址', - `TYPE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型', - `LIVE_SOURCE_ADDRESS` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据源地址', - `POINT_CODE` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '视频源编码', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', - `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', - `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态 ', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', - `VIDEO_HOST` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '代理API网关nginx服务器ip端口', - `APP_KEY` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '秘钥appkey', - `APP_SECRET` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '秘钥appSecret', - `SORT` smallint(6) NULL DEFAULT 999 COMMENT '排序', - `video_type` tinyint(4) NULL DEFAULT NULL COMMENT '视频类型;默认为1:清污机类型', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - ALTER TABLE `dev_hzims_operation`.`hzims_unit_running_time` MODIFY COLUMN `DATE_TIME` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '年月' AFTER `EM_CODE`; CREATE TABLE `dev_hzims_operation`.`hzims_user_feedback` ( - `ID` bigint(20) NOT NULL COMMENT '主键', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `PHONE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '联系电话', - `CONTENT` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '反馈内容', - `FILE_NAME` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件名称', - `FILE_URL` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件地址', - `REPLY_CONTENT` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '回复内容', - `REPLY_USER` bigint(20) NULL DEFAULT NULL COMMENT '回复人', - `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态 ', - `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', - `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', - PRIMARY KEY (`ID`) USING BTREE + `ID` bigint(20) NOT NULL COMMENT '主键', + `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', + `PHONE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '联系电话', + `CONTENT` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '反馈内容', + `FILE_NAME` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件名称', + `FILE_URL` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件地址', + `REPLY_CONTENT` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '回复内容', + `REPLY_USER` bigint(20) NULL DEFAULT NULL COMMENT '回复人', + `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态 ', + `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', + `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', + `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', + `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', + PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户反馈表' ROW_FORMAT = Dynamic; -CREATE TABLE `dev_hzims_operation`.`temp` ( - `db_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, - `tablename` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, - `LieName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `dev_hzims_operation`.`temp_dept_sync` ( - `id` bigint(20) NOT NULL, - `old_dept_id` bigint(20) NULL DEFAULT NULL COMMENT '旧机构ID', - `new_dept_id` bigint(20) NULL DEFAULT NULL COMMENT '新机构ID', - `is_sync` tinyint(255) NULL DEFAULT NULL COMMENT '是否同步', - `dept_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机构名称', - `execute_time` datetime(0) NULL DEFAULT NULL COMMENT '执行时间', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `IS_DELETED` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '机构同步表' ROW_FORMAT = Dynamic; - -CREATE TABLE `dev_hzims_operation`.`temp_sync_info` ( - `sync_id` bigint(20) NOT NULL COMMENT '同步ID', - `db_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据库', - `table_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '表', - `column_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '列', - `be_replaced` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '被替换值', - `replaced` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '替换值', - `replaced_sql` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '替换sql', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '执行时间', - `bak_replaced_sql` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '还原sql', - `status` tinyint(4) NULL DEFAULT NULL COMMENT '执行状态' -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `dev_hzims_operation`.`wt_sp_allocation` ( - `ID` bigint(20) NOT NULL COMMENT '主键', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID', - `CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单据号', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `STATUS` int(11) NULL DEFAULT NULL COMMENT '流程状态', - `RPOC_INS_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流实例ID', - `IN_WAREHOUSE_ID` bigint(20) NULL DEFAULT NULL COMMENT '入库仓库', - `OUT_WAREHOUSE_ID` bigint(20) NULL DEFAULT NULL COMMENT '出库仓库', - `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注', - `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `dev_hzims_operation`.`wt_sp_basic` ( - `ID` bigint(20) NOT NULL COMMENT '主键', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID', - `MANAGEMENT_ID` bigint(20) NULL DEFAULT NULL COMMENT '分类ID', - `NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称', - `CODE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编码', - `SPECIFICATIONS` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '规格', - `BRAND` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '品牌', - `UNIT` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单位', - `WEIGHT` decimal(10, 2) NULL DEFAULT NULL COMMENT '重量', - `PRICE` decimal(10, 2) NULL DEFAULT NULL COMMENT '单价', - `UPPER_LIMIT` int(10) NULL DEFAULT NULL COMMENT '库存上限', - `LOWER_LIMIT` int(10) NULL DEFAULT NULL COMMENT '库存下限', - `IS_WASTE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否回收废品', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态', - `PARAMETER` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '主要参数', - `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注', - `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)', - `CODE_NUMBER` bigint(20) NULL DEFAULT NULL COMMENT '序列号', - `WATER_PLANT_ID` bigint(16) NULL DEFAULT NULL COMMENT '水厂ID', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `dev_hzims_operation`.`wt_sp_management` ( - `ID` bigint(20) NOT NULL COMMENT '主键', - `tenant_id` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID', - `NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分类名称', - `PARENT_ID` bigint(20) NULL DEFAULT NULL COMMENT '所属父级', - `ANCESTORS` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '祖级节点', - `CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分类编码', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态', - `TYPE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备品备件:1,工具:2', - `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注', - `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)', - `CODE_NUMBER` bigint(20) NULL DEFAULT NULL COMMENT '序列号', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `dev_hzims_operation`.`wt_sp_provider` ( - `ID` bigint(20) NOT NULL COMMENT '主键ID', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID', - `ORGANIZATION_ID` bigint(20) NULL DEFAULT NULL COMMENT '机构ID', - `ORGANIZATION_CODE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '机构编码', - `SCOPE_OF_SUPPLY` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '供货范围', - `SUPPLY_CYCLE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '供货周期', - `NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称', - `LOGOGRAM` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称缩写', - `SALESMAN` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '业务联系人', - `LEGAL_PERSON` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '法人代表', - `PHONE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '电话', - `MOBILE_PHONE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机', - `WEBSITE` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '网址', - `ADDRESS` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '地址', - `QUALIFIED_FLAG` int(11) NULL DEFAULT 1 COMMENT '是否合格(0:否,1:是)', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `STATUS` int(2) NULL DEFAULT NULL COMMENT '业务状态', - `REMARK` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注', - `IS_DELETED` int(2) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `dev_hzims_operation`.`wt_sp_receive` ( - `ID` bigint(20) NOT NULL COMMENT '主键', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID', - `CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单据号', - `TICKET_CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工单ID', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `STATUS` int(11) NULL DEFAULT NULL COMMENT '流程状态', - `RPOC_INS_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流实例ID', - `STORAGE_ROOM` bigint(20) NULL DEFAULT NULL COMMENT '仓库库房', - `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注', - `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `dev_hzims_operation`.`wt_sp_receives` ( - `ID` bigint(20) NOT NULL COMMENT '主键', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID', - `CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单据号', - `TICKET_CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工单ID', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `STATUS` int(11) NULL DEFAULT NULL COMMENT '流程状态', - `RPOC_INS_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流实例ID', - `STORAGE_ROOM` bigint(20) NULL DEFAULT NULL COMMENT '仓库库房', - `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注', - `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)', - `VECEIVE_ID` bigint(20) NULL DEFAULT NULL COMMENT '工具领用单ID', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `dev_hzims_operation`.`wt_sp_record` ( - `ID` bigint(20) NOT NULL COMMENT '主键', - `BUSINESS_ID` bigint(20) NULL DEFAULT NULL COMMENT '业务表ID', - `AMOUNT` int(11) NULL DEFAULT NULL COMMENT '数量AMOUNT', - `SP_BASIC_ID` bigint(20) NULL DEFAULT NULL COMMENT '备品备件ID', - `WAREHOUSE_ID` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库', - `TYPE` int(11) NULL DEFAULT NULL COMMENT '类型1:入库,2:出库,3:调拨,4:领用', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `STATUS` int(2) NULL DEFAULT NULL COMMENT '业务状态', - `IS_DELETED` int(2) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `dev_hzims_operation`.`wt_sp_revert` ( - `ID` bigint(20) NOT NULL COMMENT '主键', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID', - `CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单据号', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `STATUS` int(11) NULL DEFAULT NULL COMMENT '流程状态', - `RPOC_INS_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流实例ID', - `STORAGE_ROOM` bigint(20) NULL DEFAULT NULL COMMENT '仓库库房', - `AMOUNT` int(11) NULL DEFAULT NULL COMMENT '数量', - `SP_BASIC_ID` bigint(20) NULL DEFAULT NULL COMMENT '对应备件ID', - `NAME` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备品备件名称', - `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注', - `CURRENT_OPERATOR` bigint(20) NULL DEFAULT NULL COMMENT '当前处理人', - `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `dev_hzims_operation`.`wt_sp_ticket_relation` ( - `ID` bigint(20) NOT NULL COMMENT '主键', - `ORDER_ID` bigint(20) NULL DEFAULT NULL COMMENT '出库单ID', - `AMOUNT` int(11) NULL DEFAULT NULL COMMENT '数量', - `TICKET` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工单号', - `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注', - `SP_BASIC_ID` bigint(20) NULL DEFAULT NULL COMMENT '备件ID', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `STATUS` int(2) NULL DEFAULT NULL COMMENT '业务状态', - `IS_DELETED` int(2) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `dev_hzims_operation`.`wt_sp_tool_basic` ( - `ID` bigint(20) NOT NULL COMMENT '主键ID', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID', - `SP_BASIC_ID` bigint(20) NULL DEFAULT NULL COMMENT '对应备件ID', - `QUALITY_GUARANTEE_PERIOD` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保质期', - `PRODUCTION_PERIOD` datetime(0) NULL DEFAULT NULL COMMENT '生产日期', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '领用时间', - `CREATE_USER` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '领用人', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `ATACHMENT_ID` bigint(20) NULL DEFAULT NULL COMMENT '类型(文件类型)', - `QUANTITY_RECEIVED` bigint(20) NULL DEFAULT NULL COMMENT '领用数量', - `STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态', - `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)', - `WAREHOUSE_ID` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `dev_hzims_operation`.`wt_sp_total` ( - `ID` bigint(20) NOT NULL COMMENT '主键ID', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID', - `SP_BASIC_ID` bigint(20) NULL DEFAULT NULL COMMENT '对应备件ID', - `MIN_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '最低储备量', - `MAX_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '最高储备量', - `STOCK` bigint(20) NULL DEFAULT NULL COMMENT '库存', - `IN_PRICE` decimal(12, 2) NULL DEFAULT NULL COMMENT '最新入库单价', - `OUT_PRICE` decimal(12, 2) NULL DEFAULT NULL COMMENT '最新出库单价', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态', - `OUT_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '出库暂存', - `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)', - `WARNING_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '警戒百分比', - `WAREHOUSE_ID` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库ID', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `dev_hzims_operation`.`wt_sp_type_dictionaries` ( - `ID` bigint(20) NOT NULL COMMENT '主键', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID', - `NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分类名称', - `CODE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编码', - `P_CODE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '上级编码', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态', - `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `dev_hzims_operation`.`wt_sp_warehouse` ( - `ID` bigint(20) NOT NULL COMMENT '主键ID', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID', - `ADDRESS` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '地址', - `CODE` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编码', - `NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称', - `MANAGER` bigint(20) NULL DEFAULT NULL COMMENT '负责人', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态', - `STOCK` bigint(20) NULL DEFAULT NULL COMMENT '当前存量', - `MAX_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '库存上限', - `MIN_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '库存下限', - `WARNING_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '警戒百分比', - `REMARK` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注', - `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)', - `AFFILIATED_UNIT` bigint(20) NULL DEFAULT NULL COMMENT '所属单位', - `AFFILIATED_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '所属单位名称', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `dev_hzims_operation`.`wt_sp_warehouse_in` ( - `ID` bigint(20) NOT NULL COMMENT '主键', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID', - `CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单据号', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `TYPE` bigint(20) NULL DEFAULT NULL COMMENT '入库类型', - `STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态', - `RPOC_INS_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流实例ID', - `STORAGE_ROOM` bigint(20) NULL DEFAULT NULL COMMENT '仓库库房', - `CURRENT_OPERATOR` bigint(20) NULL DEFAULT NULL COMMENT '当前处理人', - `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注', - `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)', - `TICKET_CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工单编号', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `dev_hzims_operation`.`wt_sp_warehouse_in_record` ( - `ID` bigint(20) NOT NULL COMMENT '主键', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID', - `CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '出入库编号', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态', - `TITLE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标题', - `STORAGE_ROOM` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '仓库库房', - `TYPE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型,用枚举来判断是工具还是备品备件', - `OPERATION` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作:用枚举来判断是出库还是入库', - `AMOUNT` int(11) NULL DEFAULT NULL COMMENT '数量', - `SP_BASIC_ID` bigint(20) NULL DEFAULT NULL COMMENT '备品备件ID', - `NAME` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备品备件名称', - `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注', - `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `dev_hzims_operation`.`wt_sp_warehouse_out` ( - `ID` bigint(20) NOT NULL COMMENT '主键', - `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID', - `CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单据号', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `STATUS` int(11) NULL DEFAULT NULL COMMENT '流程状态', - `RPOC_INS_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流实例ID', - `STORAGE_ROOM` bigint(20) NULL DEFAULT NULL COMMENT '仓库库房', - `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注', - `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)', - `TYPE` bigint(20) NULL DEFAULT NULL COMMENT '出库类型', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE DEFINER = `root`@`%` PROCEDURE `dev_hzims_operation`.`getDataByDbName`(in dbName varchar(100),in tbName VARCHAR(255),IN ziduan VARCHAR(255)) -BEGIN - DECLARE num INT DEFAULT 0; - DECLARE str VARCHAR(50); - -- 定义循环条件 - DECLARE flag INT DEFAULT 0; - -- SET @selectSql =CONCAT('SELECT COUNT(1) from sys_station where stationpic like ''%12345%'' ;'); - -- SET @STMT =CONCAT('SELECT COUNT(1) FROM ',tbName,'where ',ziduan,' LIKE ''%12345%'' INTO @num;'); - -- 声明游标,取机构id - DECLARE cur CURSOR FOR select distinct id from dev_bladex.blade_dept where is_deleted=0; --- 退出循环 -DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET flag = 1; -delete from temp where db_name = dbName and tablename = tbName and LieName = ziduan; -OPEN cur; -outer_label: BEGIN #设置一个标记 - WHILE flag <> 1 DO - FETCH cur INTO str; - SET @selectSql =CONCAT('SELECT COUNT(1) FROM ',dbName,'.`',tbName,'` where ',ziduan,' LIKE ''%',str,'%'' INTO @num;'); - -- SET @selectSql =CONCAT('SELECT COUNT(1) FROM sys_station',' WHERE stationpic ',' LIKE ''%12345%'' INTO @num;'); -PREPARE stmt FROM @selectSql; -EXECUTE stmt; -IF @num>0 THEN - -- insert into temp_sql values (dbName,@selectSql); - INSERT INTO temp VALUES (dbName,tbName,ziduan); - LEAVE outer_label; #满足条件,终止循环,跳转到end outer_label标记 -END IF; -END WHILE; -END outer_label; -CLOSE cur; -END; - -CREATE DEFINER = `root`@`%` PROCEDURE `dev_hzims_operation`.`pDeptSync`() -BEGIN -DECLARE done BOOLEAN DEFAULT 0; -DECLARE syncId BIGINT; -DECLARE oldDeptId BIGINT; -DECLARE newDeptId BIGINT; -DECLARE sync_cursor CURSOR FOR -SELECT id,old_dept_id,new_dept_id FROM temp_dept_sync WHERE is_sync <> 1 order by create_time desc; -DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' set done = 1; -OPEN sync_cursor; -repeat -FETCH sync_cursor INTO syncId,oldDeptId,newDeptId; --- 执行业务数据迁移 -call pSyncProcess(syncId,oldDeptId,newDeptId); --- 更新同步状态 -update blade_dept_sync set is_sync = 1,execute_time = NOW() where id = syncId; --- 迁移站点ID -update dev_bladex.blade_dept set station_id = (select station_id from dev_bladex.blade_dept where id = oldDeptId) where id = newDeptId; --- 删除原始机构ID -update dev_bladex.blade_dept set is_deleted = 1 where id = oldDeptId; -UNTIL done END repeat; -CLOSE sync_cursor; -end; - -CREATE DEFINER = `root`@`%` PROCEDURE `dev_hzims_operation`.`processquanjusou`(in dbName VARCHAR(255)) -BEGIN -DECLARE done BOOLEAN DEFAULT 0; -DECLARE biao VARCHAR (255); -DECLARE ziduan VARCHAR (255); -DECLARE indexss CURSOR -FOR -SELECT TABLE_NAME,COLUMN_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA=dbName - and length(table_name) = char_length(table_name) and column_name <>'constraint' - and TABLE_NAME not like '%blade_log%' and TABLE_NAME not like '%copy%' and TABLE_NAME not like '%bak%' and TABLE_NAME not like '%temp%' - and COLUMN_NAME != 'REQ_BODY'; -DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done=1; -OPEN indexss; -repeat -FETCH indexss INTO biao,ziduan; -call getDataByDbName(dbName,biao,ziduan); -UNTIL done END repeat; -CLOSE indexss; -end; - -CREATE DEFINER = `root`@`%` PROCEDURE `dev_hzims_operation`.`pSyncProcess`(in syncId BIGINT,in beReplaced BIGINT,in replaced BIGINT) - COMMENT '执行此方法前需检查所有数据库的dept column 是否已存入temp表中 若有遗漏需调用processquanjusou补全column' -BEGIN - DECLARE db_name_var VARCHAR(255); - DECLARE table_name VARCHAR(255); - DECLARE lie_name VARCHAR(255); - DECLARE original VARCHAR(255); - -- 定义循环条件 - DECLARE flag INT DEFAULT 0; - -- 声明游标,取机构id - DECLARE cur CURSOR FOR select `db_name`,`tablename`,`lieName` from dev_bladex.temp where tablename not like '%log%' and tablename not like '%copy%' and tablename not like '%bak%' and tablename not like 'v_%' and tablename not like '%temp%' and tablename <> 'blade_dept'; --- 退出循环 -DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET flag = 1; - -- delete from dev_bladex.temp_replace_info; -OPEN cur; -WHILE flag <> 1 DO - FETCH cur INTO db_name_var,table_name,lie_name; - -- 保存变换参数 - SET @updateSql = concat('update ',db_name_var,'.`',table_name,'` set ',lie_name,' = replace(',lie_name,',',beReplaced,',',replaced,') where ',lie_name,' like ''%',beReplaced,'%'''); - SET @bakUpdateSql = concat('update ',db_name_var,'.`',table_name,'` set ',lie_name,' = replace(',lie_name,',',replaced,',',beReplaced,') where ',lie_name,' like ''%',replaced,'%'''); -insert into dev_bladex.temp_sync_info VALUES (syncId,db_name_var,table_name,lie_name,'','',@updateSql,NOW(), @bakUpdateSql,0); -PREPARE stmt FROM @updateSql; -EXECUTE stmt; -update dev_bladex.temp_sync_info set status = 1 where db_name = db_name_var and table_name = table_name and lie_name = lie_name and sync_id = syncId; -END WHILE; -CLOSE cur; -END; - DROP TABLE `dev_hzims_operation`.`hzims_main_work_bench_copy1`; DROP TABLE `dev_hzims_operation`.`hzims_station_attribute_copy1`; @@ -944,4 +366,14 @@ DROP TABLE `dev_hzims_operation`.`hzims_station_video_type_bak0907`; DROP TABLE `dev_hzims_operation`.`temp_hik_point`; -SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file +SET FOREIGN_KEY_CHECKS=1; + +-- 字典 +INSERT INTO `dev_bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1645274950860365825, 0, 'data_origin', '-1', '数据来源类型', 10, '', 0, 0, 0, -1, 'operational'); +INSERT INTO `dev_bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1645275156549033986, 1645274950860365825, 'data_origin', '0', '数据采集', 0, '', 0, 0, 0, -1, 'operational'); +INSERT INTO `dev_bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1645275327714385922, 1645274950860365825, 'data_origin', '1', '数据填报', 1, '', 0, 0, 0, -1, 'operational'); + +INSERT INTO `dev_bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1630129576353242344, 1630129576354127875, 'project_kind', '4S', 'HZ3000 v4.0.0.6以上', 3, NULL, 0, 0, 0, -1, 'hzinfo-data-config'); +INSERT INTO `dev_bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1630129576354126893, 1630129576354127875, 'project_kind', '4', 'HZ3000 v4.0.0.6以下', 2, NULL, 0, 0, 0, -1, 'hzinfo-data-config'); +INSERT INTO `dev_bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1630129576354127867, 1630129576354127875, 'project_kind', '3', 'HZ3000 v3.0', 1, NULL, 0, 0, 0, -1, 'hzinfo-data-config'); +INSERT INTO `dev_bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1630129576354127875, 0, 'project_kind', '-1', '项目-数据来源', 0, NULL, 0, 0, 0, -1, 'hzinfo-data-config'); \ No newline at end of file