From 0915f9c21ee26c3b52a763eed9000d3b165e19ce Mon Sep 17 00:00:00 2001
From: kaiyu <404897439@qq.com>
Date: Fri, 27 Nov 2020 11:22:15 +0800
Subject: [PATCH] BS登陆接口增加返回数据regionCode 开通mapPath接口,通过token获取用户地图

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

diff --git a/src/main/resources/mapper/DemoMapper.xml b/src/main/resources/mapper/DemoMapper.xml
index 8dba101..5d37761 100644
--- a/src/main/resources/mapper/DemoMapper.xml
+++ b/src/main/resources/mapper/DemoMapper.xml
@@ -19,4 +19,18 @@
 			LIMIT #{size}
 		</if>
 	</select>
+	<select id="selectByTimeZones" resultType="map">
+		select * from hangzhou_aqi where time in (
+			SELECT max(time) from (
+			 select time,cast(aqi_json->"$.AQI" as SIGNED INTEGER) as aqi from hangzhou_aqi
+			) hz where EXISTS ( select *  from (
+						select max(cast(aqi_json->"$.AQI" as SIGNED INTEGER)) as max_aqi,
+						DATE_FORMAT(time,'%Y-%m-%d') as day_time
+						from hangzhou_aqi
+						where time >= #{startTime} and time <![CDATA[<=]]> #{endTime}
+						GROUP BY day_time
+					) as max_result where day_time = DATE_FORMAT(hz.time,'%Y-%m-%d') and  max_aqi = hz.aqi
+			) GROUP BY DATE_FORMAT(time,'%Y-%m-%d') ORDER BY time ASC
+		)
+	</select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0