From c10d6358b9f014375a13821465bc978d0c0da22e Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Wed, 29 May 2024 17:17:08 +0800
Subject: [PATCH] 通过E呼即办数据统计
---
src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml | 98 ++++++++++++++++++++++++-------------------------
1 files changed, 48 insertions(+), 50 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 fefbbb0..ec82bde 100644
--- a/src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml
+++ b/src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml
@@ -171,6 +171,10 @@
AND jtrfr.create_user = #{vo.createUser}
</if>
+ <if test="vo.houseCode != null and vo.houseCode != ''">
+ and jtrfr.address_code = #{vo.houseCode}
+ </if>
+
<if test="vo.streetName != null and vo.streetName != ''">
AND br.town_name like concat('%',#{vo.streetName},'%')
</if>
@@ -220,7 +224,7 @@
<foreach collection="aoiCodeList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
- or
+ or
jp.aoi_code in
<foreach collection="aoiCodeList" item="item" separator="," open="(" close=")">
#{item}
@@ -232,8 +236,8 @@
or jtrfr.confirm_user_id = #{vo.confirmUserId}
</if>
</if>
- <!-- 网格员及其他 -->
- <if test="vo.roleType ==null">
+ <!-- 其他 -->
+ <if test="vo.roleType ==null and vo.roleName !='wgy' ">
<choose>
<when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
and (
@@ -249,7 +253,9 @@
)
</when>
</choose>
-
+ </if>
+ <!-- 网格员 -->
+ <if test="vo.roleName =='wgy' ">
<choose>
<when test="gridCodeList !=null and gridCodeList.size()>0">
and (
@@ -257,7 +263,7 @@
<foreach collection="gridCodeList" item="code" open="(" close=")" separator=",">
#{code}
</foreach>
- or
+ or
jp.grid_code in
<foreach collection="gridCodeList" item="code" open="(" close=")" separator=",">
#{code}
@@ -272,7 +278,6 @@
<if test="vo.confirmUserId != null ">
or jtrfr.confirm_user_id = #{vo.confirmUserId}
</if>
-
</if>
</if>
ORDER BY jtrfr.create_time DESC
@@ -347,54 +352,46 @@
jczz_task_report_for_repairs jtr
LEFT JOIN jczz_house jh ON jh.house_code = jtr.address_code
LEFT JOIN jczz_place jp ON jtr.address_code = jp.house_code
+ LEFT JOIN jczz_grid jg on (jh.grid_code = jg.grid_code or jp.grid_code = jg.grid_code )
+ LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0
<where>
and jtr.is_deleted = 0
and jtr.confirm_flag = 1
-
- <if test="userId != null and roleName == 'wgy'" >
- AND (
- jp.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}
- )
- 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 test="neiCode !=null and neiCode !=''">
+ and jg.community_code = #{neiCode}
</if>
- <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 test="roleName != null and roleName != ''">
+ <if test="roleName=='wgy'">
+ <if test="isAdministrator==2">
+ <choose>
+ <when test="gridCodeList !=null and gridCodeList.size()>0">
+ and jg.grid_code in
+ <foreach collection="gridCodeList" item="code" open="(" close=")" separator=",">
+ #{code}
+ </foreach>
+ </when>
+ <otherwise>
+ and jg.grid_code in ('')
+ </otherwise>
+ </choose>
+ </if>
+ </if>
+ <if test="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>
</where>
@@ -402,7 +399,8 @@
<!--更新状态-临时接口-->
<update id="updateView">
- update jczz_task_report_for_repairs set view_type = 1
+ update jczz_task_report_for_repairs
+ set view_type = 1
</update>
--
Gitblit v1.9.3