Browse Source

属性类型

lv.wenbin 10 months ago
parent
commit
af41b3b2d1

+ 14 - 1
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsObjAttr.java

@@ -21,6 +21,9 @@ public class EmsObjAttr extends BaseEntity
     /** 模型code */
     private String modelCode;
 
+    /** 属性类型 */
+    private Integer attrType;
+
     /** 属性标识 */
     private String attrKey;
 
@@ -48,7 +51,16 @@ public class EmsObjAttr extends BaseEntity
     {
         return modelCode;
     }
-    public void setAttrKey(String attrKey) 
+
+    public Integer getAttrType() {
+        return attrType;
+    }
+
+    public void setAttrType(Integer attrType) {
+        this.attrType = attrType;
+    }
+
+    public void setAttrKey(String attrKey)
     {
         this.attrKey = attrKey;
     }
@@ -82,6 +94,7 @@ public class EmsObjAttr extends BaseEntity
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
             .append("id", getId())
             .append("modelCode", getModelCode())
+            .append("attrType", getAttrType())
             .append("attrKey", getAttrKey())
             .append("attrName", getAttrName())
             .append("attrUnit", getAttrUnit())

+ 11 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/vo/QueryDevice.java

@@ -50,6 +50,9 @@ public class QueryDevice {
     /** 设备工艺标识编码 */
     private String psCode;
 
+    /** 设备工艺标识编码 */
+    private List<String> psCodes;
+
     private Long deviceStatus;
 
     /** 所属子系统 */
@@ -135,6 +138,14 @@ public class QueryDevice {
         this.psCode = psCode;
     }
 
+    public List<String> getPsCodes() {
+        return psCodes;
+    }
+
+    public void setPsCodes(List<String> psCodes) {
+        this.psCodes = psCodes;
+    }
+
     public Long getDeviceStatus() {
         return deviceStatus;
     }

+ 7 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsDeviceMapper.xml

@@ -72,6 +72,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="refArea != null  and refArea != ''"> and d.`ref_area` = #{refArea}</if>
             <if test="deviceSubCategory != null and deviceSubCategory !=''"> and d.`device_category` = #{deviceSubCategory}</if>
             <if test="psCode != null  and psCode != ''"> and d.`ps_code` = #{psCode}</if>
+            <if test="psCodes != null"> and d.`ps_code` in
+                (
+                  <foreach collection="psCodes" item="item" index="index" separator=",">
+                      #{item}
+                  </foreach>
+                )
+            </if>
             <if test="subsystemCode != null  and subsystemCode != ''"> and d.`subsystem_code` = #{subsystemCode}</if>
             <if test="refFacs != null  and refFacs != ''"> and d.`ref_facs` = #{refFacs}</if>
             <if test="upstreamObjType != null"> and rel.`export_obj_type` = #{upstreamObjType}</if>

+ 8 - 3
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsObjAttrMapper.xml

@@ -7,19 +7,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="com.ruoyi.ems.domain.EmsObjAttr" id="ObjAttrResult">
         <result property="id"    column="id"    />
         <result property="modelCode"    column="model_code"    />
+        <result property="attrType"    column="attr_type"    />
         <result property="attrKey"    column="attr_key"    />
         <result property="attrName"    column="attr_name"    />
         <result property="attrUnit"    column="attr_unit"    />
     </resultMap>
 
     <sql id="selectAdmEmsObjAttrVo">
-        select id, model_code, attr_key, attr_name, attr_unit from adm_ems_obj_attr
+        select id, model_code, attr_type, attr_key, attr_name, attr_unit from adm_ems_obj_attr
     </sql>
 
     <select id="selectObjAttrList" parameterType="com.ruoyi.ems.domain.EmsObjAttr" resultMap="ObjAttrResult">
         <include refid="selectAdmEmsObjAttrVo"/>
         <where>  
             <if test="modelCode != null  and modelCode != ''"> and model_code = #{modelCode}</if>
+            <if test="attrType != null"> and attr_type = #{attrType}</if>
             <if test="attrKey != null  and attrKey != ''"> and attr_key = #{attrKey}</if>
             <if test="attrName != null  and attrName != ''"> and attr_name like concat('%', #{attrName}, '%')</if>
         </where>
@@ -39,12 +41,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         insert into adm_ems_obj_attr
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="modelCode != null and modelCode != ''">model_code,</if>
+            <if test="attrType != null and attrType != ''">attr_type,</if>
             <if test="attrKey != null and attrKey != ''">attr_key,</if>
             <if test="attrName != null and attrName != ''">attr_name,</if>
             <if test="attrUnit != null">attr_unit,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="modelCode != null and modelCode != ''">#{modelCode},</if>
+            <if test="attrType != null and attrType != ''">#{attrType},</if>
             <if test="attrKey != null and attrKey != ''">#{attrKey},</if>
             <if test="attrName != null and attrName != ''">#{attrName},</if>
             <if test="attrUnit != null">#{attrUnit},</if>
@@ -52,10 +56,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </insert>
 
     <insert id="insertBatch" parameterType="java.util.List">
-        insert into adm_ems_obj_attr (model_code, attr_key, attr_name, attr_unit)
+        insert into adm_ems_obj_attr (model_code, attr_type, attr_key, attr_name, attr_unit)
         values
         <foreach collection="list" item="item" index="index" separator=",">
-            (#{item.modelCode}, #{item.attrKey}, #{item.attrName}, #{item.attrUnit})
+            (#{item.modelCode}, #{item.attrType}, #{item.attrKey}, #{item.attrName}, #{item.attrUnit})
         </foreach>
     </insert>
 
@@ -63,6 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update adm_ems_obj_attr
         <trim prefix="SET" suffixOverrides=",">
             <if test="modelCode != null and modelCode != ''">model_code = #{modelCode},</if>
+            <if test="attrType != null">attr_type = #{attrType},</if>
             <if test="attrKey != null and attrKey != ''">attr_key = #{attrKey},</if>
             <if test="attrName != null and attrName != ''">attr_name = #{attrName},</if>
             <if test="attrUnit != null">attr_unit = #{attrUnit},</if>

+ 9 - 19
ems-cloud/sql/ems_init_data.sql

@@ -121,22 +121,10 @@ INSERT INTO `adm_ems_facs` (`facs_code`, `facs_name`, `facs_category`, `facs_sub
 
 
 -- 对象模型表
-INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`) VALUES ('M_W2', '国网设施模型', 1);
-INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`) VALUES ('M_E5', '光伏设施模型', 1);
-INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`) VALUES ('M_C1', '储能模型', 1);
-INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`) VALUES ('M_W2_T', '变压器设备模型', 2);
 INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`) VALUES ('M_Z010', '照明设备模型', 2);
 
 -- 对象属性DEMO数据
-INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_W2', 'frequency', '频率', 'Hz');
-INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_W2', 'voltageLevel', '电压等级', 'kV');
-INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_W2_T', 'ratedCapacity', '额定容量', 'kVA');
-INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_W2_T', 'ratedVoltage', '额定电压', 'kV');
-INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_W2_T', 'ratedFrequency', '额定频率', 'Hz');
-INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_W2_T', 'phaseNumber', '相数', '相');
-INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_E5',  'installedCapacity', '装机容量', 'kw');
-INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_C1',  'storageCapacity',   '储能容量', 'kW-h');
-INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_Z010',  'power',   '功率', 'kW-h');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_type`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_Z010', 0, 'power',   '功率', 'kW-h');
 
 -- 对象属性DEMO数据
 INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `obj_type`, `attr_key`, `attr_value`, `model_code`) VALUES ('D-B-T-1001', 2, 'ratedCapacity', '1000', 'M_W2_T');
