From fada4b3ee4fbae5f82dba72fe8ad175a724d9cf7 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Mon, 19 Feb 2024 15:18:02 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml | 66 ++++++++++++++++++++++++++++++--
1 files changed, 61 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml b/src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml
index fc6a83e..d36b477 100644
--- a/src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml
+++ b/src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml
@@ -93,11 +93,12 @@
jpe.legal_person
FROM
jczz_place_check jpc
- LEFT JOIN jczz_place jp ON jpc.house_code = jp.house_code
- LEFT JOIN jczz_grid jg ON jg.grid_code = jp.grid_code
+ LEFT JOIN jczz_place jp ON jpc.house_code = jp.house_code and jp.is_deleted = 0
+ LEFT JOIN jczz_grid jg ON jg.grid_code = jp.grid_code and jg.is_deleted = 0
LEFT JOIN blade_region br ON br.`code` = jg.community_code
- LEFT JOIN jczz_place_ext jpe ON jpe.place_id = jp.id
- LEFT JOIN blade_user bu ON bu.id = jpc.create_user
+ LEFT JOIN jczz_place_ext jpe ON jpe.place_id = jp.id and jpe.is_deleted = 0
+ LEFT JOIN blade_user bu ON bu.id = jpc.create_user and bu.is_deleted = 0
+ LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0
where jpc.is_deleted = 0
<if test="placeCheck.houseCode!=null and placeCheck.houseCode!=''">
and jpc.house_code = #{placeCheck.houseCode}
@@ -133,7 +134,62 @@
<if test="placeCheck.endTime!=null and placeCheck.endTime!=''">
and date_format(jpc.create_time,'%Y-%m-%d') <= #{placeCheck.endTime}
</if>
-
+ <if test="isAdministrator==2">
+ <choose>
+ <when test="placeCheck.roleName != null and placeCheck.roleName != ''">
+ <if test="placeCheck.roleName=='wgy'">
+ <choose>
+ <when test="gridCodeList !=null and gridCodeList.size()>0">
+ and jp.grid_code in
+ <foreach collection="gridCodeList" item="code" open="(" close=")" separator=",">
+ #{code}
+ </foreach>
+ </when>
+ <otherwise>
+ and jp.grid_code in ('')
+ </otherwise>
+ </choose>
+ </if>
+ <if test="placeCheck.roleName=='mj'">
+ <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>
+ </when>
+ <otherwise>
+ <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
+ jpag.community_code in
+ <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+ #{code}
+ </foreach>
+ )
+ </when>
+ <otherwise>
+ and
+ (
+ jg.grid_code in ('') or jpag.community_code in in ('')
+ )
+ </otherwise>
+ </choose>
+ </otherwise>
+ </choose>
+ </if>
order by jpc.create_time desc
</select>
--
Gitblit v1.9.3