From 1cc6ad886f9df129d648b02ff5da1e7ab9b2ded3 Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期三, 03 七月 2024 15:57:13 +0800
Subject: [PATCH] 2024-07-03 朱宝民 小程序远程开阀支持扫码开阀

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 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 5560dca..363e4e2 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,6 +407,7 @@
         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>
@@ -421,7 +422,7 @@
                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.rtuAddr
+           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},
@@ -436,4 +437,9 @@
       </if>
     </where>
   </select>
+
+  <!--鍙栨按鍙e悕绉版崲鍙栨按鍙D锛屾壂鐮佸紑闃�浣跨敤-->
+  <select id="getIntakeIdByName" resultType="java.lang.Long">
+    SELECT id AS intakeId FROM pr_intake WHERE `name` = #{intakeName}
+  </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0