From 7a225abb600bea02ed1125f0798e6694d9da788a Mon Sep 17 00:00:00 2001
From: fengxiang <fengxiang@blit.7drlb>
Date: Fri, 10 Nov 2017 10:43:18 +0800
Subject: [PATCH] 标准更改
---
src/main/resources/mapper/HistoryEntityMapper.xml | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/main/resources/mapper/HistoryEntityMapper.xml b/src/main/resources/mapper/HistoryEntityMapper.xml
index ea7322f..cddc593 100644
--- a/src/main/resources/mapper/HistoryEntityMapper.xml
+++ b/src/main/resources/mapper/HistoryEntityMapper.xml
@@ -239,7 +239,12 @@
<select id="getAverageByAll" resultType="map">
SELECT
- h.mac_key,
+ <if test="macKey != null and macKey != 'all'">
+ e.name,
+ </if>
+ <if test="macKey == 'all'">
+ h.mac_key,
+ </if>
AVG(h.mac_value) avg
FROM
history h,
@@ -258,8 +263,14 @@
#{listItem}
</foreach>
</if>
- GROUP BY
- h.mac_key
+ <if test="macKey != null and macKey != 'all'">
+ AND h.mac_key = #{macKey}
+ GROUP BY e.id
+ ORDER BY avg
+ </if>
+ <if test="macKey == 'all'">
+ GROUP BY h.mac_key
+ </if>
</select>
<select id="getEquipmentStates" resultType="map">
@@ -275,8 +286,7 @@
#{listItem}
</foreach>
</if>
- GROUP BY
- state
+ GROUP BY state
</select>
<select id="getMacLogByLast" resultType="string">
--
Gitblit v1.8.0