From aed7e2e6ba8da5b7931a0a97293ba57f57d1a8cd Mon Sep 17 00:00:00 2001 From: xufenglei <xufenglei> Date: Tue, 03 Apr 2018 10:31:38 +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