From d502caad139eb06678c89a281bf63dbc19adb228 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 26 六月 2025 09:54:21 +0800
Subject: [PATCH] 水肥机、墒情站、气象站历史数据、最新数据查询

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherLastMapper.xml |   67 +++++++++++++++++++++++++++++++++
 1 files changed, 67 insertions(+), 0 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherLastMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherLastMapper.xml
index 4014fc3..9be0f00 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherLastMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherLastMapper.xml
@@ -41,6 +41,73 @@
     </where>
     limit 0,1
   </select>
+
+
+
+  <!--鏍规嵁鎸囧畾鏉′欢鏌ヨ璁板綍鏁伴噺-->
+  <select id="selectCount" resultType="java.lang.Long">
+    SELECT
+    COUNT(*) AS recordCount
+    FROM rm_weather_last ltb
+    INNER JOIN pr_st_weather mtb ON mtb.id = ltb.weather_id
+    <where>
+      <if test="weatherId != null">
+        AND ltb.weather_id = #{weatherId}
+      </if>
+      <if test = "no != null">
+        AND mtb.no = #{no}
+      </if>
+      <if test = "name != null and name !=''">
+        AND mtb.name LIKE CONCAT('%',#{name},'%')
+      </if>
+      <if test = "timeStart != null and timeStop != null">
+        AND ltb.dt BETWEEN #{timeStart} AND #{timeStop}
+      </if>
+    </where>
+  </select>
+
+  <!--鏍规嵁鎸囧畾鏉′欢鏌ヨ璁板綍-->
+  <select id="selectSome" resultType="com.dy.pipIrrGlobal.voRm.VoWeather">
+    SELECT
+    <include refid="Base_Column_List" />,
+    mtb.`name` AS weatherName
+    FROM rm_weather_last ltb
+    INNER JOIN pr_st_weather mtb ON mtb.id = ltb.weather_id
+    <where>
+      <if test="weatherId != null">
+        AND ltb.weather_id = #{weatherId}
+      </if>
+      <if test = "no != null">
+        AND mtb.no = #{no}
+      </if>
+      <if test = "name != null and name !=''">
+        AND mtb.name LIKE CONCAT('%',#{name},'%')
+      </if>
+      <if test = "timeStart != null and timeStop != null">
+        AND ltb.dt BETWEEN #{timeStart} AND #{timeStop}
+      </if>
+    </where>
+    ORDER BY ltb.weather_id DESC
+    <trim prefix="limit " >
+      <if test="start != null and count != null">
+        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+      </if>
+    </trim>
+  </select>
+
+  <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍-->
+  <select id="selectSomeByWeatherId" resultType="com.dy.pipIrrGlobal.voRm.VoWeather">
+    select
+    <include refid="Base_Column_List" />
+    from rm_weather_last
+    <where>
+      <if test="weatherId != null">
+        and weather_id = #{weatherId}
+      </if>
+    </where>
+    limit 0,1
+  </select>
+
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     <!--@mbg.generated-->
     delete from rm_weather_last

--
Gitblit v1.8.0