瀏覽代碼

计量设备标签

lv.wenbin 11 月之前
父節點
當前提交
17e1c05af9

+ 20 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/MeterDevice.java

@@ -39,8 +39,12 @@ public class MeterDevice extends BaseEntity
     /** 计量对象编码 */
     private String objCode;
 
+    /** 计量对象名称 */
     private String objName;
 
+    /** 计量对象标记 */
+    private Integer objTag;
+
     /** 采集周期 */
     private Long colCycle;
 
@@ -117,6 +121,14 @@ public class MeterDevice extends BaseEntity
         this.objName = objName;
     }
 
+    public Integer getObjTag() {
+        return objTag;
+    }
+
+    public void setObjTag(Integer objTag) {
+        this.objTag = objTag;
+    }
+
     public Long getColCycle() {
         return colCycle;
     }
@@ -148,4 +160,12 @@ public class MeterDevice extends BaseEntity
     public void setSpecDesc(String specDesc) {
         this.specDesc = specDesc;
     }
+
+    @Override
+    public String toString() {
+        return "MeterDevice{" + "id=" + id + ", deviceCode='" + deviceCode + '\'' + ", areaCode='" + areaCode + '\''
+            + ", meterCls=" + meterCls + ", objType=" + objType + ", objSubType=" + objSubType + ", objCode='" + objCode
+            + '\'' + ", objName='" + objName + '\'' + ", objTag='" + objTag + '\'' + ", colCycle=" + colCycle
+            + ", colMode=" + colMode + ", magnification=" + magnification + ", specDesc='" + specDesc + '\'' + '}';
+    }
 }

+ 6 - 1
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/MeterDeviceMapper.xml

@@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="objSubType"  column="obj_sub_type"    />
         <result property="objCode"     column="obj_code"    />
         <result property="objName"     column="obj_name"    />
+        <result property="objTag"      column="obj_tag"    />
         <result property="colCycle"    column="col_cycle"    />
         <result property="colMode"     column="col_mode"    />
         <result property="magnification" column="magnification" />
@@ -20,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectMeterDeviceVo">
-        select id, device_code, area_code, meter_cls, obj_type, obj_sub_type, obj_code, col_cycle, col_mode, magnification, spec_desc from adm_meter_device
+        select id, device_code, area_code, meter_cls, obj_type, obj_sub_type, obj_code, obj_tag, col_cycle, col_mode, magnification, spec_desc from adm_meter_device
     </sql>
 
     <select id="selectMeterDeviceList" parameterType="com.ruoyi.ems.domain.MeterDevice" resultMap="meterDeviceResult">
@@ -32,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="objType != null "> and obj_type = #{objType}</if>
             <if test="objSubType != null "> and obj_sub_type = #{objSubType}</if>
             <if test="objCode != null  and objCode != ''"> and obj_code = #{objCode}</if>
+            <if test="objTag != null  and objTag != ''"> and obj_tag = #{objTag}</if>
             <if test="colCycle != null "> and col_cycle = #{colCycle}</if>
             <if test="colMode != null "> and col_mode = #{colMode}</if>
         </where>
@@ -52,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="objType != null">obj_type,</if>
             <if test="objSubType != null ">obj_sub_type,</if>
             <if test="objCode != null and objCode != ''">obj_code,</if>
+            <if test="objTag != null and objTag != ''">obj_tag,</if>
             <if test="colCycle != null">col_cycle,</if>
             <if test="colMode != null">col_mode,</if>
             <if test="magnification != null">magnification,</if>
@@ -64,6 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="objType != null">#{objType},</if>
             <if test="objSubType != null">#{objSubType},</if>
             <if test="objCode != null and objCode != ''">#{objCode},</if>
+            <if test="objTag != null and objTag != ''">#{objTag}</if>
             <if test="colCycle != null">#{colCycle},</if>
             <if test="colMode != null">#{colMode},</if>
             <if test="magnification != null">#{magnification},</if>
@@ -80,6 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="objType != null">obj_type = #{objType},</if>
             <if test="objSubType != null">obj_sub_type = #{objSubType},</if>
             <if test="objCode != null and objCode != ''">obj_code = #{objCode},</if>
+            <if test="objTag != null and objTag != ''">obj_tag = #{objTag},</if>
             <if test="colCycle != null">col_cycle = #{colCycle},</if>
             <if test="colMode != null">col_mode = #{colMode},</if>
             <if test="magnification != null">magnification = #{magnification},</if>

+ 11 - 11
ems-cloud/sql/ems_init_data.sql

