| | |
| | | </if> |
| | | </sql> |
| | | |
| | | <!--过滤社区数据--> |
| | | <sql id="filterCommunity"> |
| | | <if test="houseParam.roleName!=null and houseParam.roleName!=''"> |
| | | <if test="houseParam.roleName=='民警' and houseParam.userId!='1726859808689696770'"> |
| | | <choose> |
| | | <when test="communityList != null and communityList.size()>0"> |
| | | and nei_code in |
| | | <foreach collection="communityList" item="neiCode" separator ="," open="(" close=")"> |
| | | #{neiCode} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and nei_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | </if> |
| | | </sql> |
| | | |
| | | <!--门牌地址详情查询--> |
| | | <resultMap id="doorplateAddressDetailMap" type="org.springblade.modules.doorplateAddress.vo.DoorplateAddressVO" |
| | | autoMapping="true"> |
| | |
| | | <!--自定义分页查询--> |
| | | <select id="selectDoorplateAddressPage" resultType="org.springblade.modules.doorplateAddress.vo.DoorplateAddressVO"> |
| | | select * from jczz_doorplate_address where 1=1 |
| | | <if test="doorplateAddress.aoiName!=null and doorplateAddress.aoiName!=''"> |
| | | and aoi_name like concat('%',#{doorplateAddress.aoiName},'%') |
| | | </if> |
| | | <if test="doorplateAddress.addressName!=null and doorplateAddress.addressName!=''"> |
| | | and address_name like concat('%',#{doorplateAddress.addressName},'%') |
| | | </if> |
| | | <if test="doorplateAddress.townStreetCode != null and doorplateAddress.townStreetCode != ''"> |
| | | and town_street_code like concat('%',#{doorplateAddress.townStreetCode},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | |
| | | and nei_name = '万达社区居民委员会' |
| | | </if> |
| | | <include refid="filterHouseGrid"/> |
| | | <include refid="filterCommunity"/> |
| | | group by town_street_code,town_street_name |
| | | </select> |
| | | |
| | |
| | | and nei_name = '万达社区居民委员会' |
| | | </if> |
| | | <include refid="filterHouseGrid"/> |
| | | <include refid="filterCommunity"/> |
| | | group by nei_code,nei_name,town_street_code |
| | | </select> |
| | | |
| | |
| | | and nei_code = #{houseParam.code} |
| | | </if> |
| | | <include refid="filterHouseGrid"/> |
| | | <include refid="filterCommunity"/> |
| | | group by aoi_code,aoi_name |
| | | union all |
| | | ( |
| | |
| | | and nei_code = #{houseParam.code} |
| | | </if> |
| | | <include refid="filterHouseGrid"/> |
| | | <include refid="filterCommunity"/> |
| | | group by aoi_code,sub_aoi |
| | | ) |
| | | union all |
| | |
| | | and nei_code = #{houseParam.code} |
| | | </if> |
| | | <include refid="filterHouseGrid"/> |
| | | <include refid="filterCommunity"/> |
| | | group by nei_code |
| | | ) |
| | | union all |
| | |
| | | and house_name != '' |
| | | and doorplate_type = '户室牌' |
| | | and building_code = #{houseParam.code} |
| | | <if test="houseParam.searchKey!=null and houseParam.searchKey!=''"> |
| | | and jh.name like concat('%',#{houseParam.searchKey},'%') |
| | | </if> |
| | | <include refid="filterHouseGrid"/> |
| | | ) |
| | | union all |
| | |
| | | |
| | | <!--查询所有的地址表和场所表差集集合(小区和非小区的)--> |
| | | <select id="getPlaceList" resultType="org.springblade.modules.doorplateAddress.entity.DoorplateAddressEntity"> |
| | | select |
| | | min(jda.id) |
| | | from jczz_doorplate_address jda |
| | | left join jczz_district jd on jda.aoi_code = jd.aoi_code |
| | | where jda.aoi_code != "" and jda.aoi_name !="" and jd.id is null |
| | | and (doorplate_type = '大门牌' or doorplate_type = '楼幢牌' or doorplate_type = '中门牌' or doorplate_type = '单元牌') |
| | | GROUP BY jda.aoi_code |
| | | union all |
| | | ( |
| | | select |
| | | min(jda.id) |
| | | from jczz_doorplate_address jda |
| | | left join jczz_district jd on jda.aoi_code = jd.aoi_code |
| | | where jda.aoi_code != "" and jda.sub_aoi != "" |
| | | and (doorplate_type = '大门牌' or doorplate_type = '楼幢牌' or doorplate_type = '中门牌') |
| | | group by jda.aoi_code |
| | | ) |
| | | select jda.* from jczz_doorplate_address jda join ( |
| | | select |
| | | min(jda.id) as id |
| | | from jczz_doorplate_address jda |
| | | left join jczz_district jd on jda.aoi_code = jd.aoi_code |
| | | where jda.aoi_code != "" and jda.aoi_name !="" and jd.id is null |
| | | and (doorplate_type = '大门牌' or doorplate_type = '楼幢牌' or doorplate_type = '中门牌' or doorplate_type = '单元牌') |
| | | GROUP BY jda.aoi_code |
| | | union all |
| | | ( |
| | | select |
| | | min(jda.id) as id |
| | | from jczz_doorplate_address jda |
| | | left join jczz_district jd on jda.aoi_code = jd.aoi_code |
| | | where jda.aoi_code != "" and jda.sub_aoi != "" |
| | | and (doorplate_type = '大门牌' or doorplate_type = '楼幢牌' or doorplate_type = '中门牌') |
| | | group by jda.aoi_code |
| | | ) |
| | | ) a on jda.id = a.id |
| | | </select> |
| | | |
| | | <!--查询所有的地址表和场所表差集集合(小区和非小区的)--> |
| | | <select id="getDoorplateAddressVODetail" resultType="org.springblade.modules.doorplateAddress.vo.DoorplateAddressVO"> |
| | | select jda.* from jczz_doorplate_address jda where address_code = #{doorplateAddress.addressCode} |
| | | </select> |
| | | |
| | | <!--查询所有的社区集合信息--> |
| | | <select id="getAllCommunityList" resultType="org.springblade.modules.doorplateAddress.entity.DoorplateAddressEntity"> |
| | | SELECT |
| | | jda.nei_code, |
| | | jda.nei_name, |
| | | jda.town_street_code |
| | | FROM |
| | | jczz_doorplate_address jda |
| | | WHERE |
| | | 1 = 1 |
| | | GROUP BY |
| | | jda.nei_code, |
| | | jda.nei_name, |
| | | jda.town_street_code |
| | | </select> |
| | | </mapper> |