From c4e2c196aad8af656d94bc47e9f1a80bc504b5d7 Mon Sep 17 00:00:00 2001
From: lin <sbla5888@163.com>
Date: Thu, 14 Mar 2024 18:15:29 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml | 88 +++++++++++++++++++++++++++++++++++---------
1 files changed, 70 insertions(+), 18 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 3537c8e..fefbbb0 100644
--- a/src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml
+++ b/src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml
@@ -165,6 +165,7 @@
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
+ LEFT JOIN jczz_place jp on jtrfr.address_code = jp.house_code and jp.is_deleted = 0
where jtrfr.is_deleted = 0
<if test="vo.createUser != null and vo.createUser != ''">
AND jtrfr.create_user = #{vo.createUser}
@@ -214,33 +215,54 @@
<!-- 物业和居民 -->
<if test="vo.roleType !=null and (vo.roleType == 'wy' or vo.roleType == 'inhabitant')">
<if test="aoiCodeList!=null and aoiCodeList.size()>0">
- and jda.aoi_code in
+ and (
+ jda.aoi_code in
<foreach collection="aoiCodeList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
+ or
+ jp.aoi_code in
+ <foreach collection="aoiCodeList" item="item" separator="," open="(" close=")">
+ #{item}
+ </foreach>
+ )
</if>
<if test="vo.roleType == 'wy' and vo.confirmUserId != null ">
- and jtrfr.confirm_user_id = #{vo.confirmUserId}
+ or jtrfr.confirm_user_id = #{vo.confirmUserId}
</if>
</if>
<!-- 网格员及其他 -->
<if test="vo.roleType ==null">
<choose>
<when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
- and jg.grid_code in
+ and (
+ jg.grid_code in
<foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
#{code}
</foreach>
+ or
+ jp.grid_code in
+ <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+ #{code}
+ </foreach>
+ )
</when>
</choose>
<choose>
<when test="gridCodeList !=null and gridCodeList.size()>0">
- and jg.grid_code in
+ and (
+ jg.grid_code in
<foreach collection="gridCodeList" item="code" open="(" close=")" separator=",">
#{code}
</foreach>
+ or
+ jp.grid_code in
+ <foreach collection="gridCodeList" item="code" open="(" close=")" separator=",">
+ #{code}
+ </foreach>
+ )
</when>
<otherwise>
and jg.grid_code in ('')
@@ -248,7 +270,7 @@
</choose>
<if test="vo.confirmUserId != null ">
- and jtrfr.confirm_user_id = #{vo.confirmUserId}
+ or jtrfr.confirm_user_id = #{vo.confirmUserId}
</if>
</if>
@@ -323,28 +345,58 @@
count( 1 )
FROM
jczz_task_report_for_repairs jtr
- LEFT JOIN jczz_doorplate_address jda ON jtr.address_code = jda.address_code
+ LEFT JOIN jczz_house jh ON jh.house_code = jtr.address_code
+ LEFT JOIN jczz_place jp ON jtr.address_code = jp.house_code
<where>
+ and jtr.is_deleted = 0
+ and jtr.confirm_flag = 1
- <if test="neiCode != null and neiCode != ''">
- and jda.nei_code = #{neiCode}
- </if>
- <if test="userId != null">
- AND jtr.address_code IN (
+ <if test="userId != null and roleName == 'wgy'" >
+ AND (
+ jp.grid_code IN (
SELECT
- jgr.house_code
+ jg.grid_code
FROM
- jczz_grid_range jgr
- LEFT JOIN jczz_grid jg ON jg.id = jgr.grid_id
+ jczz_grid jg
LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id
WHERE
jg.is_deleted = 0
- AND jgm.user_id = #{userId} )
+ AND jgm.user_id = #{userId}
+ )
+ OR jh.grid_code IN (
+ SELECT
+ jg.grid_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id
+ WHERE
+ jg.is_deleted = 0
+ AND jgm.user_id = #{userId}
+ ))
</if>
- and jtr.is_deleted = 0
- and jtr.confirm_flag = 1
- </where>
+ <if test="userId != null and roleName == 'mj'">
+ AND (
+ jp.jw_grid_code IN (
+ SELECT
+ jpag.jw_grid_code
+ FROM
+ jczz_police_affairs_grid jpag
+ WHERE
+ jpag.is_deleted = 0
+ AND jpag.police_user_id = #{userId}
+ )
+ OR jh.jw_grid_code IN (
+ SELECT
+ jpag.jw_grid_code
+ FROM
+ jczz_police_affairs_grid jpag
+ WHERE
+ jpag.is_deleted = 0
+ AND jpag.police_user_id = #{userId}
+ ))
+ </if>
+ </where>
</select>
--
Gitblit v1.9.3