From cc956d4366d31f0cdd97dcb851a880cbd7660d0f Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期六, 03 八月 2024 11:03:16 +0800
Subject: [PATCH] 2024-08-03 朱宝民 获取电池电压低于指定值的取水口

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOnHourReportLastMapper.xml |   91 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 91 insertions(+), 0 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 2d91d54..8ce03ba 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOnHourReportLastMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOnHourReportLastMapper.xml
@@ -262,4 +262,95 @@
       </if>
     </trim>
   </select>
+
+  <!--鑾峰彇绱娴侀噺瓒呰繃鎸囧畾鍊肩殑鍙栨按鍙f暟閲�-->
+  <select id="getLargeFlowIntakesCount" resultType="java.lang.Long">
+    SELECT
+    COUNT(*) AS recordCount
+    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
+    WHERE inta.deleted = 0 AND hou.total_amount > #{totalAmount}
+  </select>
+
+  <!--鑾峰彇绱娴侀噺瓒呰繃鎸囧畾鍊肩殑鍙栨按鍙�-->
+  <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
+    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
+    WHERE inta.deleted = 0 AND hou.total_amount > #{totalAmount}
+    ORDER BY hou.dt
+    <trim prefix="limit " >
+      <if test="start != null and count != null">
+        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+      </if>
+    </trim>
+  </select>
+
+  <!--鑾峰彇绱娴侀噺浣庝簬鎸囧畾鍊肩殑鍙栨按鍙f暟閲�-->
+  <select id="getSmallFlowIntakesCount" resultType="java.lang.Long">
+    SELECT
+    COUNT(*) AS recordCount
+    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
+    WHERE inta.deleted = 0 AND hou.total_amount &lt; #{totalAmount}
+  </select>
+
+  <!--鑾峰彇绱娴侀噺浣庝簬鎸囧畾鍊肩殑鍙栨按鍙�-->
+  <select id="getSmallFlowIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoCumulativeFlow">
+    SELECT
+    inta.id AS intakeId,
+    inta.name AS intakeNum,
+    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
+    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
+    WHERE inta.deleted = 0 AND hou.total_amount &lt; #{totalAmount}
+    ORDER BY hou.dt
+    <trim prefix="limit " >
+      <if test="start != null and count != null">
+        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+      </if>
+    </trim>
+  </select>
+
+  <!--鑾峰彇娆犲帇鍙栨按鍙f暟閲�-->
+  <select id="getUnderVoltIntakesCount" resultType="java.lang.Long">
+    SELECT
+    COUNT(*) AS recordCount
+    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
+    WHERE inta.deleted = 0 AND hou.battery_volt &lt; #{batteryVolt}
+  </select>
+
+  <!--鑾峰彇娆犲帇鍙栨按鍙�-->
+  <select id="getUnderVoltIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoBatteryVolt">
+    SELECT
+    inta.id AS intakeId,
+    inta.name AS intakeNum,
+    blo.name AS blockName,
+    hou.battery_volt AS batteryVolt,
+    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
+    WHERE inta.deleted = 0 AND hou.battery_volt &lt; #{batteryVolt}
+    ORDER BY hou.dt
+    <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