haungxing
2 years ago
6 changed files with 193 additions and 197 deletions
@ -1,73 +1,89 @@
|
||||
SET FOREIGN_KEY_CHECKS=0; |
||||
|
||||
CREATE TABLE `dev_equipment`.`hzims_em_association` ( |
||||
`ID` bigint(20) NOT NULL COMMENT '主键Id', |
||||
`EM_ID` bigint(20) NULL DEFAULT NULL COMMENT '设备Id', |
||||
`FDP_EM_ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'FDP设备Id', |
||||
`FDP_EM_NAME` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'PDF设备名称', |
||||
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', |
||||
`CREATE_TIME` datetime NULL DEFAULT NULL COMMENT '创建时间', |
||||
`UPDATE_TIME` datetime NULL DEFAULT NULL COMMENT '更新时间', |
||||
`CREATE_USER` bigint(64) NULL DEFAULT NULL COMMENT '创建人', |
||||
`UPDATE_USER` bigint(64) NULL DEFAULT NULL COMMENT '修改人', |
||||
`CREATE_DEPT` bigint(64) NULL DEFAULT NULL COMMENT '创建部门', |
||||
`STATUS` int(2) NULL DEFAULT 0 COMMENT '状态', |
||||
`IS_DELETED` int(2) NULL DEFAULT 0 COMMENT '是否已删除: 0、否; 1、是', |
||||
PRIMARY KEY (`ID`) USING BTREE |
||||
CREATE TABLE `equipment`.`hzims_em_association` ( |
||||
`ID` bigint(20) NOT NULL COMMENT '主键Id', |
||||
`EM_ID` bigint(20) NULL DEFAULT NULL COMMENT '设备Id', |
||||
`FDP_EM_ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'FDP设备Id', |
||||
`FDP_EM_NAME` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'PDF设备名称', |
||||
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', |
||||
`CREATE_TIME` datetime NULL DEFAULT NULL COMMENT '创建时间', |
||||
`UPDATE_TIME` datetime NULL DEFAULT NULL COMMENT '更新时间', |
||||
`CREATE_USER` bigint(64) NULL DEFAULT NULL COMMENT '创建人', |
||||
`UPDATE_USER` bigint(64) NULL DEFAULT NULL COMMENT '修改人', |
||||
`CREATE_DEPT` bigint(64) NULL DEFAULT NULL COMMENT '创建部门', |
||||
`STATUS` int(2) NULL DEFAULT 0 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 COMMENT = '设备关联表' ROW_FORMAT = Dynamic; |
||||
|
||||
CREATE TABLE `dev_equipment`.`hzims_em_association_detail` ( |
||||
`PID` bigint(20) NOT NULL COMMENT '父id', |
||||
`ID` bigint(20) NOT NULL COMMENT '主键Id', |
||||
`EM_POINT_ID` bigint(20) NOT NULL COMMENT '设备点Id', |
||||
`FDP_EM_POINT_ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'FDP点Id', |
||||
`FDP_EM_POINT_NAME` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'FDP监测点名称', |
||||
`FDP_EM_POINT_ORD` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'FDP监测点位置', |
||||
`PRO_TYPE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '属性类型:yc、yx、soe', |
||||
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', |
||||
`CREATE_TIME` datetime NULL DEFAULT NULL COMMENT '创建时间', |
||||
`UPDATE_TIME` datetime NULL DEFAULT NULL COMMENT '更新时间', |
||||
`CREATE_USER` bigint(64) NULL DEFAULT NULL COMMENT '创建人', |
||||
`UPDATE_USER` bigint(64) NULL DEFAULT NULL COMMENT '修改人', |
||||
`CREATE_DEPT` bigint(64) NULL DEFAULT NULL COMMENT '创建部门', |
||||
`STATUS` int(2) NULL DEFAULT 0 COMMENT '状态', |
||||
`IS_DELETED` int(2) NULL DEFAULT 0 COMMENT '是否已删除: 0、否; 1、是', |
||||
PRIMARY KEY (`ID`) USING BTREE |
||||
CREATE TABLE `equipment`.`hzims_em_association_detail` ( |
||||
`PID` bigint(20) NOT NULL COMMENT '父id', |
||||
`ID` bigint(20) NOT NULL COMMENT '主键Id', |
||||
`EM_POINT_ID` bigint(20) NOT NULL COMMENT '设备点Id', |
||||
`FDP_EM_POINT_ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'FDP点Id', |
||||
`FDP_EM_POINT_NAME` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'FDP监测点名称', |
||||
`FDP_EM_POINT_ORD` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'FDP监测点位置', |
||||
`PRO_TYPE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '属性类型:yc、yx、soe', |
||||
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', |
||||
`CREATE_TIME` datetime NULL DEFAULT NULL COMMENT '创建时间', |
||||
`UPDATE_TIME` datetime NULL DEFAULT NULL COMMENT '更新时间', |
||||
`CREATE_USER` bigint(64) NULL DEFAULT NULL COMMENT '创建人', |
||||
`UPDATE_USER` bigint(64) NULL DEFAULT NULL COMMENT '修改人', |
||||
`CREATE_DEPT` bigint(64) NULL DEFAULT NULL COMMENT '创建部门', |
||||
`STATUS` int(2) NULL DEFAULT 0 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 COMMENT = '设备关联明细表' ROW_FORMAT = Dynamic; |
||||
|
||||
ALTER TABLE `dev_equipment`.`hzims_em_info` ADD COLUMN `em_index` tinyint(4) NULL DEFAULT NULL COMMENT '设备序号' AFTER `CREATE_DEPT`; |
||||
ALTER TABLE `equipment`.`hzims_em_info` ADD COLUMN `em_index` tinyint(4) NULL DEFAULT NULL COMMENT '设备序号' AFTER `CREATE_DEPT`; |
||||
|
||||
ALTER TABLE `dev_equipment`.`hzims_em_info` ADD COLUMN `DEVICE_INSTANCE_ID` bigint(20) NULL DEFAULT NULL COMMENT '设备实例化Id' AFTER `em_index`; |
||||
ALTER TABLE `equipment`.`hzims_em_info` ADD COLUMN `DEVICE_INSTANCE_ID` bigint(20) NULL DEFAULT NULL COMMENT '设备实例化Id' AFTER `em_index`; |
||||
|
||||
ALTER TABLE `dev_equipment`.`hzims_em_info` ADD COLUMN `em_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备类型' AFTER `DEVICE_INSTANCE_ID`; |
||||
ALTER TABLE `equipment`.`hzims_em_info` ADD COLUMN `em_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备类型' AFTER `DEVICE_INSTANCE_ID`; |
||||
|
||||
ALTER TABLE `dev_equipment`.`hzims_em_info` ADD COLUMN `set_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '机组类型' AFTER `em_type`; |
||||
ALTER TABLE `equipment`.`hzims_em_info` ADD COLUMN `set_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '机组类型' AFTER `em_type`; |
||||
|
||||
ALTER TABLE `dev_equipment`.`hzims_em_info` MODIFY COLUMN `NUMBER` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '设备编号' AFTER `ID`; |
||||
ALTER TABLE `equipment`.`hzims_em_info` MODIFY COLUMN `NUMBER` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '设备编号' AFTER `ID`; |
||||
|
||||
ALTER TABLE `dev_equipment`.`hzims_em_info` MODIFY COLUMN `HOME_PAGE_DISPLAY` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '首页展示' AFTER `LINKER_PHONE`; |
||||
ALTER TABLE `equipment`.`hzims_em_info` MODIFY COLUMN `HOME_PAGE_DISPLAY` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '首页展示' AFTER `LINKER_PHONE`; |
||||
|
||||
ALTER TABLE `dev_equipment`.`hzims_em_info` MODIFY COLUMN `GRADE_CODE` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备等级' AFTER `MANAGER`; |
||||
ALTER TABLE `equipment`.`hzims_em_info` MODIFY COLUMN `GRADE_CODE` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备等级' AFTER `MANAGER`; |
||||
|
||||
ALTER TABLE `dev_equipment`.`hzims_em_info` MODIFY COLUMN `RUN_STATUS` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '2' COMMENT '运行状态' AFTER `INS_LOCATION`; |
||||
ALTER TABLE `equipment`.`hzims_em_info` MODIFY COLUMN `RUN_STATUS` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '2' COMMENT '运行状态' AFTER `INS_LOCATION`; |
||||
|
||||
CREATE TABLE `dev_equipment`.`hzims_workshop_equipment` ( |
||||
`ID` bigint(20) NOT NULL COMMENT '主键ID', |
||||
`WORKSHOP_ID` bigint(20) NOT NULL COMMENT '厂房ID', |
||||
`WORKSHOP_NAME` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '厂房名称', |
||||
`EM_ID` bigint(20) NOT NULL COMMENT '设备ID', |
||||
`EM_NAME` 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 NOT NULL COMMENT '创建时间', |
||||
`UPDATE_TIME` datetime 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 |
||||
CREATE TABLE `equipment`.`hzims_workshop_equipment` ( |
||||
`ID` bigint(20) NOT NULL COMMENT '主键ID', |
||||
`WORKSHOP_ID` bigint(20) NOT NULL COMMENT '厂房ID', |
||||
`WORKSHOP_NAME` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '厂房名称', |
||||
`EM_ID` bigint(20) NOT NULL COMMENT '设备ID', |
||||
`EM_NAME` 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 NOT NULL COMMENT '创建时间', |
||||
`UPDATE_TIME` datetime 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 ALGORITHM = UNDEFINED DEFINER = `root`@`%` SQL SECURITY DEFINER VIEW `dev_equipment`.`v_hzims_fdp_fualt` AS (select `t1`.`ID` AS `ID`,`t1`.`FDP_ID` AS `FDP_ID`,`t1`.`NAME` AS `NAME`,`t1`.`INFO` AS `INFO`,`t1`.`EM_CODE` AS `EM_CODE`,`t1`.`DETECTABILITY` AS `DETECTABILITY`,`t1`.`SEVERITY` AS `SEVERITY`,`t1`.`FDP_DEVICE_ID` AS `FDP_DEVICE_ID`,`t1`.`FDP_DEVICE_NAME` AS `FDP_DEVICE_NAME`,`t1`.`ORD` AS `ORD`,`t1`.`DISPLAY` AS `DISPLAY`,`t1`.`TENANT_ID` AS `TENANT_ID`,`t1`.`CREATE_TIME` AS `CREATE_TIME`,`t1`.`UPDATE_TIME` AS `UPDATE_TIME`,`t1`.`CREATE_USER` AS `CREATE_USER`,`t1`.`UPDATE_USER` AS `UPDATE_USER`,`t1`.`IS_DELETED` AS `IS_DELETED`,`t1`.`STATUS` AS `STATUS`,`t1`.`CREATE_DEPT` AS `CREATE_DEPT`,`t2`.`FAULT_AMOUNT` AS `FAULT_AMOUNT` from (`dev_equipment`.`hzims_fdp_fault` `t1` join (select `t`.`NAME` AS `name`,count(`t`.`NAME`) AS `FAULT_AMOUNT` from `dev_equipment`.`hzims_fdp_fault` `t` group by `t`.`NAME` order by count(`t`.`NAME`) desc) `t2`) where (`t1`.`NAME` = `t2`.`name`) order by `t2`.`FAULT_AMOUNT` desc); |
||||
CREATE ALGORITHM = UNDEFINED DEFINER = `root`@`%` SQL SECURITY DEFINER VIEW `equipment`.`v_hzims_fdp_fualt` AS (select `t1`.`ID` AS `ID`,`t1`.`FDP_ID` AS `FDP_ID`,`t1`.`NAME` AS `NAME`,`t1`.`INFO` AS `INFO`,`t1`.`EM_CODE` AS `EM_CODE`,`t1`.`DETECTABILITY` AS `DETECTABILITY`,`t1`.`SEVERITY` AS `SEVERITY`,`t1`.`FDP_DEVICE_ID` AS `FDP_DEVICE_ID`,`t1`.`FDP_DEVICE_NAME` AS `FDP_DEVICE_NAME`,`t1`.`ORD` AS `ORD`,`t1`.`DISPLAY` AS `DISPLAY`,`t1`.`TENANT_ID` AS `TENANT_ID`,`t1`.`CREATE_TIME` AS `CREATE_TIME`,`t1`.`UPDATE_TIME` AS `UPDATE_TIME`,`t1`.`CREATE_USER` AS `CREATE_USER`,`t1`.`UPDATE_USER` AS `UPDATE_USER`,`t1`.`IS_DELETED` AS `IS_DELETED`,`t1`.`STATUS` AS `STATUS`,`t1`.`CREATE_DEPT` AS `CREATE_DEPT`,`t2`.`FAULT_AMOUNT` AS `FAULT_AMOUNT` from (`equipment`.`hzims_fdp_fault` `t1` join (select `t`.`NAME` AS `name`,count(`t`.`NAME`) AS `FAULT_AMOUNT` from `equipment`.`hzims_fdp_fault` `t` group by `t`.`NAME` order by count(`t`.`NAME`) desc) `t2`) where (`t1`.`NAME` = `t2`.`name`) order by `t2`.`FAULT_AMOUNT` desc); |
||||
|
||||
SET FOREIGN_KEY_CHECKS=1; |
||||
SET FOREIGN_KEY_CHECKS=1; |
||||
|
||||
-- 设备信息字典添加 |
||||
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1633016108671905794, 0, 'deviceType', '-1', '设备类型', 10, '', 0, 0, 0, -1, 'hzims-equipment'); |
||||
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1633016255816478722, 1633016108671905794, 'deviceType', '1', '公用', 1, '', 0, 0, 0, -1, 'hzims-equipment'); |
||||
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1633016338171637761, 1633016108671905794, 'deviceType', '2', '机组', 2, '', 0, 0, 0, -1, 'hzims-equipment'); |
||||
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1638000391480205313, 1633016338171637761, 'deviceType', '3', '立式机组', 1, '', 0, 1, 0, -1, 'hzims-equipment'); |
||||
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1638000491426275330, 1633016338171637761, 'deviceType', '4', '卧式机组', 2, '', 0, 1, 0, -1, 'hzims-equipment'); |
||||
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1638000590814502914, 1633016338171637761, 'deviceType', '5', '灯泡贯流式', 3, '', 0, 1, 0, -1, 'hzims-equipment'); |
||||
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1638020338327543810, 1633016108671905794, 'deviceType', '3', '其他', 3, '', 0, 0, 0, -1, 'hzims-equipment'); |
||||
|
||||
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1638020560906674177, 0, 'setType', '-1', '机组类型', 7, '', 0, 0, 0, -1, 'hzims-equipment'); |
||||
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1638020669019054082, 1638020560906674177, 'setType', '1', '立式机组', 1, '', 0, 0, 0, -1, 'hzims-equipment'); |
||||
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1638020767178350594, 1638020560906674177, 'setType', '2', '卧式机组', 2, '', 0, 0, 0, -1, 'hzims-equipment'); |
||||
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1638020840851300353, 1638020560906674177, 'setType', '3', '其他', 3, '', 0, 1, 0, -1, 'hzims-equipment'); |
||||
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1645258692320387074, 1638020560906674177, 'setType', '3', '灯泡贯流式机组', 3, '', 0, 0, 0, -1, 'hzims-equipment'); |
||||
INSERT INTO `bladex`.`blade_dict` (`id`, `parent_id`, `code`, `dict_key`, `dict_value`, `sort`, `remark`, `is_sealed`, `is_deleted`, `dict_type`, `app_id`, `app_code`) VALUES (1645258829365075970, 1638020560906674177, 'setType', '4', '其他', 4, '', 0, 0, 0, -1, 'hzims-equipment'); |
||||
|
Loading…
Reference in new issue