From d4c8e72800fcf6fbaa3804d383c7b6a23f826f3e Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 20 八月 2025 14:35:00 +0800
Subject: [PATCH] 修改bug
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherHistoryMapper.xml | 34 +++++++++++++++++++++++++++++++---
1 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherHistoryMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherHistoryMapper.xml
index 3019090..1259c67 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherHistoryMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherHistoryMapper.xml
@@ -20,6 +20,13 @@
id, weather_id, dt, air_temperature, air_humidity, ultraviolet, light_intensity,
rainfall, wind_speed, wind_direction
</sql>
+ <sql id="Base_Column_List_with_alias">
+ <!--@mbg.generated-->
+ ${alias}.id, ${alias}.weather_id, ${alias}.dt, ${alias}.air_temperature,
+ ${alias}.air_humidity, ${alias}.ultraviolet, ${alias}.light_intensity,
+ ${alias}.rainfall, ${alias}.wind_speed, ${alias}.wind_direction
+ </sql>
+
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
@@ -43,7 +50,7 @@
<if test = "name != null and name !=''">
AND mtb.name LIKE CONCAT('%',#{name},'%')
</if>
- <if test = "timeStart != null and timeStop != null">
+ <if test = "timeStart != null and timeStart !='' and timeStop != null and timeStop != ''">
AND htb.dt BETWEEN #{timeStart} AND #{timeStop}
</if>
</where>
@@ -52,7 +59,9 @@
<!--鏍规嵁鎸囧畾鏉′欢鏌ヨ鍘嗗彶璁板綍-->
<select id="selectSome" resultType="com.dy.pipIrrGlobal.voRm.VoWeather">
SELECT
- <include refid="Base_Column_List" />,
+ <include refid="Base_Column_List_with_alias" >
+ <property name="alias" value="htb"/>
+ </include>,
mtb.`name` AS weatherName
FROM rm_weather_history htb
INNER JOIN pr_st_weather mtb ON mtb.id = htb.weather_id
@@ -66,7 +75,7 @@
<if test = "name != null and name !=''">
AND mtb.name LIKE CONCAT('%',#{name},'%')
</if>
- <if test = "timeStart != null and timeStop != null">
+ <if test = "timeStart != null and timeStart !='' and timeStop != null and timeStop != ''">
AND htb.dt BETWEEN #{timeStart} AND #{timeStop}
</if>
</where>
@@ -77,6 +86,25 @@
</if>
</trim>
</select>
+
+
+ <!--鏍规嵁鎸囧畾鏉′欢鏌ヨ娓╁害鐨勬渶澶у�间笌鏈�灏忓��-->
+ <select id="selectMaxMinTemperature" resultType="com.dy.pipIrrGlobal.voRm.VoWeatherMaxMinTmp">
+ SELECT max(air_temperature) maxAirTemperature, min(air_temperature) minAirTemperature
+ FROM rm_weather_history tb
+ <where>
+ <if test="weatherId != null">
+ AND tb.weather_id = #{weatherId}
+ </if>
+ <if test="startId != null">
+ AND tb.id >= #{startId}
+ </if>
+ <if test="endId != null">
+ AND tb.id <= #{endId}
+ </if>
+ </where>
+ </select>
+
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--@mbg.generated-->
delete from rm_weather_history
--
Gitblit v1.8.0