From b7f5fd4000d644d117a0936dbcc2bfc56bfab4f0 Mon Sep 17 00:00:00 2001 From: lizijie <lzjiiie@163.com> Date: Thu, 16 Sep 2021 10:08:11 +0800 Subject: [PATCH] 新建特殊设备DTO类,存放保存到redis的数据 --- screen-manage/src/main/resources/mapper/SpecialDeviceMapper.xml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 54 insertions(+), 0 deletions(-) diff --git a/screen-manage/src/main/resources/mapper/SpecialDeviceMapper.xml b/screen-manage/src/main/resources/mapper/SpecialDeviceMapper.xml index db8b4e6..a422955 100644 --- a/screen-manage/src/main/resources/mapper/SpecialDeviceMapper.xml +++ b/screen-manage/src/main/resources/mapper/SpecialDeviceMapper.xml @@ -16,4 +16,58 @@ <result column="is_delete" property="isDelete" /> </resultMap> + <resultMap id="querySpecialDeviceUnitAlarmInfoMap" type="com.moral.api.entity.SpecialDevice"> + <id column="d.id" property="id"/> + <result column="d.name" property="name"/> + <result column="d.mac" property="mac"/> + <result column="d.operate_ids" property="operateIds"/> + <result column="d.monitor_point_id" property="monitorPointId"/> + <result column="d.organization_id" property="organizationId"/> + <result column="oua.version_id" property="deviceVersionId"/> + <association property="version" column="d.device_version_id" javaType="com.moral.api.entity.Version"> + <id column="v.id" property="id"></id> + <result column="v.name" property="name"></result> + <collection column="d.device_version_id" property="sensors" ofType="com.moral.api.entity.Sensor"> + <result column="oua.sensor_code" property="code" ></result> + <result column="oua.unit_key" property="unitKey"></result> + <result column="oua.show_unit_key" property="showUnitKey"></result> + <result column="oua.alarm_level" property="alarmLevel" javaType="String" ></result> + </collection> + </association> + </resultMap> + + <select id="querySpecialDeviceUnitAlarmInfo" resultMap="querySpecialDeviceUnitAlarmInfoMap"> + select + d.id as `d.id`, + d.mac as `d.mac`, + d.name as `d.name`, + d.operate_ids as `d.operate_ids`, + d.organization_id as `d.organization_id`, + oua.version_id as `oua.version_id`, + oua.sensor_code as `oua.sensor_code`, + oua.unit_key as `oua.unit_key`, + oua.show_unit_key as `oua.show_unit_key`, + oua.alarm_level as `oua.alarm_level`, + v.id as `v.id`, + v.name as `v.name` + from + special_device d + join + version v + on + v.`id` = d.`device_version_id` and v.`is_delete` = 0 + join + organization_unit_alarm oua + on + d.`device_version_id` = oua.`version_id` and d.`organization_id` = oua.`organization_id` and oua.`is_delete` = 0 + where + d.`is_delete` = 0; + </select> + + <select id="selectOrgByMac" resultType="com.moral.api.entity.Organization"> + SELECT area_code, city_code + FROM organization + WHERE id = (SELECT organization_id FROM special_device WHERE mac = #{mac}) + </select> + </mapper> \ No newline at end of file -- Gitblit v1.8.0