| | |
| | | </if> |
| | | </sql> |
| | | |
| | | <!--过滤网格编号--> |
| | | <sql id="filterGrid"> |
| | | <if test="houseParam.roleName!=null and houseParam.roleName!=''"> |
| | | <if test="houseParam.roleName=='wgy' and houseParam.userId!='1726859808689696770'"> |
| | | <choose> |
| | | <when test="list != null and list.size()>0"> |
| | | and jgr.grid_code in |
| | | <foreach collection="list" item="gridCode" separator ="," open="(" close=")"> |
| | | #{gridCode} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and jgr.grid_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | </if> |
| | | </sql> |
| | | |
| | | |
| | | |
| | | <!--过滤社区数据--> |
| | |
| | | |
| | | <!--根据社区名称查询小区集合--> |
| | | <select id="getDistrictList" resultType="org.springblade.common.node.TreeStringNode" > |
| | | select aoi_code as id,aoi_name as name,1 as addressType from jczz_doorplate_address |
| | | where 1=1 |
| | | and aoi_name !='' |
| | | select aoi_code as id,aoi_name as name,1 as addressType from jczz_doorplate_address jda |
| | | left join jczz_grid_range jgr on jda.address_code = jgr.house_code |
| | | where aoi_name !='' |
| | | and aoi_code !='' |
| | | <if test="houseParam.name != null and houseParam.name!=''"> |
| | | and nei_name = #{houseParam.name} |
| | |
| | | <if test="houseParam.code != null and houseParam.code!=''"> |
| | | and nei_code = #{houseParam.code} |
| | | </if> |
| | | <include refid="filterHouseGrid"/> |
| | | <include refid="filterGrid"/> |
| | | <include refid="filterCommunity"/> |
| | | group by aoi_code,aoi_name |
| | | union all |
| | | ( |
| | | select aoi_code as id,sub_aoi as name,1 as addressType from jczz_doorplate_address |
| | | where 1=1 |
| | | and aoi_code !='' |
| | | select aoi_code as id,sub_aoi as name,1 as addressType from jczz_doorplate_address jda |
| | | left join jczz_grid_range jgr on jda.address_code = jgr.house_code |
| | | where aoi_code !='' |
| | | and aoi_name is null |
| | | and sub_aoi != '' |
| | | <if test="houseParam.name != null and houseParam.name!=''"> |
| | |
| | | <if test="houseParam.code != null and houseParam.code!=''"> |
| | | and nei_code = #{houseParam.code} |
| | | </if> |
| | | <include refid="filterHouseGrid"/> |
| | | <include refid="filterGrid"/> |
| | | <include refid="filterCommunity"/> |
| | | group by aoi_code,sub_aoi |
| | | ) |
| | | union all |
| | | ( |
| | | select nei_code as id,'自建房/商铺' as name,2 as addressType from jczz_doorplate_address |
| | | where 1=1 |
| | | and aoi_code is null |
| | | select nei_code as id,'自建房/商铺' as name,2 as addressType from jczz_doorplate_address jda |
| | | left join jczz_grid_range jgr on jda.address_code = jgr.house_code |
| | | where aoi_code is null |
| | | <if test="houseParam.name != null and houseParam.name!=''"> |
| | | and nei_name = #{houseParam.name} |
| | | </if> |
| | | <if test="houseParam.code != null and houseParam.code!=''"> |
| | | and nei_code = #{houseParam.code} |
| | | </if> |
| | | <include refid="filterHouseGrid"/> |
| | | <include refid="filterGrid"/> |
| | | <include refid="filterCommunity"/> |
| | | group by nei_code |
| | | ) |
| | |
| | | <!--根据小区名称查询楼栋/商铺集合--> |
| | | <select id="getBuildingList" resultType="org.springblade.common.node.TreeStringNode" > |
| | | ( |
| | | select building_code as id,ifnull(building_name,'1栋') as name,1 as addressType from jczz_doorplate_address |
| | | where 1=1 |
| | | and aoi_code = #{houseParam.code} |
| | | select building_code as id,ifnull(building_name,'1栋') as name,1 as addressType from jczz_doorplate_address jda |
| | | left join jczz_grid_range jgr on jda.address_code = jgr.house_code |
| | | where aoi_code = #{houseParam.code} |
| | | and building_code !='' |
| | | and doorplate_type = '户室牌' |
| | | <include refid="filterHouseGrid"/> |
| | | <include refid="filterGrid"/> |
| | | group by building_code,building_name |
| | | order by building_name |
| | | ) |
| | | union all |
| | | ( |
| | | select address_code as id,doorplate_name as name,2 as addressType from jczz_doorplate_address |
| | | where 1=1 |
| | | and aoi_code = #{houseParam.code} |
| | | select address_code as id,doorplate_name as name,2 as addressType from jczz_doorplate_address jda |
| | | left join jczz_grid_range jgr on jda.address_code = jgr.house_code |
| | | where aoi_code = #{houseParam.code} |
| | | and building_name is null |
| | | and (doorplate_type = '小门牌' or (doorplate_type = '中门牌' and address_level = 1)) |
| | | <include refid="filterHouseGrid"/> |
| | | <include refid="filterGrid"/> |
| | | ) |
| | | </select> |
| | | |
| | |
| | | juhl.id as cid,juhl.house_code,juhl.label_id,juhl.label_name,juhl.color,juhl.household_id, |
| | | juhlh.color as houseColor |
| | | from jczz_doorplate_address jda |
| | | left join jczz_grid_range jgr on jda.address_code = jgr.house_code |
| | | left join |
| | | ( |
| | | SELECT house_code, NAME, relationship FROM jczz_household WHERE id in( |
| | |
| | | <if test="houseParam.searchKey!=null and houseParam.searchKey!=''"> |
| | | and jh.name like concat('%',#{houseParam.searchKey},'%') |
| | | </if> |
| | | <include refid="filterHouseGrid"/> |
| | | <include refid="filterGrid"/> |
| | | ) |
| | | union all |
| | | ( |
| | |
| | | juhl.id as cid,juhl.house_code,juhl.label_id,juhl.label_name,juhl.color,juhl.household_id, |
| | | juhlh.color as houseColor |
| | | from jczz_doorplate_address jda2 |
| | | left join jczz_grid_range jgr on jda2.address_code = jgr.house_code |
| | | left join jczz_user_house_label juhl on juhl.house_code = jda2.address_code and juhl.lable_type=1 |
| | | left join jczz_user_house_label juhlh on juhlh.house_code = jda2.address_code and juhlh.lable_type=2 |
| | | where 1=1 |
| | | and building_code = #{houseParam.code} |
| | | and building_name != '' |
| | | and (doorplate_type = '小门牌' or (doorplate_type = '中门牌' and address_level = 1)) |
| | | <include refid="filterHouseGrid"/> |
| | | <include refid="filterGrid"/> |
| | | ) |
| | | </select> |
| | | |
| | |
| | | |
| | | <!--根据社区查询街路巷集合--> |
| | | <select id="getStreetRuList" resultType="org.springblade.common.node.TreeStringNode" > |
| | | select street_ru_code as id,street_ru_name as name,3 as addressType from jczz_doorplate_address |
| | | select street_ru_code as id,street_ru_name as name,3 as addressType from jczz_doorplate_address jda |
| | | left join jczz_grid_range jgr on jda.address_code = jgr.house_code |
| | | where 1=1 |
| | | and aoi_code is null |
| | | <if test="houseParam.name != null and houseParam.name!=''"> |
| | |
| | | <if test="houseParam.code != null and houseParam.code!=''"> |
| | | and nei_code = #{houseParam.code} |
| | | </if> |
| | | <include refid="filterHouseGrid"/> |
| | | <include refid="filterGrid"/> |
| | | group by street_ru_code,street_ru_name |
| | | </select> |
| | | |
| | |
| | | select address_code as addressCode, |
| | | IFNULL(CONCAT(doorplate_num,sub_door_plate_no), IF(doorplate_num IS NULL, sub_door_plate_no, doorplate_num)) as floor, |
| | | 3 as addressType |
| | | from jczz_doorplate_address |
| | | from jczz_doorplate_address jda |
| | | left join jczz_grid_range jgr on jda.address_code = jgr.house_code |
| | | where 1=1 |
| | | and street_ru_code = #{houseParam.code} |
| | | and nei_code = #{houseParam.name} |
| | | and aoi_code is null |
| | | and doorplate_type = '中门牌' |
| | | <include refid="filterHouseGrid"/> |
| | | <include refid="filterGrid"/> |
| | | order by doorplate_num,sub_door_plate_no |
| | | </select> |
| | | |