From 55561a93e2e0aa94659d15023bacf4023e8c6d7b Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Thu, 21 Mar 2024 10:54:04 +0800
Subject: [PATCH] 任务列表过滤修复,二手交易详情查询修改

---
 src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml |  184 +++++++++++++++++++++++----------------------
 1 files changed, 93 insertions(+), 91 deletions(-)

diff --git a/src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml b/src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml
index 7ff58ae..ebd4d81 100644
--- a/src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml
+++ b/src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml
@@ -53,59 +53,59 @@
         LEFT JOIN blade_region br on br.code = jg.community_code
         LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0
         <where>
-            <if test="task.roleName != null and task.roleName != ''">
-                <if test="task.roleName=='wgy'">
-                    <if test="isAdministrator==2">
-                        <choose>
-                            <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
-                                and jp.grid_code in
-                                <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
-                                    #{code}
-                                </foreach>
-                            </when>
-                            <otherwise>
-                                and jp.grid_code in ('')
-                            </otherwise>
-                        </choose>
-                    </if>
-                </if>
-                <if test="task.roleName=='mj'">
-                    <if test="isAdministrator==2">
-                        <choose>
-                            <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
-                                and jpag.community_code in
-                                <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
-                                    #{code}
-                                </foreach>
-                            </when>
-                            <otherwise>
-                                and jpag.community_code in ('')
-                            </otherwise>
-                        </choose>
-                    </if>
-                </if>
-            </if>
             <if test="isAdministrator==2">
                 <choose>
-                    <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
-                        and
-                        (
-                        jg.grid_code in
-                        <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
-                            #{code}
-                        </foreach>
-                        or
-                        br.village_code in
-                        <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
-                            #{code}
-                        </foreach>
-                        )
+                    <when test="task.roleName != null and task.roleName != ''">
+                        <if test="task.roleName=='wgy'">
+                            <choose>
+                                <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+                                    and jh.grid_code in
+                                    <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+                                        #{code}
+                                    </foreach>
+                                </when>
+                                <otherwise>
+                                    and jh.grid_code in ('')
+                                </otherwise>
+                            </choose>
+                        </if>
+                        <if test="task.roleName=='mj' and isAdministrator==2">
+                            <choose>
+                                <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+                                    and br.village_code in
+                                    <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+                                        #{code}
+                                    </foreach>
+                                </when>
+                                <otherwise>
+                                    and br.village_code in ('')
+                                </otherwise>
+                            </choose>
+                        </if>
                     </when>
                     <otherwise>
-                        and
-                        (
-                        jg.grid_code in ('') or br.village_code in ('')
-                        )
+                        <choose>
+                            <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+                                and
+                                (
+                                jg.grid_code in
+                                <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+                                    #{code}
+                                </foreach>
+                                or
+                                br.village_code in
+                                <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+                                    #{code}
+                                </foreach>
+                                )
+                            </when>
+                            <otherwise>
+                                and
+                                (
+                                jg.grid_code in ('') or br.village_code in ('')
+                                )
+                            </otherwise>
+                        </choose>
                     </otherwise>
                 </choose>
             </if>
@@ -194,57 +194,59 @@
         LEFT JOIN blade_region br on br.code = jg.community_code
         LEFT JOIN jczz_task_bail_reporting_event jtbre on jtbre.task_id = jt.id
         <where>
-            <if test="task.roleName != null and task.roleName != ''">
-                <if test="task.roleName=='wgy'">
-                    <if test="isAdministrator==2">
+            <if test="isAdministrator==2">
+                <choose>
+                    <when test="task.roleName != null and task.roleName != ''">
+                        <if test="task.roleName=='wgy'">
+                            <choose>
+                                <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+                                    and jh.grid_code in
+                                    <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+                                        #{code}
+                                    </foreach>
+                                </when>
+                                <otherwise>
+                                    and jh.grid_code in ('')
+                                </otherwise>
+                            </choose>
+                        </if>
+                        <if test="task.roleName=='mj' and isAdministrator==2">
+                            <choose>
+                                <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+                                    and br.village_code in
+                                    <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+                                        #{code}
+                                    </foreach>
+                                </when>
+                                <otherwise>
+                                    and br.village_code in ('')
+                                </otherwise>
+                            </choose>
+                        </if>
+                    </when>
+                    <otherwise>
                         <choose>
                             <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
-                                and jh.grid_code in
+                                and
+                                (
+                                jg.grid_code in
                                 <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
                                     #{code}
                                 </foreach>
+                                or
+                                br.village_code in
+                                <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+                                    #{code}
+                                </foreach>
+                                )
                             </when>
                             <otherwise>
-                                and jh.grid_code in ('')
+                                and
+                                (
+                                jg.grid_code in ('') or br.village_code in ('')
+                                )
                             </otherwise>
                         </choose>
-                    </if>
-                </if>
-                <if test="task.roleName=='mj' and isAdministrator==2">
-                    <choose>
-                        <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
-                            and br.village_code in
-                            <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
-                                #{code}
-                            </foreach>
-                        </when>
-                        <otherwise>
-                            and br.village_code in ('')
-                        </otherwise>
-                    </choose>
-                </if>
-            </if>
-            <if test="isAdministrator==2">
-                <choose>
-                    <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
-                        and
-                        (
-                        jg.grid_code in
-                        <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
-                            #{code}
-                        </foreach>
-                        or
-                        br.village_code in
-                        <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
-                            #{code}
-                        </foreach>
-                        )
-                    </when>
-                    <otherwise>
-                        and
-                        (
-                        jg.grid_code in ('') or br.village_code in ('')
-                        )
                     </otherwise>
                 </choose>
             </if>

--
Gitblit v1.9.3