From b029979db841167a3b2b403fdb24dfbf5ffce615 Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期一, 17 二月 2025 14:10:41 +0800
Subject: [PATCH] 代码优化

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveLastMapper.xml |   34 +++++++++++++++++++++++-----------
 1 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveLastMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveLastMapper.xml
index 034e12f..8b04ce5 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveLastMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveLastMapper.xml
@@ -522,7 +522,7 @@
         oh.cl_total_amount      AS closeTotalAmount
         FROM rm_open_close_valve_last oh
         LEFT JOIN pr_intake inta ON inta.id = oh.intake_id
-        LEFT JOIN ba_client cl ON cl.id = oh.client_id
+        LEFT JOIN se_client cl ON cl.id = oh.client_id
         <where>
             <if test="intakeId != null and intakeId > 0">
                 AND oh.intake_id = #{intakeId}
@@ -552,31 +552,43 @@
     </select>
 
     <!--鏍规嵁寮�闃�鏂瑰紡鑾峰彇鎿嶄綔娆℃暟-->
-    <select id="getCountByOpenType" resultType="java.lang.Integer">
-        SELECT COUNT(*) AS recordCount
+    <select id="getCountByOpenType" resultType="com.dy.pipIrrGlobal.voSt.VoCountOfOpenType">
+        SELECT
+        COUNT(*) AS openTypeCount,
+        op_type AS openType
         FROM rm_open_close_valve_history
         <where>
+            <if test="idStart != nul">
+                id <![CDATA[>=]]> #{idStart}
+            </if>
+            <if test="idEnd != nul">
+                AND id <![CDATA[<=]]> #{idEnd}
+            </if>
             <if test="openType != null">
                 AND op_type = #{openType}
             </if>
-            <if test="timeStart != null and timeStop != null">
-                AND op_dt BETWEEN #{timeStart} AND #{timeStop}
-            </if>
         </where>
+        group by op_type
     </select>
 
     <!--鏍规嵁鍏抽榾鏂瑰紡鑾峰彇鎿嶄綔娆℃暟-->
-    <select id="getCountByCloseType" resultType="java.lang.Integer">
-        SELECT COUNT(*) AS recordCount
+    <select id="getCountByCloseType" resultType="com.dy.pipIrrGlobal.voSt.VoCountOfCloseType">
+        SELECT
+        COUNT(*) AS closeTypeCount,
+        cl_type AS closeType
         FROM rm_open_close_valve_history
         <where>
+            <if test="idStart != nul">
+                id <![CDATA[>=]]> #{idStart}
+            </if>
+            <if test="idEnd != nul">
+                AND id <![CDATA[<=]]> #{idEnd}
+            </if>
             <if test="closeType != null">
                 AND cl_type = #{closeType}
             </if>
-            <if test="timeStart != null and timeStop != null">
-                AND cl_dt BETWEEN #{timeStart} AND #{timeStop}
-            </if>
         </where>
+        group by cl_type
     </select>
 
     <!--涓烘寚瀹氾紙闃�鎺у櫒鍦板潃銆佹按鍗$紪鍙枫�佹棤鍏抽榾璁板綍锛夊紑鍏抽榾鏈�鏂拌褰曟坊鍔犲叧闃�鏃堕棿锛屼娇涔嬩笉鍦ㄦ湭鍏抽榾璁板綍涓樉绀�-->

--
Gitblit v1.8.0