@@ -108,19 +108,19 @@ INSERT INTO `adm_ems_facs_flow_rel` (`code`, `export_facs_code`, `input_facs_cod
 
 -- 能源计量设备DEMO数据
 -- 电表
-INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-102', '321283124S3001', 45, 1, 3, 'B-102', 4, 1, 1, '直采表');
-INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-103', '321283124S3001', 45, 1, 3, 'B-103', 4, 1, 1, '直采表');
-INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-104', '321283124S3001', 45, 1, 3, 'B-104', 4, 1, 1, '直采表');
-INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-105', '321283124S3001', 45, 1, 3, 'B-105', 4, 1, 1, '直采表');
-INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-106', '321283124S3001', 45, 1, 3, 'B-106', 4, 1, 1, '直采表');
-INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-107', '321283124S3001', 45, 1, 3, 'B-107', 4, 1, 1, '直采表');
-INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-108', '321283124S3001', 45, 1, 3, 'B-108', 4, 1, 1, '直采表');
-INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-109', '321283124S3001', 45, 1, 3, 'B-109', 4, 1, 1, '直采表');
-INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-110', '321283124S3001', 45, 1, 3, 'B-110', 4, 1, 1, '直采表');
-INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-Z010-R103-001', '321283124S3001', 45, 2, 2, 'Z010-R103-001', 4, 1, 20, '互感器表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-102', '321283124S3001', 45, 1, 3, 'B-102', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-103', '321283124S3001', 45, 1, 3, 'B-103', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-104', '321283124S3001', 45, 1, 3, 'B-104', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-105', '321283124S3001', 45, 1, 3, 'B-105', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-106', '321283124S3001', 45, 1, 3, 'B-106', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-107', '321283124S3001', 45, 1, 3, 'B-107', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-108', '321283124S3001', 45, 1, 3, 'B-108', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-109', '321283124S3001', 45, 1, 3, 'B-109', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-110', '321283124S3001', 45, 1, 3, 'B-110', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-Z120', '321283124S3001', 45, 2, 1, 'Z120', 0, 4, 1, 20, '互感器表');
 
 -- 水表
-INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-01', '321283124S3001', 70, 1, 2, '321283124S300101', 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-01', '321283124S3001', 70, 1, 2, '321283124S300101', 0, 4, 1, 1, '直采表');
 
 
 -- 配电柜DEMO数据

+ 1 - 1
ems-cloud/sql/ems_server.sql

@@ -259,7 +259,6 @@ create table dim_ems_tag (
 INSERT INTO `dim_ems_tag` (`tag_model`, `tag_code`, `tag_name`) VALUES ('Area', 'Area_00', '公共区域');
 INSERT INTO `dim_ems_tag` (`tag_model`, `tag_code`, `tag_name`) VALUES ('Area', 'Area_01', '商户区域');
 
-
 -- ----------------------------
 -- 设备类型
 -- ----------------------------
@@ -577,6 +576,7 @@ create table adm_meter_device  (
   `obj_type`        int             not null                     comment '计量对象类型 1-区域 2-设备',
   `obj_sub_type`    int             not null                     comment '计量对象子类型',
   `obj_code`        varchar(32)     not null                     comment '计量对象编码',
+  `obj_tag`         int             default null                 comment '对象标记',
   `col_cycle`       int             default null                 comment '采集周期',
   `col_mode`        int             default null                 comment '采集方式',
   `magnification`   int             default 1                    comment '倍率',

+ 6 - 5
ems-cloud/sql/ems_sys.sql

@@ -201,6 +201,7 @@ insert into sys_menu values ('154',  '巡检报告',       '6',    '4',  'oper-r
 insert into sys_menu values ('161',  '建筑区块',       '7',    '1',  'buildingcfg',        '',                       '', 1, 0, 'M', '0', '0',   'basecfg:building',       'building',       'admin', sysdate(), '', null, '用户管理菜单');
 insert into sys_menu values ('162',  '设备设施',       '7',    '2',  'devicecfg',          '',                       '', 1, 0, 'M', '0', '0',   'basecfg:device',         'devicemgr',      'admin', sysdate(), '', null, '用户管理菜单');
 insert into sys_menu values ('163',  '能源计量',       '7',    '3',  'energycfg',          '',                       '', 1, 0, 'M', '0', '0',   'basecfg:energy',         'energy',         'admin', sysdate(), '', null, '用户管理菜单');
+insert into sys_menu values ('164',  '标签管理',       '7',    '4',  'emstag',             'basecfg/tag',            '', 1, 0, 'C', '0', '0',   'basecfg:tag:list',       'tree',           'admin', sysdate(), '', null, '标签菜单');
 
 insert into sys_menu values ('170',  '用户管理',       '8',   '1',  'user',               'system/user/index',      '', 1, 0, 'C', '0', '0',   'system:user:list',       'user',           'admin', sysdate(), '', null, '用户管理菜单');
 insert into sys_menu values ('171',  '角色管理',       '8',   '2',  'role',               'system/role/index',      '', 1, 0, 'C', '0', '0',   'system:role:list',       'peoples',        'admin', sysdate(), '', null, '角色管理菜单');
@@ -371,11 +372,11 @@ INSERT INTO `sys_menu` VALUES (1134,'edit',113, 1, '', NULL, NULL, 1, 0, 'F', '0
 INSERT INTO `sys_menu` VALUES (1135,'remove',113, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:gs:remove', '#', 'admin', sysdate(), '', NULL, '');
 
 -- 告警策略
-INSERT INTO sys_menu VALUES(1510, 'list', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:list', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
-INSERT INTO sys_menu VALUES(1511, 'export', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:export', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
-INSERT INTO sys_menu VALUES(1512, 'query', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:query', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
-INSERT INTO sys_menu VALUES(1513, 'add', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:add', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
-INSERT INTO sys_menu VALUES(1514, 'edit', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:edit', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1510, 'list', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:list', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1511, 'export', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:export', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1512, 'query', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:query', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1513, 'add', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:add', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1514, 'edit', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:edit', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
 INSERT INTO sys_menu VALUES (1515, 'remove', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:remove', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
 
 -- 告警列表