From 3152a4e4dadcd6ebfb8e882aa356d063416d49cc Mon Sep 17 00:00:00 2001
From: kaiyu <404897439@qq.com>
Date: Tue, 24 Nov 2020 09:58:26 +0800
Subject: [PATCH] Merge branch 'master' of http://blit.7drlb.com:8888/r/screen_job
---
src/main/resources/mapper/WeatherMapper.xml | 23 +++++++++++++++++++----
1 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/src/main/resources/mapper/WeatherMapper.xml b/src/main/resources/mapper/WeatherMapper.xml
index 06ce0a4..51d8c73 100644
--- a/src/main/resources/mapper/WeatherMapper.xml
+++ b/src/main/resources/mapper/WeatherMapper.xml
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.moral.mapper.WeatherMapper">
- <cache/>
<select id="getCityWeatherConfig" resultType="java.util.Map">
select city_code AS cityCode,
@@ -116,11 +115,20 @@
)
</select>
- <select id="getSampleFromHistoryWeather" resultType="java.lang.String" useCache="true">
+ <select id="getSampleFromHistoryWeather" resultType="java.lang.String">
select DATE_FORMAT(time, #{typeFormat}) as time
from history_weather_${timeUnits}
<where>
city_code=#{cityCode}
+
+ <if test="windDir != null">
+ and value->'$.windDir' = #{windDir}
+ </if>
+
+ <if test="windScale != null">
+ and value->'$.windScale' = #{windScale}
+ </if>
+
<if test="condition == 0">
and cast(value->'$.condition' as UNSIGNED integer) > #{score}
</if>
@@ -160,10 +168,13 @@
</foreach>
</if>
+ <if test="month != null">
+ and DATE_FORMAT(time, '%m') = #{month}
+ </if>
</where>
</select>
- <select id="getSampleFromRealWeather" resultType="java.lang.String" useCache="true">
+ <select id="getSampleFromRealWeather" resultType="java.lang.String">
select DATE_FORMAT(time, #{typeFormat}) as time
from real_weather
<where>
@@ -171,6 +182,10 @@
<if test="windDir != null">
and json->'$.windDir' = #{windDir}
+ </if>
+
+ <if test="windScale != null">
+ and json->'$.windScale' = #{windScale}
</if>
<if test="condition == 0">
@@ -213,7 +228,7 @@
</if>
<if test="month != null">
- and DATE_FORMAT(time, '%m')=#{month}
+ and DATE_FORMAT(time, '%m') = #{month}
</if>
</where>
</select>
--
Gitblit v1.8.0