From 999d8a80d9a1c1f20033c29e7e2a08951766bee8 Mon Sep 17 00:00:00 2001
From: fengxiang <fengxiang@blit.7drlb>
Date: Mon, 13 Nov 2017 16:16:34 +0800
Subject: [PATCH] Merge branch 'master' of http://fengxiang@blit.7drlb.com:8888/r/task.git
---
src/main/resources/mapper/HistoryEntityMapper.xml | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/main/resources/mapper/HistoryEntityMapper.xml b/src/main/resources/mapper/HistoryEntityMapper.xml
index c0d79d5..cddc593 100644
--- a/src/main/resources/mapper/HistoryEntityMapper.xml
+++ b/src/main/resources/mapper/HistoryEntityMapper.xml
@@ -239,11 +239,11 @@
<select id="getAverageByAll" resultType="map">
SELECT
- <if test="macKey == 'all'">
- h.mac_key,
- </if>
<if test="macKey != null and macKey != 'all'">
- e.name,
+ e.name,
+ </if>
+ <if test="macKey == 'all'">
+ h.mac_key,
</if>
AVG(h.mac_value) avg
FROM
@@ -263,12 +263,13 @@
#{listItem}
</foreach>
</if>
- <if test="macKey == 'all'">
- GROUP BY
- h.mac_key
- </if>
<if test="macKey != null and macKey != 'all'">
- AND h.mac_key = #{macKey}
+ AND h.mac_key = #{macKey}
+ GROUP BY e.id
+ ORDER BY avg
+ </if>
+ <if test="macKey == 'all'">
+ GROUP BY h.mac_key
</if>
</select>
@@ -285,8 +286,7 @@
#{listItem}
</foreach>
</if>
- GROUP BY
- state
+ GROUP BY state
</select>
<select id="getMacLogByLast" resultType="string">
--
Gitblit v1.8.0