From 4c649e1e6fcaa7d8952e84ef6a909a546a1a52cf Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期三, 24 七月 2024 17:22:49 +0800
Subject: [PATCH] 漏损历史记录 漏损最新记录

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

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayMapper.xml
index f96ad0c..b48119a 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayMapper.xml
@@ -155,4 +155,51 @@
       rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=BIGINT}
   </update>
+  <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍鎬绘暟-->
+  <select id="getRecordCount" resultType="java.lang.Long">
+    select count(*)
+    from rm_intake_amount_day riad
+    Left join pr_intake pint on pint.id = riad.intake_id
+    <where>
+      <if test="intakeName != null">
+        and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%')
+      </if>
+      <if test="startDt != null">
+        and riad.dt &gt;= #{startDt,jdbcType=DATE}
+      </if>
+      <if test="endDt != null">
+        and riad.dt &lt;= #{endDt,jdbcType=DATE}
+      </if>
+    </where>
+    </select>
+  <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍-->
+  <select id="getIntakeAmountDayHistory" resultType="com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay">
+    select
+    CAST(riad.intake_id AS char)AS intakeId,
+    pint.name as intakeName,
+    riad.dt as dt,
+    riad.amount as amount,
+    riad.dt_last as dtLast,
+    riad.rtu_addr_last as rtuAddrLast,
+    CAST(riad.controller_id_last AS char)AS controllerIdLast,
+    riad.total_amount_last as totalAmountLast,
+    riad.rtu_dt_last as rtuDtLast
+    from rm_intake_amount_day riad
+    Left join pr_intake pint on pint.id = riad.intake_id
+    <where>
+      <if test="intakeName != null">
+        and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%')
+      </if>
+      <if test="startDt != null">
+        and riad.dt &gt;= #{startDt,jdbcType=DATE}
+      </if>
+      <if test="endDt != null">
+        and riad.dt &lt;= #{endDt,jdbcType=DATE}
+      </if>
+    </where>
+    ORDER BY riad.id DESC
+    <if test="pageCurr != null and pageSize != null">
+      LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}
+    </if>
+  </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0