From a15a8cfd7b01ce4bba6fe9fd876f6704ca23a12d Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 07 一月 2025 16:40:32 +0800
Subject: [PATCH] 1、取水口用水日统计表中增加金额、次数字段; 2、优化或重写“累计流量超过指定值的取水口”、“累计流量低于指定值的取水口”、“指定时间段内用水量超过指定值的取水口”、“指定时间段内消费金额超过指定值的取水口”几个统计查询; 3、改“指定时间段内用水时长超过指定值的取水口”为“指定时间段内用水次数超过指定值的取水口”

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOnHourReportLastMapper.xml |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 50 insertions(+), 9 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOnHourReportLastMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOnHourReportLastMapper.xml
index a41ef3c..7f1859a 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOnHourReportLastMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOnHourReportLastMapper.xml
@@ -285,11 +285,13 @@
 
     <!--鑾峰彇绱娴侀噺瓒呰繃鎸囧畾鍊肩殑鍙栨按鍙�-->
     <select id="getLargeFlowIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoCumulativeFlow">
-        SELECT inta.id                                  AS intakeId,
-               inta.name                                AS intakeNum,
-               blo.name                                 AS blockName,
-               CAST(hou.total_amount AS DECIMAL(10, 2)) AS cumulativeFlow,
-               hou.dt                                   AS getDate
+        SELECT inta.id            AS intakeId,
+               inta.name          AS intakeNum,
+               inta.lng           AS lng,
+               inta.lat           AS lat,
+               blo.name           AS blockName,
+               hou.total_amount   AS cumulativeFlow,
+               hou.dt             AS getDate
         FROM pr_intake inta
                  INNER JOIN rm_on_hour_report_last hou ON hou.intake_id = inta.id
                  INNER JOIN ba_block blo ON blo.id = inta.blockId
@@ -317,10 +319,11 @@
     <select id="getSmallFlowIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoCumulativeFlow">
         SELECT inta.id   AS intakeId,
                inta.name AS intakeNum,
+               inta.lng  AS lng,
+               inta.lat  AS lat,
                blo.name  AS blockName,
-        <!--    FORMAT(hou.total_amount,2) AS cumulativeFlow,-->
-        CAST(hou.total_amount AS DECIMAL(10, 2)) AS cumulativeFlow,
-        hou.dt                                   AS getDate
+               hou.total_amount AS cumulativeFlow,
+               hou.dt    AS getDate
         FROM pr_intake inta
                  INNER JOIN rm_on_hour_report_last hou ON hou.intake_id = inta.id
                  INNER JOIN ba_block blo ON blo.id = inta.blockId
@@ -417,5 +420,43 @@
             </if>
         </trim>
     </select>
-
+    <!--鑾峰彇鏈�杩戞湭鎶ユ暟鐨勫彇姘村彛鏁伴噺-->
+    <select id="getUnReportedIntakesCount" resultType="java.lang.Long">
+        SELECT
+            count(*)
+        FROM  pr_intake pit
+        LEFT JOIN `rm_on_hour_report_last` rohrl ON pit.id = rohrl.intake_id
+        LEFT JOIN pr_controller pct ON pit.id = pct.intakeId
+        WHERE  rohrl.id is NULL
+        <if test="timeStart != null and timeStart != '' ">
+            OR rohrl.rtu_dt  &lt; #{timeStart}
+        </if>
+<!--        <if test="timeStop != null and timeStop != '' ">-->
+<!--            OR rohrl.rtu_dt &gt; #{timeStop}-->
+<!--        </if>-->
+        ORDER BY rtu_dt ASC
+    </select>
+    <!--鑾峰彇鏈�杩戞湭鎶ユ暟鐨勫彇姘村彛-->
+    <select id="getUnReportedIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeUnReported">
+        SELECT
+            pit.`name` intakeNum,
+            pct.rtuAddr,
+            rohrl.rtu_dt rtuDt
+        FROM  pr_intake pit
+        LEFT JOIN `rm_on_hour_report_last` rohrl ON pit.id = rohrl.intake_id
+        LEFT JOIN pr_controller pct ON pit.id = pct.intakeId
+        WHERE  rohrl.id is NULL
+        <if test="timeStart != null">
+            OR rohrl.rtu_dt  &lt; #{timeStart}
+        </if>
+<!--        <if test="timeStop != null">-->
+<!--            OR rohrl.rtu_dt &gt; #{timeStop}-->
+<!--        </if>-->
+        ORDER BY rtu_dt ASC
+        <trim prefix="limit ">
+            <if test="start != null and count != null">
+                #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+            </if>
+        </trim>
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0