From a31816bd82fcf2c10df0cef7f078645676149e78 Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Wed, 27 Jun 2018 13:56:32 +0800 Subject: [PATCH] 大屏布局监控点 返回配置数据 完善 --- src/main/resources/mapper/HistoryMinutelyMapper.xml | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/resources/mapper/HistoryMinutelyMapper.xml b/src/main/resources/mapper/HistoryMinutelyMapper.xml index ff3b4fc..1509a27 100644 --- a/src/main/resources/mapper/HistoryMinutelyMapper.xml +++ b/src/main/resources/mapper/HistoryMinutelyMapper.xml @@ -13,12 +13,25 @@ FROM history_minutely WHERE - mac = #{mac} + mac IN + (SELECT + d.mac + FROM + device d + WHERE + d.is_delete = 0 + <if test="monitorPointId != null"> + AND d.monitor_point_id = #{monitorPointId} + </if> + <if test="mac != null"> + AND d.mac = #{mac} + </if> + ) AND time >= #{start} AND time < #{end} </select> - <select id="getMonitorPointOrDeviceAvgData" resultType="java.util.Map"> + <select id="getMonitorPointOrDeviceAvgData" resultType="java.util.LinkedHashMap"> SELECT DATE_FORMAT(time, #{typeFormat}) time <foreach collection="sensorKeys" open="," separator="," item="sensorKey"> @@ -53,6 +66,9 @@ <if test="monitorPointId != null"> AND mp.id = #{monitorPointId} </if> + <if test="professionId != null"> + AND d.profession_id = #{professionId} + </if> ) </if> -- Gitblit v1.8.0