From c75b4210328b98913de7eeef507e6d88069bcecc Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Thu, 13 Aug 2020 11:19:48 +0800
Subject: [PATCH] 根据算法预测明天O3,插入数据库
---
src/main/resources/mapper/AQIMapper.xml | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/src/main/resources/mapper/AQIMapper.xml b/src/main/resources/mapper/AQIMapper.xml
index 766dd54..3771b2c 100644
--- a/src/main/resources/mapper/AQIMapper.xml
+++ b/src/main/resources/mapper/AQIMapper.xml
@@ -6,10 +6,20 @@
</select>
<insert id="insertAQIData">
- INSERT INTO hangzhou_aqi (time, aqi_json,city_code) values(
+ INSERT INTO hangzhou_aqi (`time`, aqi_json,city_code) values(
#{time},
#{data},
#{code}
)
</insert>
+
+ <select id="getO3" resultType="java.util.Map">
+ select DATE_FORMAT(time, #{typeFormat}) time,
+ ifnull(aqi_json->'$.O3C',aqi_json->'$.O3') 'O3'
+ from hangzhou_aqi
+ where city_code=#{cityCode}
+ and time >= #{startTime}
+ AND time <![CDATA[<]]> #{endTime}
+ and DATE_FORMAT(time, #{typeFormat}) like '%${time}'
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0