From 8a4fccc993cbef14b83443d91e51e9b74664eab5 Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Mon, 10 Aug 2020 11:18:46 +0800
Subject: [PATCH] update
---
src/main/resources/mapper/HangzhouAqiMapper.xml | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/main/resources/mapper/HangzhouAqiMapper.xml b/src/main/resources/mapper/HangzhouAqiMapper.xml
index dff422f..5e1a166 100644
--- a/src/main/resources/mapper/HangzhouAqiMapper.xml
+++ b/src/main/resources/mapper/HangzhouAqiMapper.xml
@@ -71,7 +71,7 @@
<select id="getAqiDataByAreaCode" resultType="java.util.Map">
SELECT
DATE_FORMAT(time, #{typeFormat}) time,
- ifnull(aqi_json->'$.O3C',"") as 'O3'
+ ifnull(aqi_json->'$.O3C',aqi_json->'$.O3') as 'O3'
FROM
hangzhou_aqi ha
WHERE
@@ -91,21 +91,20 @@
WHERE
time >= #{start}
AND time <![CDATA[<]]> #{end}
- AND city_code = #{areaCode}
+ AND city_code = #{cityCode}
ORDER BY
time
</select>
<select id="getAvgO3EightHours" resultType="java.util.Map">
select
- AVG(aqi_json->'$.O3') 'O3_8H',
- AVG(aqi_json->'$.O3C') 'O3C_8H'
+ AVG(case when aqi_json->'$.O3C' is null then aqi_json->'$.O3' else aqi_json->'$.O3C' end) as 'O3C_8H'
FROM
hangzhou_aqi
WHERE
time >= #{start}
AND time <![CDATA[<]]> #{end}
- AND city_code = #{areaCode}
+ AND city_code = #{cityCode}
</select>
</mapper>
--
Gitblit v1.8.0