@@ -149,6 +137,8 @@ INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `obj_type`, `attr_key`, `attr_
 INSERT INTO `adm_ems_obj_attr_value` (`obj_code`, `obj_type`, `attr_key`, `attr_value`, `model_code`) VALUES ('D-N-T-1002', 2, 'phaseNumber', '3', 'M_W2_T');
 
 -- 对象能力DEMO数据
+INSERT INTO `adm_ems_obj_ability` (`model_code`, `ability_key`, `ability_name`, `ability_desc`, `ability_param`)VALUES ('M_W2_QR', '漏电保护器模型', 2);
+INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`) VALUES ('M_W2_QF', '断路器模型', 2);
 INSERT INTO `adm_ems_obj_ability` (`model_code`, `ability_key`, `ability_name`, `ability_desc`, `ability_param`) VALUES ('M_W2', 'checkLine', '线路检测', '执行xx方法进行测试', '{\"enable\":\"1\"}');
 
 
@@ -269,12 +259,12 @@ INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_category`, `
 INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_category`, `device_brand`, `device_spec`, `location`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'E503-K140-K150-002', '光伏板2',      'E5', null, null, null, '1', 'Building', 'S30K140-S30K150', '321283124S3003,S30K140-S30K150', null, 'E503', null, 'SYS_GF');
 INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_category`, `device_brand`, `device_spec`, `location`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ( 'E503-K140-K150-003', '光伏板3',      'E5', null, null, null, '1', 'Building', 'S30K150-S30K180', '321283124S3003,S30K150-S30K180', null, 'E503', null, 'SYS_GF');
 
-INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_category`, `device_brand`, `device_spec`, `location`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('D-B-T-1001', '变压器', 'W2', '西门子', 'T221123', '北区', 1, 'Area', '321283124S3001', '321283124S3001', 'M_W2_T', 'W201', 'T', null);
-INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_category`, `device_brand`, `device_spec`, `location`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('D-N-T-1002', '变压器', 'W2', '西门子', 'T221212', '南区', 1, 'Area', '321283124S3002', '321283124S3002', 'M_W2_T', 'W201', 'T', null);
-INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_category`, `device_brand`, `device_spec`, `location`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('D-B-1001', '配电柜', 'W2', '安科瑞', 'DX2121021', '综合楼配电间', 1, 'Area', '321283124S3001', '321283124S3001', null, 'W201', 'AP', null);
-INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_category`, `device_brand`, `device_spec`, `location`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('D-B-1002', '配电柜', 'W2', '安科瑞', 'DX2121021', '广场配电柜',   1, 'Area', '321283124S3001', '321283124S3001', null, 'W201', 'AP', null);
-INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_category`, `device_brand`, `device_spec`, `location`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('D-N-1001', '配电柜', 'W2', '安科瑞', 'DX2121021', '综合楼配电间', 1, 'Area', '321283124S3002', '321283124S3002', null, 'W202', 'AP', null);
-INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_category`, `device_brand`, `device_spec`, `location`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('D-N-1002', '配电柜', 'W2', '安科瑞', 'DX2121021', '广场配电柜',   1, 'Area', '321283124S3002', '321283124S3002', null, 'W202', 'AP', null);
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_category`, `device_brand`, `device_spec`, `location`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('D-B-T-1001', '(变)D-B-T-1001', 'W2', '西门子', 'T221123', '北区', 1, 'Area', '321283124S3001', '321283124S3001', 'M_W2_T', 'W201', 'T', null);
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_category`, `device_brand`, `device_spec`, `location`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('D-N-T-1002', '(变)D-N-T-1002', 'W2', '西门子', 'T221212', '南区', 1, 'Area', '321283124S3002', '321283124S3002', 'M_W2_T', 'W201', 'T', null);
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_category`, `device_brand`, `device_spec`, `location`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('D-B-1001', '(配)D-B-1001', 'W2', '安科瑞', 'DX2121021', '综合楼配电间', 1, 'Area', '321283124S3001', '321283124S3001', null, 'W201', 'AP', null);
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_category`, `device_brand`, `device_spec`, `location`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('D-B-1002', '(配)D-B-1002', 'W2', '安科瑞', 'DX2121021', '广场配电柜',   1, 'Area', '321283124S3001', '321283124S3001', null, 'W201', 'AP', null);
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_category`, `device_brand`, `device_spec`, `location`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('D-N-1001', '(配)D-N-1001', 'W2', '安科瑞', 'DX2121021', '综合楼配电间', 1, 'Area', '321283124S3002', '321283124S3002', null, 'W202', 'AP', null);
+INSERT INTO `adm_ems_device` (`device_code`, `device_name`, `device_category`, `device_brand`, `device_spec`, `location`, `device_status`, `area_type`, `ref_area`, `area_ancestors`, `device_model`, `ref_facs`, `ps_code`, `subsystem_code`) VALUES ('D-N-1002', '(配)D-N-1002', 'W2', '安科瑞', 'DX2121021', '广场配电柜',   1, 'Area', '321283124S3002', '321283124S3002', null, 'W202', 'AP', null);
 
 
 -- 动力箱柜电气设备表

+ 33 - 5
ems-cloud/sql/ems_server.sql

@@ -530,13 +530,21 @@ create table adm_meter_device  (
 drop table if exists adm_ems_obj_model;
 create table adm_ems_obj_model  (
   `id`              bigint(20)      not null auto_increment      comment '序号',
-  `model_code`      varchar(16)     not null                     comment '模型code',
+  `model_code`      varchar(64)     not null                     comment '模型code',
   `model_name`      varchar(128)    not null                     comment '模型名称',
   `obj_type`        int             not null                     comment '对象类型',
   primary key (`id`),
   unique key ux_ems_obj_attr(`model_code`)
 ) engine=innodb auto_increment=1 comment = '能源对象模型表';
 
+-- 对象模型初始数据
+INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`) VALUES ('M_W2', '国网供电模型', 1);
+INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`) VALUES ('M_E5', '光伏设施模型', 1);
+INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`) VALUES ('M_C1', '储能模型', 1);
+INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`) VALUES ('M_W2_T', '变压器设备模型', 2);
+INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`) VALUES ('M_W2_AP', '配电柜模型', 2);
+INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`) VALUES ('M_W2_QR', '漏电保护器模型', 2);
+INSERT INTO `adm_ems_obj_model` (`model_code`, `model_name`, `obj_type`) VALUES ('M_W2_QF', '断路器模型', 2);
 
 -- ----------------------------
 -- 能源对象属性表
@@ -544,7 +552,8 @@ create table adm_ems_obj_model  (
 drop table if exists adm_ems_obj_attr;
 create table adm_ems_obj_attr  (
   `id`              bigint(20)      not null auto_increment      comment '序号',
-  `model_code`      varchar(16)     not null                     comment '模型code',
+  `model_code`      varchar(64)     not null                     comment '模型code',
+  `attr_type`       int             default 0                    comment '属性类型',
   `attr_key`        varchar(128)    not null                     comment '属性标识',
   `attr_name`       varchar(256)    default null                 comment '属性名称',
   `attr_unit`       varchar(32)     default null                 comment '属性单位',
@@ -552,6 +561,25 @@ create table adm_ems_obj_attr  (
   unique key ux_ems_obj_attr(`model_code`, `attr_key`)
 ) engine=innodb auto_increment=1 comment = '能源对象属性表';
 
+-- 对象属性初始数据
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_type`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_W2', 0, 'voltageLevel', '电压等级', 'kV');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_type`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_W2', 0, 'frequency', '电流频率', 'Hz');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_type`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_E5', 0, 'installedCapacity', '装机容量', 'kw');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_type`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_C1', 0, 'storageCapacity',   '储能容量', 'kW-h');
+
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_type`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_W2_T', 0, 'ratedCapacity', '额定容量', 'kVA');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_type`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_W2_T', 0, 'ratedVoltage', '额定电压', 'kV');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_type`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_W2_T', 0, 'ratedFrequency', '额定频率', 'Hz');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_type`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_W2_T', 0, 'phaseNumber', '相数', '相');
+
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_type`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_W2_QR', 0, 'ratedVoltage', '额定电压', 'V');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_type`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_W2_QR', 0, 'ratedCurrent', '额定电流', 'A');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_type`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_W2_QR', 0, 'triggerCurrent', '触发电流', 'A');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_type`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_W2_QR', 1, 'onOffState', '开关状态', null);
+
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_type`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_W2_QF', 0, 'ratedVoltage', '额定电压', 'V');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_type`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_W2_QF', 0, 'ratedCurrent', '额定电流', 'A');
+INSERT INTO `adm_ems_obj_attr` (`model_code`, `attr_type`, `attr_key`, `attr_name`, `attr_unit`) VALUES ('M_W2_QF', 1, 'onOffState', '开关状态', null);
 
 -- ----------------------------
 -- 能源对象属性值表
