From ff08d741fcec20ebb6ef95514a59704a06a13a8b Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 20 六月 2024 10:47:06 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml |   30 ++++++++++++++++++++++++++++--
 1 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml
index 920ffce..2ee04fa 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml
@@ -364,7 +364,7 @@
         COUNT(*) AS recordCount
     FROM pr_controller con
         INNER JOIN pr_intake inta ON con.intakeId = inta.id
-        INNER JOIN JSON_TABLE(
+        left JOIN JSON_TABLE(
         <!--'[{"rtuAddr":"37142501020100215","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',-->
         #{onLineMap},
         '$[*]' COLUMNS(
@@ -391,7 +391,7 @@
       rtus.isOnLine
     FROM pr_controller con
         INNER JOIN pr_intake inta ON con.intakeId = inta.id
-        INNER JOIN JSON_TABLE(
+        left JOIN JSON_TABLE(
             <!--'[{"rtuAddr":"37142501020100215","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',-->
             #{onLineMap},
             '$[*]' COLUMNS(
@@ -407,8 +407,34 @@
         AND inta.name LIKE CONCAT('%', #{intakeNum}, '%')
       </if>
     </where>
+    order by con.id ASC
     <if test="pageCurr != null and pageSize != null">
       LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}
     </if>
   </select>
+
+  <!--鏍规嵁鎿嶄綔鍛樿幏鍙栧父鐢ㄥ彇姘村彛-->
+  <select id="getUsedIntakes" resultType="com.dy.pipIrrGlobal.voPr.VoOnLineIntake">
+    SELECT
+      DISTINCT con.intakeId,
+               con.rtuAddr,
+               inta.name AS intakeNum,
+               rtus.isOnLine
+    FROM pr_controller con
+           INNER JOIN pr_intake inta ON con.intakeId = inta.id
+           INNER JOIN rm_command_history com ON con.rtuAddr = com.rtu_addr
+           INNER JOIN JSON_TABLE(
+            <!--'[{"rtuAddr":"37142501020100215","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',-->
+            #{onLineMap},
+            '$[*]' COLUMNS(
+                rtuAddr VARCHAR(20) PATH '$.rtuAddr',
+		        isOnLine BOOLEAN PATH '$.isOnLine'
+	        )
+      ) rtus ON con.rtuAddr = rtus.rtuAddr
+    <where>
+      <if test="operator != null">
+        com.operator = #{operator}
+      </if>
+    </where>
+  </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0