From add4c38e8914170703065ecdf7ab5199ba35933b Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期一, 27 五月 2024 14:56:51 +0800
Subject: [PATCH] 田间灌溉项目管理 灌溉制度模块  5个接口实现

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