From 81dc94a70de69f45f42b8ca4b702a3a372cf81ac Mon Sep 17 00:00:00 2001
From: lizijie <lzjiiie@163.com>
Date: Tue, 24 May 2022 09:59:07 +0800
Subject: [PATCH] 去除打印
---
src/main/resources/mapper/AQIMapper.xml | 42 +++++++++++++++++++++++++++++++++++++++---
1 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/src/main/resources/mapper/AQIMapper.xml b/src/main/resources/mapper/AQIMapper.xml
index 3771b2c..2e80b9d 100644
--- a/src/main/resources/mapper/AQIMapper.xml
+++ b/src/main/resources/mapper/AQIMapper.xml
@@ -13,13 +13,49 @@
)
</insert>
+ <select id="getStationConfig" resultType="java.util.Map">
+ select station_code,city_code from aqi_station_config
+ </select>
+
+ <insert id="insertStationData">
+ insert into
+ history_aqi_station
+ values
+ <foreach collection="list" item="item" separator=",">
+ (#{item.time},#{item.json},#{item.stationCode},#{item.cityCode})
+ </foreach>
+ </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}'
+ and DATE_FORMAT(time, #{typeFormat}) in
+ <foreach collection="times" open="(" separator="," close=")" item="time">
+ #{time}
+ </foreach>
+ </select>
+
+ <select id="getAqiFromHangzhou" resultType="java.lang.String">
+ select ifnull(aqi_json->'$.${sensorKey}',aqi_json->'$.${sensorKey1}') as '${sensorKey}'
+ from hangzhou_aqi
+ where city_code=#{cityCode}
+ and DATE_FORMAT(time, #{typeFormat})=#{time}
+ </select>
+
+ <select id="getAqiByHour" resultType="java.util.Map">
+ select DATE_FORMAT(time, '%Y-%m-%d %H:%i:%s') time,
+ value
+ from history_aqi_${timeUnits}
+ where city_code=#{cityCode}
+ and DATE_FORMAT(time, '%Y%H')=#{yearAndHour}
+ </select>
+
+ <select id="getAqiFromHistory" resultType="java.lang.String">
+ select value ->'$.${sensorKey}' as '${sensorKey}'
+ from history_aqi_${timeUnits}
+ where city_code=#{cityCode}
+ and DATE_FORMAT(time, #{typeFormat})=#{time}
</select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0