From 2c743103cfa6e24bcb3fd064845c8cfd8fe8bbe6 Mon Sep 17 00:00:00 2001 From: jinpengyong <jpy123456> Date: Tue, 22 Aug 2023 14:02:48 +0800 Subject: [PATCH] Merge branch 'dev' of http://blit.7drlb.com:8888/r/moral into wb --- screen-api/src/main/resources/mapper/DeviceMapper.xml | 29 +++++++++++++++++++++++++++-- 1 files changed, 27 insertions(+), 2 deletions(-) diff --git a/screen-api/src/main/resources/mapper/DeviceMapper.xml b/screen-api/src/main/resources/mapper/DeviceMapper.xml index 94cde21..5f47265 100644 --- a/screen-api/src/main/resources/mapper/DeviceMapper.xml +++ b/screen-api/src/main/resources/mapper/DeviceMapper.xml @@ -14,6 +14,7 @@ <result column="operate_ids" property="operateIds"/> <result column="monitor_point_id" property="monitorPointId"/> <result column="organization_id" property="organizationId"/> + <result column="guid" property="guid"/> <result column="device_version_id" property="deviceVersionId"/> <result column="profession" property="profession"/> <result column="tech" property="tech"/> @@ -24,17 +25,41 @@ <result column="install_time" property="installTime"/> <result column="is_delete" property="isDelete"/> <result column="extend" property="extend"/> + <result column="town_code" property="townCode"/> + <result column="dev_num" property="devNum"/> </resultMap> <!--���������������������������--> <select id="getTrendChartData" resultType="java.util.Map"> - SELECT + SELECT mac, DATE_FORMAT(`time`,#{dateFormat}) AS `time`, `value`->'$.${sensorCode}' AS '${sensorCode}' FROM history_${timeUnits} - WHERE mac = #{mac} + WHERE mac IN + <foreach collection="macs" item="mac" index="index" open="(" close=")" separator=","> + #{mac} + </foreach> AND `time` <![CDATA[>=]]> #{start} AND `time` <![CDATA[<]]> #{end} ORDER BY `time` </select> + <select id="deviceList" resultMap="BaseResultMap"> + SELECT + t.latitude, + t.longitude, + t.mac, + t.state + FROM + device t + inner JOIN monitor_point p on p.id = t.monitor_point_id and p.is_delete = 0 + and p.organization_id in ( + SELECT t1.id FROM organization t1 + where t1.id = #{organizationId} or t1.parent_id = #{organizationId}) + <if test="region != null"> + and ${region} = #{regionCode} + </if> + WHERE + t.state <![CDATA[ <> ]]> '0' and t.is_delete = 0 + order by t.id desc + </select> </mapper> \ No newline at end of file -- Gitblit v1.8.0