From 71d49c588d62385a57a2ea5434f3c407a1d5c1ca Mon Sep 17 00:00:00 2001 From: xufenglei <xufenglei> Date: Fri, 30 Mar 2018 15:59:27 +0800 Subject: [PATCH] 调整 计算平均值算法 --- src/main/resources/mapper/HistoryMinutelyMapper.xml | 24 ++++++++++++++++++++---- 1 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/main/resources/mapper/HistoryMinutelyMapper.xml b/src/main/resources/mapper/HistoryMinutelyMapper.xml index 9fb4382..4e9e4c3 100644 --- a/src/main/resources/mapper/HistoryMinutelyMapper.xml +++ b/src/main/resources/mapper/HistoryMinutelyMapper.xml @@ -34,10 +34,26 @@ </if> <if test="mac == null"> AND h.mac IN - <foreach collection="macs" open="(" separator="," close=")" item="listItem"> - #{listItem} - </foreach> - + (SELECT + d.mac + FROM + device d, + monitor_point mp + WHERE + d.monitor_point_id = mp.id + <if test="provinceCode != null"> + AND mp.province_code = #{provinceCode} + </if> + <if test="cityCode != null"> + AND mp.city_code = #{cityCode} + </if> + <if test="areaCode != null"> + AND mp.area_code = #{areaCode} + </if> + <if test="monitorPointId != null"> + AND mp.id = #{monitorPointId} + </if> + ) </if> GROUP BY -- Gitblit v1.8.0