lin
2024-03-25 9f8f9d13c42ca8cdccbf351069082a5fdccef2e4
src/main/java/org/springblade/modules/doorplateAddress/mapper/DoorplateAddressMapper.xml
@@ -263,7 +263,8 @@
            jda.id,ifnull(jda.unit_name,"未知单元") unitName,jda.unit_code unitCode,jda.floor,jda.house_name as houseNo,
            jda.address_code addressCode,
            jh.name as realName,jh.relationship as roleType,1 as addressType,
            juhl.id as cid,juhl.house_code,juhl.label_id,juhl.label_name,juhl.color,juhl.household_id
            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
            (
@@ -272,7 +273,8 @@
                )
            ) jh
            on jda.address_code = jh.house_code
            left join jczz_user_house_label juhl on juhl.house_code = jda.address_code and lable_type=1
            left join jczz_user_house_label juhl on juhl.house_code = jda.address_code and juhl.lable_type=1
            left join jczz_user_house_label juhlh on juhlh.house_code = jda.address_code and juhlh.lable_type=2
            where 1=1
            and floor != ''
            and house_name != ''
@@ -287,9 +289,11 @@
        (
            select jda2.id,'' as unitName,address_code as unitCode,doorplate_name as floor,'' as houseNo,address_code as addressCode,
            '' as realName,'' as roleType,2 as addressType,
            juhl.id as cid,juhl.house_code,juhl.label_id,juhl.label_name,juhl.color,juhl.household_id
            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_user_house_label juhl on juhl.house_code = jda2.address_code and lable_type=1
            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 != ''
@@ -484,6 +488,10 @@
        where 1=1
        and jh.house_code is null
        and doorplate_type = '户室牌'
        <if test="townName!=null and townName!=''">
            and jda.town_street_name like concat('%',#{townName},'%')
        </if>
        limit 0,1000
    </select>
    <!--查询商超-->
@@ -536,16 +544,18 @@
    <!--查询所有的地址表id集合-->
    <select id="getAoiCodeList" resultType="java.lang.Long">
        select
        max(id)
        min(id)
        from jczz_doorplate_address
        where aoi_code != "" and aoi_name !=""
            and doorplate_type = '大门牌'
        GROUP BY aoi_code
        union all
        (
        select
        max(id)
        min(id)
        from jczz_doorplate_address
        where aoi_code != "" and sub_aoi != ""
            and doorplate_type = '大门牌'
        group by aoi_code
        )
    </select>
@@ -568,12 +578,18 @@
        from jczz_doorplate_address jda
        left join jczz_grid_range jgr on jda.address_code = jgr.house_code
        where 1=1
        and (doorplate_type = '小门牌' or (doorplate_type = '中门牌' and address_level = 1))
--         and (doorplate_type = '小门牌' or (doorplate_type = '中门牌' and address_level = 1))
        <if test="doorplateAddress.addressName!=null and doorplateAddress.addressName!=''">
            and jda.address_name like concat('%',#{doorplateAddress.addressName},'%')
        </if>
        <if test="doorplateAddress.poi!=null and doorplateAddress.poi!=''">
            and jda.poi like concat('%',#{doorplateAddress.poi},'%')
        </if>
        <if test="doorplateAddress.addressCode!=null and doorplateAddress.addressCode!=''">
            and jda.address_code in
            <foreach collection="addressCode.split(',')" item="addressCode" open="(" close=")" separator=",">
                #{addressCode}
            </foreach>
        </if>
        <if test="isAdministrator==2">
            <choose>
@@ -654,4 +670,70 @@
            jda.nei_name,
            jda.town_street_code
    </select>
    <select id="getHouseBuildingCode"
            resultType="org.springblade.modules.doorplateAddress.vo.DoorplateAddressVO">
        SELECT DISTINCT
            jda.building_code,
            jda.building_name
        FROM
            jczz_doorplate_address jda
                LEFT JOIN jczz_district jd ON jd.aoi_code = jda.aoi_code
        WHERE
            jd.id = #{districtId}
          and jda.building_code is not null
    </select>
    <!--查询所有户室数据-->
    <select id="getNotHouseListCount" resultType="java.lang.Integer">
        select count(*) from jczz_doorplate_address jda
        left join jczz_house jh on jh.house_code = jda.address_code
        where 1=1
        and jh.house_code is null
        and doorplate_type = '户室牌'
        <if test="townName!=null and townName!=''">
            and jda.town_street_name like concat('%',#{townName},'%')
        </if>
        limit 0,1000
    </select>
    <!--查询网格范围表未绑定的地址表信息数量-->
    <select id="getNotBindGridRangeDoorListCount" resultType="java.lang.Integer">
        select count(*) from jczz_doorplate_address jda
        left join jczz_grid_range jgr on jgr.house_code = jda.address_code
        where 1=1
        and jgr.house_code is null
        <if test="townName!=null and townName!=''">
            and jda.town_street_name like concat('%',#{townName},'%')
        </if>
        <if test="communityName!=null and communityName!=''">
            and jda.nei_name like concat('%',#{communityName},'%')
        </if>
        limit 0,1000
    </select>
    <!--查询所有未匹配的网格范围地址数据-->
    <select id="getNotBindGridRangeDoorList" resultType="org.springblade.modules.doorplateAddress.entity.DoorplateAddressEntity">
        select
        jda.address_code,
        jda.aoi_code,
        jda.building_code,
        jda.x,
        jda.y
        from jczz_doorplate_address jda
        left join jczz_grid_range jgr on jgr.house_code = jda.address_code
        where 1=1
        and jgr.house_code is null
        <if test="townName!=null and townName!=''">
            and jda.town_street_name like concat('%',#{townName},'%')
        </if>
        <if test="communityName!=null and communityName!=''">
            and jda.nei_name like concat('%',#{communityName},'%')
        </if>
        limit 0,1000
    </select>
</mapper>