From 051ccdbfdc1daec64187d28af1ca11e55649cd1e Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Wed, 21 Feb 2024 08:31:11 +0800
Subject: [PATCH] 租户查询调整
---
src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml | 55 ++++++++++++++++++++++++++++++++-----------------------
1 files changed, 32 insertions(+), 23 deletions(-)
diff --git a/src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml b/src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml
index 3037f1a..7e42e37 100644
--- a/src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml
+++ b/src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml
@@ -152,16 +152,36 @@
jtrfr.lat,
jtrfr.address,
jtrfr.view_type,
+ br.town_name streetName,
+ jg.grid_name,
+ jda.aoi_name,
+ br.village_name communityName,
jda.address_name as addressName
from jczz_task_report_for_repairs jtrfr
left join jczz_doorplate_address jda on jda.address_code = jtrfr.address_code
- left join jczz_grid_range jgr on jgr.house_code = jtrfr.address_code
- left join jczz_grid jg on jg.id = jgr.grid_id and jg.is_deleted = 0
+ LEFT JOIN jczz_house jh on jh.house_code=jtrfr.address_code
+ left join jczz_grid jg on jg.grid_code = jh.grid_code and jg.is_deleted = 0
left join blade_region br on br.code = jg.community_code
where jtrfr.is_deleted = 0
<if test="vo.createUser != null and vo.createUser != ''">
AND jtrfr.create_user = #{vo.createUser}
</if>
+
+ <if test="vo.streetName != null and vo.streetName != ''">
+ AND br.town_name like concat('%',#{vo.streetName},'%')
+ </if>
+ <if test="vo.communityName != null and vo.communityName != ''">
+ AND br.village_name like concat('%',#{vo.communityName},'%')
+ </if>
+
+ <if test="vo.gridName != null and vo.gridName != ''">
+ AND jg.grid_name like concat('%',#{vo.gridName},'%')
+ </if>
+
+ <if test="vo.aoiName != null and vo.aoiName != ''">
+ AND jda.aoi_name like concat('%',#{vo.aoiName},'%')
+ </if>
+
<if test="vo.type != null">
AND jtrfr.type = #{vo.type}
</if>
@@ -190,33 +210,22 @@
<if test="isAdministrator==2">
<choose>
<when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
- and jg.community_code in
+ and jg.grid_code in
<foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
#{code}
</foreach>
</when>
- <otherwise>
- and jg.community_code in ('')
- </otherwise>
</choose>
</if>
- <if test="vo.roleName!=null and vo.roleName!=''">
- <if test="vo.roleName=='网格员'">
- <choose>
- <when test="list != null and list.size()>0">
- and (jda.address_code in
- <foreach collection="list" item="houseCode" separator="," open="(" close=")">
- #{houseCode}
- </foreach>
- or jtrfr.confirm_user_id = #{vo.confirmUserId})
- </when>
- <otherwise>
- and (jda.address_code in ('')
- or jtrfr.confirm_user_id = #{vo.confirmUserId})
- </otherwise>
- </choose>
- </if>
+
+
+ <if test="aoiCodeList!=null and aoiCodeList.size()>0">
+ and jda.aoi_code in
+ <foreach collection="aoiCodeList" item="item" separator="," open="(" close=")">
+ #{item}
+ </foreach>
</if>
+
ORDER BY jtrfr.create_time DESC
</select>
@@ -258,7 +267,7 @@
jczz_doorplate_address jda
LEFT JOIN jczz_community jc ON jc.CODE = jda.nei_code
WHERE
- jc.res_police_user_id = #{userId})
+ jc.res_police_user_id like concat('%',#{userId},'%'))
)
</if>
</select>
--
Gitblit v1.9.3