From 33c41b063b50beb2524413b0b690867fa298b7bb Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期五, 10 五月 2024 14:20:31 +0800
Subject: [PATCH] 修改取水口查询接口 增加显示控制器ID和控制器地址

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 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 c99a293..5a25cea 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml
@@ -219,6 +219,7 @@
     LEFT JOIN ba_district country ON ge.countyId = country.id
     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
     <where>
       ge.deleted = 0
       AND divi.deleted = 0
@@ -227,11 +228,11 @@
         AND ge.name LIKE CONCAT('%', #{intakeName}, '%')
       </if>
 
-      <if test = "divideId != null">
+      <if test = "divideId != null and divideId !=''">
         AND divi.id = #{divideId}
       </if>
 
-      <if test = "blockId != null">
+      <if test = "blockId != null and blockId !=''">
         AND blo.id = #{blockId}
       </if>
 
@@ -259,6 +260,8 @@
     divi.`name`                                         AS divideName,
     CAST(blo.id AS char)                                AS blockId,
     blo.`name`                                          AS blockName,
+    CAST(cont.id AS char)                               AS controllerId,
+    cont.rtuAddr                                        AS rtuAddr,
     ge.lng,
     ge.lat,
     ge.remarks,
@@ -275,6 +278,7 @@
     LEFT JOIN ba_district country ON ge.countyId = country.id
     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
     <where>
       ge.deleted = 0
       AND divi.deleted = 0
@@ -283,11 +287,11 @@
         AND ge.name LIKE CONCAT('%', #{intakeName}, '%')
       </if>
 
-      <if test = "divideId != null">
+      <if test = "divideId != null and divideId !=''">
         AND divi.id = #{divideId}
       </if>
 
-      <if test = "blockId != null">
+      <if test = "blockId != null and blockId !=''">
         AND blo.id = #{blockId}
       </if>
 

--
Gitblit v1.8.0