From d3cb0c2f0735da4d5ba8d7b00768ac2aa5b69566 Mon Sep 17 00:00:00 2001
From: lin <sbla5888@163.com>
Date: Sat, 13 Apr 2024 14:44:55 +0800
Subject: [PATCH] 党组织优化
---
src/main/java/org/springblade/modules/district/mapper/DistrictMapper.xml | 38 +++++++++++++++++++++++++++-----------
1 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/src/main/java/org/springblade/modules/district/mapper/DistrictMapper.xml b/src/main/java/org/springblade/modules/district/mapper/DistrictMapper.xml
index ebabc2d..2fdf6b2 100644
--- a/src/main/java/org/springblade/modules/district/mapper/DistrictMapper.xml
+++ b/src/main/java/org/springblade/modules/district/mapper/DistrictMapper.xml
@@ -39,8 +39,18 @@
<if test="district.townStreetName !=null and district.townStreetName !=''">
and br.town_name like concat('%',#{district.townStreetName},'%')
</if>
- <if test="district.regionCode !=null and district.regionCode !=''">
- and jd.community_code like concat('%',#{district.regionCode},'%')
+ <if test="isAdministrator==2">
+ <choose>
+ <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+ and jd.community_code in
+ <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+ #{code}
+ </foreach>
+ </when>
+ <otherwise>
+ and jd.community_code in ('')
+ </otherwise>
+ </choose>
</if>
</select>
@@ -51,7 +61,7 @@
parent_code as parentId,
name,
remark aoiCode
- FROM blade_region where district_code = '361102'
+ FROM blade_region where district_code like concat('361102','%')
union all
(
select
@@ -60,10 +70,10 @@
name,
aoi_code aoiCode
from jczz_district
- where is_deleted = 0
- <if test="district.districtIdList!=null and district.districtIdList!=''">
+ where is_deleted = 0 and community_code like concat('361102','%')
+ <if test="district.districtIdList!=null and district.districtIdList.size() > 0">
and id in
- <foreach collection="district.districtIdList" item="item" separator ="," open="(" close=")">
+ <foreach collection="district.districtIdList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
@@ -72,13 +82,19 @@
<!--小区自定义获取详情查询-->
<select id="getDetail" resultType="org.springblade.modules.district.vo.DistrictVO">
- SELECT
- jd.*,
- jda.nei_code as communityCode,jda.nei_name as communityName
+ SELECT jd.*,
+ jda.nei_code as communityCode,
+ jda.nei_name as communityName,
+ jpo.organization_name,
+ jpo.organization_type,
+ jpo.branch_type,
+ jpo.charge_person,
+ jpo.phone
FROM jczz_district jd
- left join jczz_doorplate_address jda on jda.aoi_code = jd.aoi_code
+ left join jczz_doorplate_address jda on jda.aoi_code = jd.aoi_code
+ LEFT JOIN jczz_party_organization jpo on jpo.area_id = jda.nei_code and jpo.is_deleted=0
where jd.is_deleted = 0
- and jda.address_code = #{district.houseCode}
+ and jda.address_code = #{district.houseCode}
</select>
--
Gitblit v1.9.3