From d1c0c991624ecb68bf44cbae163eaf28640296df Mon Sep 17 00:00:00 2001
From: xufenglei <xufenglei>
Date: Fri, 03 Nov 2017 14:23:02 +0800
Subject: [PATCH] json  警报值接口

---
 src/main/resources/mapper/HistoryEntityMapper.xml |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/HistoryEntityMapper.xml b/src/main/resources/mapper/HistoryEntityMapper.xml
index ea7322f..c0d79d5 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
+			<if test="macKey == 'all'">
 			h.mac_key,
+			</if>	
+			<if test="macKey != null and macKey != 'all'">
+			e.name,
+			</if>	
 			AVG(h.mac_value) avg
 		FROM
 			history h,
@@ -258,8 +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}
+		</if>	
 	</select>
 
 	<select id="getEquipmentStates" resultType="map">

--
Gitblit v1.8.0