From 86719a90118b4b458ae593b53457f23c11ee8d44 Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期四, 25 七月 2024 15:27:52 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayMapper.xml |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 55 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..ac46b99 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,59 @@
       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>
+
+
+  <select id="statisticsByIntake" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeAmountStatistics">
+    select intake_id, sum(amount) amount
+    from rm_intake_amount_day
+    where id <![CDATA[>=]]> #{startId, jdbcType=BIGINT} and id <![CDATA[<]]> #{endId, jdbcType=BIGINT}
+    group by intake_id
+  </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0