From 352166b90fa119725cd54bba314216801e92a037 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 24 十二月 2024 10:13:49 +0800
Subject: [PATCH] 取水漏损日月度统计数量不正确,编程进行修改调整

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

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/Temp4ChangeMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/Temp4ChangeMapper.xml
index 1380e68..3e94ae3 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/Temp4ChangeMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/Temp4ChangeMapper.xml
@@ -10,6 +10,11 @@
         order by id ASC
     </select>
 
+    <!-- ======================================= -->
+    <!--                                         -->
+    <!-- 鍙栨按閲�                                   -->
+    <!--                                         -->
+    <!--  ====================================== -->
     <!-- 鍙栨按鍙e彇姘撮噺鏃ョ粺璁$浉鍏�, 姝QL涓殑 鈥漮rder by id ASC 鈥滀笉鍙慨鏀� -->
     <select id="selectOneIntakeAllAmountDay" resultType="com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay">
         select id as id,
@@ -90,4 +95,93 @@
         )
     </insert>
 
+
+    <!-- ======================================= -->
+    <!--                                         -->
+    <!-- 婕忔崯                                     -->
+    <!--                                         -->
+    <!--  ====================================== -->
+    <!-- 鍙栨按鍙f紡鎹熸棩缁熻鐩稿叧, 姝QL涓殑 鈥漮rder by id ASC 鈥滀笉鍙慨鏀� -->
+    <select id="selectOneIntakeAllLossDay" resultType="com.dy.pipIrrGlobal.pojoRm.RmLossDay">
+        select id as id,
+        intake_id as intakeId ,
+        dt as dt,
+        loss_amount as lossAmount
+        from  rm_loss_day
+        where intake_id = #{intakeId}
+        order by id ASC
+    </select>
+
+    <!-- 淇敼鍙栨按鍙f紡鎹熸棩缁熻 -->
+    <update id="updateOneIntakeLossDay" >
+        update rm_loss_day
+        set loss_amount = #{loss, jdbcType=FLOAT}
+        where id = #{id, jdbcType=BIGINT}
+    </update>
+
+
+
+    <delete id="deleteAllIntakeLossMonth">
+        delete from st_loss_month
+    </delete>
+
+    <!--  -->
+    <select id="statisticAllIntakeLossMonthFromLossDay" resultType="com.dy.pipIrrGlobal.pojoSt.StLossMonth">
+        select intake_id as intakeId ,
+        sum(loss_amount) as amount
+        from  rm_loss_day
+        where dt <![CDATA[>=]]> #{startDt, jdbcType=DATE}
+        and dt <![CDATA[<=]]> #{endDt, jdbcType=DATE}
+        group by intake_id
+    </select>
+
+    <insert id="saveOneIntakeLossMonth" parameterType="com.dy.pipIrrGlobal.pojoSt.StLossMonth">
+        <!--@mbg.generated-->
+        insert into st_loss_month (
+        id,
+        intake_id,
+        year,
+        month,
+        amount
+        )
+        values (#{id,jdbcType=BIGINT},
+        #{intakeId,jdbcType=BIGINT},
+        #{year,jdbcType=INTEGER},
+        #{month,jdbcType=INTEGER},
+        #{amount,jdbcType=FLOAT}
+        )
+    </insert>
+
+
+
+    <delete id="deleteAllIntakeLossYear">
+        delete from st_loss_year
+    </delete>
+
+    <!--  -->
+    <select id="statisticAllIntakeLossYearFromLossDay" resultType="com.dy.pipIrrGlobal.pojoSt.StLossYear">
+        select intake_id as intakeId ,
+        sum(loss_amount) as amount
+        from  rm_loss_day
+        where dt <![CDATA[>=]]> #{startDt, jdbcType=DATE}
+        and dt <![CDATA[<=]]> #{endDt, jdbcType=DATE}
+        group by intake_id
+    </select>
+
+    <insert id="saveOneIntakeLossYear" parameterType="com.dy.pipIrrGlobal.pojoSt.StLossYear">
+        <!--@mbg.generated-->
+        insert into st_intake_amount_year (
+        id,
+        intake_id,
+        year,
+        amount
+        )
+        values (#{id,jdbcType=BIGINT},
+        #{intakeId,jdbcType=BIGINT},
+        #{year,jdbcType=INTEGER},
+        #{amount,jdbcType=FLOAT}
+        )
+    </insert>
+
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0