From f34dc97df6dc9f4480e7903016f104388ec1a7ab Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期四, 23 五月 2024 11:34:47 +0800
Subject: [PATCH] 田间灌溉项目管理 轮灌组 修改查一个、分页查、轮灌组绑定灌溉单元变物理删除

---
 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