From 94b1b03c835d10fb4821976cde30180df228bdd4 Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期五, 26 四月 2024 13:41:47 +0800
Subject: [PATCH] 修改 分水房查询接口 增加修改查询的数据内容

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrDivideMapper.xml |   46 +++++++++++++++++++++++++++++++++++++---------
 1 files changed, 37 insertions(+), 9 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrDivideMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrDivideMapper.xml
index d9b4ac4..91c62a2 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrDivideMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrDivideMapper.xml
@@ -227,8 +227,9 @@
       lat = #{lat,jdbcType=DOUBLE},
       remarks = #{remarks,jdbcType=VARCHAR},
       `operator` = #{operator,jdbcType=BIGINT},
-      operateDt = #{operatedt,jdbcType=TIMESTAMP},
-      deleted = #{deleted,jdbcType=TINYINT}
+      operateDt = #{operatedt,jdbcType=TIMESTAMP}
+<!--    ,-->
+<!--      deleted = #{deleted,jdbcType=TINYINT}-->
     where id = #{id,jdbcType=BIGINT}
   </update>
 
@@ -243,12 +244,13 @@
         INNER JOIN ba_district village ON divi.villageid = village.id
         , (SELECT @i:=0) AS itable
     <where>
+      AND divi. deleted = 0
       <if test = "divideName != null and divideName !=''">
         AND divi.name LIKE CONCAT('%',#{divideName},'%')
       </if>
 
-      <if test = "blockName != null and blockName !=''">
-        AND blo.name = #{blockName}
+      <if test = "blockId != null and blockId !=''">
+        AND divi.blockId = #{blockId}
       </if>
     </where>
   </select>
@@ -257,11 +259,19 @@
   <select id="getDivides" resultType="com.dy.pipIrrGlobal.voPr.VoDivide">
     SELECT
       (@i:=@i+1) AS id,
+      CAST(divi.id AS char) AS divideId,
       divi.name AS divideName,
+      CAST(divi.blockId AS char) AS blockId,
       blo.`name` AS blockName,
       divi.header,
+      divi.villages,
+      divi.area,
+      divi.lng,
+      divi.lat,
       divi.phone,
+      divi.remarks,
       CONCAT(country.`name`, town.`name`, village.`name`) AS address,
+      CAST(divi.operator AS char) AS operator,
       divi.operateDt
     FROM pr_divide divi
         INNER JOIN ba_block blo ON divi.blockId = blo.id
@@ -270,18 +280,36 @@
         INNER JOIN ba_district village ON divi.villageid = village.id
         , (SELECT @i:=0) AS itable
     <where>
+      AND divi. deleted = 0
       <if test = "divideName != null and divideName !=''">
         AND divi.name LIKE CONCAT('%',#{divideName},'%')
       </if>
 
-      <if test = "blockName != null and blockName !=''">
-        AND blo.name = #{blockName}
+      <if test = "blockId != null">
+        AND divi.blockId = #{blockId}
       </if>
     </where>
     ORDER BY divi.operateDt DESC
-    <if test="pageCurr != null and pageSize != null">
-      LIMIT ${pageCurr}, ${pageSize}
-    </if>
+    <trim prefix="limit " >
+      <if test="start != null and count != null">
+        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
+      </if>
+    </trim>
+  </select>
+
+  <!--鏍规嵁鍒嗘按鎴縄D閫昏緫鍒犻櫎鍒嗘按鎴�-->
+  <update id="deleteDivideById" parameterType="java.lang.Long">
+    update pr_divide set deleted = 1
+    <where>
+      <if test = "id != null and id > 0">
+        AND id = ${id}
+      </if>
+    </where>
+  </update>
+
+  <!--鏍规嵁鍒嗘按鎴跨紪鍙疯幏鍙栨墍灞炵墖鍖虹紪鍙�-->
+  <select id="getBlockIdById" resultType="java.lang.Long">
+    SELECT blockId FROM pr_divide WHERE id = ${divideId}
   </select>
 
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0