From 2e2861fd0bbba403a15a212c550bed9f8331f467 Mon Sep 17 00:00:00 2001
From: xufenglei <xufenglei>
Date: Mon, 15 Jan 2018 17:14:13 +0800
Subject: [PATCH] 更新 查询

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

diff --git a/src/main/resources/mapper/HistoryEntityMapper.xml b/src/main/resources/mapper/HistoryEntityMapper.xml
index 3089c66..2d1c61d 100644
--- a/src/main/resources/mapper/HistoryEntityMapper.xml
+++ b/src/main/resources/mapper/HistoryEntityMapper.xml
@@ -332,4 +332,21 @@
 		GROUP BY
 			time
 	</select>
+	
+	<select id="getDayAQIByDevice" resultType="map">
+		SELECT
+			AVG(json -> '$.e1[0]') e1,
+			AVG(json -> '$.e2[0]') e2,
+			AVG(json -> '$.e10[0]') e10,
+			AVG(json -> '$.e11[0]') e11,
+			AVG(json -> '$.e15[0]') e15,
+			AVG(json -> '$.e16[0]') e16
+		FROM
+			data
+		WHERE
+			mac = #{mac}
+		AND time >= #{start}
+		AND time &lt; #{end}
+	</select>
+	
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0