zhubaomin
2025-06-26 e330368cb9fdfaede328c6622abac6ecbdd6f223
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