From d276b2f67315e638b6596b48da1b6f9ac01dd69b Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期六, 27 一月 2024 08:58:28 +0800
Subject: [PATCH] 	修改取水口查询ID类型

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml |   33 +++++++++++++++++++++++++++++----
 1 files changed, 29 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 ce4228b..85772ad 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml
@@ -214,12 +214,11 @@
   <select id="getRecordCount" parameterType="java.util.Map" resultType="java.lang.Long">
     SELECT COUNT(*) AS recordCount
     FROM pr_intake ge
-    INNER JOIN ba_divide divi ON ge.divideId = divi.id
+    INNER JOIN pr_divide divi ON ge.divideId = divi.id
     INNER JOIN ba_block blo ON divi.blockId = blo.id
     INNER JOIN ba_district country ON ge.countyId = country.id
     INNER JOIN ba_district town ON ge.townId = town.id
     INNER JOIN ba_district village ON ge.villageId = village.id
-    , (SELECT @i:=0) AS itable
     <where>
       ge.deleted = 0
       AND divi.deleted = 0
@@ -235,12 +234,25 @@
       <if test="blockName != null and blockName != ''">
         AND blo.name = #{blockName}
       </if>
+
+      <if test="isBinded == 0">
+        AND ge.id NOT IN(SELECT intakeId FROM pr_controller where deleted = 0)
+      </if>
+      <if test="isBinded == 1">
+        AND ge.id IN(SELECT intakeId FROM pr_controller where deleted = 0)
+      </if>
+      <if test="isBinded == null">
+
+      </if>
+      <if test="address != null and address != ''">
+        AND CONCAT(country.`name`, town.`name`, village.`name`) LIKE CONCAT('%', #{address}, '%')
+      </if>
     </where>
   </select>
 
   <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鍙栨按鍙h褰�-->
   <select id="getIntakes" resultType="com.dy.pipIrrGlobal.voPr.VoIntake">
-    SELECT (@i:=@i+1)                                          AS id,
+    SELECT CAST(ge.id AS char)                             AS id,
     ge.`name`                                           AS intakeName,
     divi.`name`                                         AS divideName,
     blo.`name`                                          AS blockName,
@@ -256,7 +268,6 @@
     INNER JOIN ba_district country ON ge.countyId = country.id
     INNER JOIN ba_district town ON ge.townId = town.id
     INNER JOIN ba_district village ON ge.villageId = village.id
-    , (SELECT @i:=0) AS itable
     <where>
       ge.deleted = 0
       AND divi.deleted = 0
@@ -264,6 +275,7 @@
       <if test="intakeName != null and intakeName != ''">
         AND ge.name LIKE CONCAT('%', #{intakeName}, '%')
       </if>
+
       <if test="divideName != null and divideName != ''">
         AND divi.name LIKE CONCAT('%', #{divideName}, '%')
       </if>
@@ -271,6 +283,19 @@
       <if test="blockName != null and blockName != ''">
         AND blo.name = #{blockName}
       </if>
+
+      <if test="isBinded == 0">
+        AND ge.id NOT IN(SELECT intakeId FROM pr_controller where deleted = 0)
+      </if>
+      <if test="isBinded == 1">
+        AND ge.id IN(SELECT intakeId FROM pr_controller where deleted = 0)
+      </if>
+      <if test="isBinded == null">
+
+      </if>
+      <if test="address != null and address != ''">
+        AND CONCAT(country.`name`, town.`name`, village.`name`) LIKE CONCAT('%', #{address}, '%')
+      </if>
     </where>
     ORDER BY ge.operateDt DESC
     <if test="pageCurr != null and pageSize != null">

--
Gitblit v1.8.0