From f4faf482bcfab63425c9aff0862ad828d71d85a4 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期三, 25 六月 2025 16:59:03 +0800 Subject: [PATCH] 水肥历史数据、最新数据分布条件查询 --- pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmManureLastMapper.xml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 54 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmManureLastMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmManureLastMapper.xml index e428cde..c1bbf6f 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmManureLastMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmManureLastMapper.xml @@ -47,6 +47,60 @@ </where> limit 0,1 </select> + + + <!--鏍规嵁鎸囧畾鏉′欢鏌ヨ鍘嗗彶璁板綍鏁伴噺--> + <select id="selectCount" resultType="java.lang.Long"> + SELECT + COUNT(*) AS recordCount + FROM rm_manure_last ltb + INNER JOIN pr_st_manure mtb ON mtb.id = ltb.manure_id + <where> + <if test="manureId != null"> + AND ltb.manure_id = #{manureId} + </if> + <if test = "no != null"> + AND mtb.no = #{no} + </if> + <if test = "name != null and name !=''"> + AND mtb.name LIKE CONCAT('%',#{intakeNum},'%') + </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.VoManure"> + SELECT + <include refid="Base_Column_List" />, + mtb.`name` AS manureName + FROM rm_manure_last ltb + INNER JOIN pr_st_manure mtb ON mtb.id = ltb.manure_id + <where> + <if test="manureId != null"> + AND ltb.manure_id = #{manureId} + </if> + <if test = "no != null"> + AND mtb.no = #{no} + </if> + <if test = "name != null and name !=''"> + AND mtb.name LIKE CONCAT('%',#{intakeNum},'%') + </if> + <if test = "timeStart != null and timeStop != null"> + AND ltb.dt BETWEEN #{timeStart} AND #{timeStop} + </if> + </where> + ORDER BY ltb.manure_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> + + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> <!--@mbg.generated--> delete from rm_manure_last -- Gitblit v1.8.0