From a8157b2445e6d17fa23fcf19143f5e1fcb179ee2 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期一, 16 十二月 2024 10:09:40 +0800
Subject: [PATCH] 实现临时任务功能:重新统计所有取水口月用水量和年用水量

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/Temp4ChangeMapper.xml |   62 +++++++++++++++++++++++++++++++
 1 files changed, 62 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 2c0bfcd..1380e68 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/Temp4ChangeMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/Temp4ChangeMapper.xml
@@ -28,4 +28,66 @@
         set amount = #{amount, jdbcType=FLOAT}
         where id = #{id, jdbcType=BIGINT}
     </update>
+
+
+    <delete id="deleteAllIntakeAmountMonth">
+        delete from st_intake_amount_month
+    </delete>
+
+    <!--  -->
+    <select id="statisticAllIntakeAmountMonthFromAmountDay" resultType="com.dy.pipIrrGlobal.pojoSt.StIntakeAmountMonth">
+        select intake_id as intakeId ,
+        sum(amount) as amount
+        from  rm_intake_amount_day
+        where dt <![CDATA[>=]]> #{startDt, jdbcType=DATE}
+        and dt <![CDATA[<=]]> #{endDt, jdbcType=DATE}
+        group by intake_id
+    </select>
+
+    <insert id="saveOneIntakeAmountMonth" parameterType="com.dy.pipIrrGlobal.pojoSt.StIntakeAmountMonth">
+        <!--@mbg.generated-->
+        insert into st_intake_amount_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="deleteAllIntakeAmountYear">
+        delete from st_intake_amount_year
+    </delete>
+
+    <!--  -->
+    <select id="statisticAllIntakeAmountYearFromAmountDay" resultType="com.dy.pipIrrGlobal.pojoSt.StIntakeAmountYear">
+        select intake_id as intakeId ,
+        sum(amount) as amount
+        from  rm_intake_amount_day
+        where dt <![CDATA[>=]]> #{startDt, jdbcType=DATE}
+        and dt <![CDATA[<=]]> #{endDt, jdbcType=DATE}
+        group by intake_id
+    </select>
+
+    <insert id="saveOneIntakeAmountYear" parameterType="com.dy.pipIrrGlobal.pojoSt.StIntakeAmountYear">
+        <!--@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