@@ -563,7 +591,7 @@ create table adm_ems_obj_attr_value  (
   `obj_type`        int             not null                     comment '对象类型',
   `attr_key`        varchar(128)    not null                     comment '属性标识',
   `attr_value`      varchar(32)     default null                 comment '属性值',
-  `model_code`      varchar(16)     default null                 comment '模型code',
+  `model_code`      varchar(64)     default null                 comment '模型code',
   primary key (`id`),
   unique key ux_ems_obj_attr_value(`obj_code`, `obj_type`, `attr_key`)
 ) engine=innodb auto_increment=1 comment = '能源对象属性值表';
@@ -575,7 +603,7 @@ create table adm_ems_obj_attr_value  (
 drop table if exists adm_ems_obj_ability;
 create table adm_ems_obj_ability  (
   `id`              bigint(20)      not null auto_increment      comment '序号',
-  `model_code`      varchar(16)     not null                     comment '模型code',
+  `model_code`      varchar(64)     not null                     comment '模型code',
   `ability_key`     varchar(128)    not null                     comment '能力键',
   `ability_name`    varchar(256)    default null                 comment '能力名称',
   `ability_desc`    varchar(1024)   default null                 comment '能力描述',
@@ -591,7 +619,7 @@ create table adm_ems_obj_ability  (
 drop table if exists adm_ems_obj_event;
 create table adm_ems_obj_event  (
   `id`              bigint(20)      not null auto_increment      comment '序号',
-  `model_code`      varchar(16)     not null                     comment '模型code',
+  `model_code`      varchar(64)     not null                     comment '模型code',
   `event_key`       varchar(128)    not null                     comment '事件名称',
   `event_type`      int             not null                     comment '事件类型',
   `event_name`      varchar(256)    default null                 comment '事件名称',