From 25fae4a8608a91c5aae1db876a13cffd6418f573 Mon Sep 17 00:00:00 2001
From: kaiyu <404897439@qq.com>
Date: Mon, 30 Nov 2020 16:02:38 +0800
Subject: [PATCH] 删除测试代码
---
src/main/resources/mapper/ForecastWeatherMapper.xml | 37 ++++++++++++++++++++++++-------------
1 files changed, 24 insertions(+), 13 deletions(-)
diff --git a/src/main/resources/mapper/ForecastWeatherMapper.xml b/src/main/resources/mapper/ForecastWeatherMapper.xml
index 2e04576..9ce0208 100644
--- a/src/main/resources/mapper/ForecastWeatherMapper.xml
+++ b/src/main/resources/mapper/ForecastWeatherMapper.xml
@@ -2,16 +2,16 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.moral.mapper.ForecastWeatherMapper">
<resultMap id="BaseResultMap" type="com.moral.entity.ForecastWeather">
- <id column="monitor_point_id" property="monitorPointId" jdbcType="INTEGER"/>
+ <id column="city_code" property="cityCode" jdbcType="INTEGER"/>
</resultMap>
<select id="getForecastHour" resultType="java.util.Map">
SELECT
DATE_FORMAT(time, #{typeFormat}) time,
- (case when result is null then json->'$.temp' else result end) result
+ json->'$.${sensor1}' '${sensor2}'
from forecast_weather
where time >= #{start}
AND time <![CDATA[<]]> #{end}
- AND monitor_point_id=#{monitorPointId}
+ AND city_code=#{cityCode}
</select>
<select id="getForecast" resultType="java.util.Map">
@@ -20,26 +20,37 @@
from forecast_weather
where time >= #{start}
AND time <![CDATA[<]]> #{end}
- AND monitor_point_id=#{monitorPointId}
+ AND city_code=#{cityCode}
ORDER BY
time
</select>
<update id="updateForecastWeather">
update forecast_weather set json=#{json}
- where monitor_point_id=#{monitorPointId}
+ where city_code=#{cityCode}
and time=#{time}
</update>
<select id="getPrecip6Hour" resultType="java.util.Map">
- select
- round(sum(json->'$.precip'),2) 'precip6'
- FROM
- forecast_weather
- WHERE
- time >= #{start}
- AND time <![CDATA[<]]> #{end}
- AND monitor_point_id = #{monitorPointId}
+ select
+ round(sum(json->'$.precip'),2) 'precip6'
+ FROM
+ forecast_weather
+ WHERE
+ time >= #{start}
+ AND time <![CDATA[<]]> #{end}
+ AND city_code = #{cityCode}
+ </select>
+
+ <select id="getO38Hours" resultType="java.util.Map">
+ select
+ cast(AVG(json->'$.O3C') as UNSIGNED integer) 'O3_8H'
+ FROM
+ forecast_weather
+ WHERE
+ time >= #{start}
+ AND time <![CDATA[<]]> #{end}
+ AND city_code = #{cityCode}
</select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0