From 2bd69d1dca40d2fdf07f72e0117d2f0febde5359 Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Sat, 23 Dec 2023 15:27:02 +0800
Subject: [PATCH] 新增民警楼盘,功能数据过滤
---
src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml | 56 +++++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 47 insertions(+), 9 deletions(-)
diff --git a/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml b/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
index 3479e55..89d0bec 100644
--- a/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
+++ b/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
@@ -16,18 +16,24 @@
select
jp.*,
bu.real_name as username,bu.phone as phone,
- bx.real_name as createUserName
- from jczz_place jp
+ bx.real_name as createUserName,
+ br.town_name as townStreetName,br.name as neiName,
+ jpe.confirm_flag confirmFlag
+ from jczz_place jp
left join blade_user bu on bu.id = jp.principal_user_id and bu.is_deleted = 0
left join blade_user bx on bx.id = jp.create_user and bx.is_deleted = 0
+ LEFT JOIN jczz_place_ext jpe on jpe.place_id=jp.id
+ left join jczz_grid_range jgr on jgr.house_code = jp.house_code
+ left join jczz_grid jg on jg.id = jgr.grid_id and jg.is_deleted = 0
+ left join blade_region br on br.code = jg.community_code
left join (
- select a.* from jczz_place_poi_label a inner join
- (
- select place_id,max(id) as id from jczz_place_poi_label b group by place_id
- ) b on a.id = b.id
+ select a.* from jczz_place_poi_label a inner join
+ (
+ select place_id,max(id) as id from jczz_place_poi_label b group by place_id
+ ) b on a.id = b.id
) jppl on jppl.place_id = jp.id
where jp.is_deleted = 0
- <if test="place.roleName!=null and place.roleName!=''">
+ <if test="place.roleName!=null and place.roleName!='' and place.createUser!=null">
<choose>
<when test="place.roleName=='网格员'">
and
@@ -49,6 +55,24 @@
<if test="place.placeName!=null and place.placeName!=''">
and jp.place_name like concat('%',#{place.placeName},'%')
</if>
+ <if test="place.principal!=null and place.principal!=''">
+ and jp.principal like concat('%',#{place.principal},'%')
+ </if>
+ <if test="place.principalPhone!=null and place.principalPhone!=''">
+ and jp.principal_phone like concat('%',#{place.principalPhone},'%')
+ </if>
+ <if test="place.houseCode!=null and place.houseCode!=''">
+ and jp.house_code = #{place.houseCode}
+ </if>
+ <if test="place.townStreetName!=null and place.townStreetName!=''">
+ and br.town_name like concat('%',#{place.townStreetName},'%')
+ </if>
+ <if test="place.neiName!=null and place.neiName!=''">
+ and br.name like concat('%',#{place.neiName},'%')
+ </if>
+ <if test="place.id!=null">
+ and jp.id = #{place.id}
+ </if>
<if test="place.isPerfect==1">
and
(
@@ -66,6 +90,7 @@
and bu.real_name != ""
and bu.phone != ""
</if>
+ order by jpe.create_time desc
</select>
<!--查询场所集合信息-->
@@ -113,11 +138,15 @@
select
jp.*,
bu.real_name as username,bu.phone as phone,
- jppl.id as plid,jppl.*,jcl.category_name as labelName
+ jppl.id as plid,jppl.*,jc.category_name as labelName,
+ br.code as neiCode,jg.id as gridId
from jczz_place jp
left join blade_user bu on bu.id = jp.principal_user_id and bu.is_deleted = 0
left join jczz_place_poi_label jppl on jppl.place_id = jp.id
- left join jczz_category_label jcl on jcl.category_no = jppl.poi_code
+ left join jczz_category jc on jc.category_no = jppl.poi_code
+ left join jczz_grid_range jgr on jgr.house_code = jp.house_code
+ left join jczz_grid jg on jg.id = jgr.grid_id and jg.is_deleted = 0
+ left join blade_region br on br.code = jg.community_code
where jp.is_deleted = 0
<if test="place.houseCode!=null and place.houseCode!=''">
and jp.house_code = #{place.houseCode}
@@ -145,4 +174,13 @@
</if>
limit 1
</select>
+
+ <!--查询出有用户id 的场所-->
+ <select id="getHasUserIdPlaceList" resultType="org.springblade.modules.place.entity.PlaceEntity">
+ select
+ jp.*
+ from jczz_place jp
+ left join blade_user bu on bu.id = jp.principal_user_id and bu.is_deleted = 0
+ where jp.is_deleted = 0 and jp.principal_user_id is not null
+ </select>
</mapper>
--
Gitblit v1.9.3