From 0cf21592da954beccb0d599bdbc53b38d5129f3c Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期五, 24 五月 2024 09:29:19 +0800
Subject: [PATCH] 田间灌溉项目管理 灌溉单元  完善查询接口字段、完善删除接口关联删除

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIrrigateUnitMapper.xml |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIrrigateUnitMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIrrigateUnitMapper.xml
index 0c9c37a..b0fdd3c 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIrrigateUnitMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIrrigateUnitMapper.xml
@@ -110,12 +110,15 @@
         CAST(uni.id AS char)AS id,
         CAST(uni.operator AS char)AS operator,
         cli.name         AS operatorName,
+        gru.group_code         AS groupCode,
         uni.area,
         uni.remarks,
         uni.operate_time  AS  operateDt
         from ir_irrigate_unit uni
         left join ir_project pro on pro.id = uni.project_id
         left join se_client cli on cli.id = uni.operator
+        left join ir_group_unit gu on gu.unit_id = uni.id
+        left join ir_irrigate_group gru on gru.id = gu.group_id
         where uni.id = #{id,jdbcType=BIGINT} and uni.deleted = 0
     </select>
     <!--鍒嗛〉鏌ョ亴婧夊崟鍏�-->
@@ -126,20 +129,23 @@
         CAST(uni.id AS char)AS unitId,
         CAST(uni.operator AS char)AS operator,
         cli.name         AS operatorName,
+        gru.group_code         AS groupCode,
         uni.area,
         uni.remarks,
         uni.operate_time  AS  operateDt
         FROM ir_irrigate_unit uni
         left join ir_project pro on pro.id = uni.project_id
         left join se_client cli on cli.id = uni.operator
+        left join ir_group_unit gu on gu.unit_id = uni.id
+        left join ir_irrigate_group gru on gru.id = gu.group_id
         <where>
             uni.deleted = 0
             <if test="projectName != null and projectName != ''">
                 AND pro.project_name LIKE CONCAT('%', #{projectName}, '%')
             </if>
-<!--            <if test = "groupCode != null and groupCode != ''">-->
-<!--                AND pro.project_state = #{groupCode}-->
-<!--            </if>-->
+            <if test = "groupCode != null and groupCode != ''">
+                AND gru.group_code = #{groupCode}
+            </if>
         </where>
         ORDER BY uni.operate_time DESC
         <if test="pageCurr != null and pageSize != null">
@@ -152,14 +158,16 @@
         FROM ir_irrigate_unit uni
         left join ir_project pro on pro.id = uni.project_id
         left join se_client cli on cli.id = uni.operator
+        left join ir_group_unit gu on gu.unit_id = uni.id
+        left join ir_irrigate_group gru on gru.id = gu.group_id
         <where>
             uni.deleted = 0
             <if test="projectName != null and projectName != ''">
                 AND pro.project_name LIKE CONCAT('%', #{projectName}, '%')
             </if>
-            <!--            <if test = "groupCode != null and groupCode != ''">-->
-            <!--                AND pro.project_state = #{groupCode}-->
-            <!--            </if>-->
+                        <if test = "groupCode != null and groupCode != ''">
+                            AND gru.group_code = #{groupCode}
+                        </if>
         </where>
     </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0