From b1efc0133ea18fb133872a24e537234258faaea5 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 31 十月 2024 10:53:40 +0800
Subject: [PATCH] 最新开关阀报不能查询出农户信息,因为SQL语句错误,修改之。

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml |   12 ++++++------
 1 files changed, 6 insertions(+), 6 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 329b4be..a75444d 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml
@@ -232,7 +232,7 @@
         LEFT JOIN ba_district village ON ge.villageId = village.id
         LEFT JOIN pr_controller cont ON ge.id = cont.intakeId
         <if test = "bindNumber != null and bindNumber > 0">
-            JOIN (SELECT intakeId, COUNT(*) num FROM pr_intake_controller WHERE operateType = 1 group by intakeId) AS bindNumTb on bindNumTb.intakeId= ge.id
+            LEFT JOIN (SELECT intakeId, COUNT(*) num FROM pr_intake_controller WHERE operateType = 1 group by intakeId) AS bindNumTb on bindNumTb.intakeId= ge.id
         </if>
         <where>
             ge.deleted = 0
@@ -302,7 +302,7 @@
         LEFT JOIN ba_district town ON ge.townId = town.id
         LEFT JOIN ba_district village ON ge.villageId = village.id
         LEFT JOIN pr_controller cont ON ge.id = cont.intakeId
-        JOIN (SELECT intakeId, COUNT(*) num FROM pr_intake_controller WHERE operateType = 1 group by intakeId) AS bindNumTb on bindNumTb.intakeId= ge.id
+        LEFT JOIN (SELECT intakeId, COUNT(*) num FROM pr_intake_controller WHERE operateType = 1 group by intakeId) AS bindNumTb on bindNumTb.intakeId= ge.id
         <where>
             ge.deleted = 0
             AND divi.deleted = 0
@@ -645,8 +645,8 @@
         FROM pr_common_intakes com
             INNER JOIN pr_intake inta ON inta.id = com.intake_id
             INNER JOIN pr_controller con ON con.intakeId = com.intake_id
-            INNER JOIN JSON_TABLE(
-                <!--'[{"rtuAddr":"620201000030","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',-->
+            LEFT JOIN JSON_TABLE(
+                <!--'[{"rtuAddr":"530115059980","isOnLine":true},{"rtuAddr":"620201000030","isOnLine":true}]',-->
                 #{onLineMap},
                 '$[*]' COLUMNS (
                     rtuAddr VARCHAR(20) PATH '$.rtuAddr',
@@ -654,8 +654,8 @@
                 )
             ) rtus ON con.rtuAddr = rtus.rtuAddr
         <where>
-            <if test="operator != null">
-                com.operator_id = #{operator}
+            <if test="operatorId != null">
+                AND com.operator_id = #{operatorId}
             </if>
         </where>
         ORDER BY com.last_used_time DESC,com.usage_count DESC

--
Gitblit v1.8.0