linwe
2023-12-21 224e0bbfc8d24785fea2e0160c36d7a8f6cd7269
src/main/java/org/springblade/modules/house/mapper/HouseMapper.xml
@@ -131,28 +131,32 @@
    <!--自定义分页列表-->
    <select id="selectHousePage" resultMap="houseAndHouseLabelMap">
        select jh.*,concat(building," ",unit," ",room) as address from jczz_house jh
        select
        jh.*,
        concat(building," ",unit," ",room) as address,
        jda.town_street_name as townStreetName,jda.nei_name as neiName
        from jczz_house jh
        left join jczz_doorplate_address jda on jda.address_code = jh.house_code
        where is_deleted = 0
        <if test="house.id != null "> and id = #{house.id}</if>
        where jh.is_deleted = 0
        <if test="house.id != null "> and jh.id = #{house.id}</if>
        <if test="house.streetCode != null and house.streetCode != ''">
         and jda.town_street_code like concat('%',#{house.streetCode},'%')
            and jda.town_street_code like concat('%',#{house.streetCode},'%')
        </if>
        <if test="house.houseCode != null  and house.houseCode != ''"> and house_code = #{house.houseCode}</if>
        <if test="house.districtCode != null  and house.districtCode != ''"> and district_code = #{house.districtCode}</if>
        <if test="house.houseCode != null  and house.houseCode != ''"> and jh.house_code = #{house.houseCode}</if>
        <if test="house.districtCode != null  and house.districtCode != ''"> and jh.district_code = #{house.districtCode}</if>
        <if test="house.districtName != null  and house.districtName != ''">
            and district_name like concat('%',#{house.districtName},'%')
         </if>
            and jh.district_name like concat('%',#{house.districtName},'%')
        </if>
        <if test="house.houseName != null  and house.houseName != ''"> and jh.house_name like concat('%',#{house.houseName},'%')</if>
        <if test="house.phone != null  and house.phone != ''"> and phone = #{house.phone}</if>
        <if test="house.area != null "> and area = #{house.area}</if>
        <if test="house.propertyPrice != null "> and property_price = #{house.propertyPrice}</if>
        <if test="house.serviceDue != null "> and service_due = #{house.serviceDue}</if>
        <if test="house.floor != null "> and floor = #{house.floor}</if>
        <if test="house.building != null  and house.building != ''"> and building = #{house.building}</if>
        <if test="house.unit != null  and house.unit != ''"> and unit = #{house.unit}</if>
        <if test="house.room != null  and house.room != ''"> and room = #{house.room}</if>
        <if test="house.buildingNo != null "> and building_no = #{house.buildingNo}</if>
        <if test="house.phone != null  and house.phone != ''"> and jh.phone = #{house.phone}</if>
        <if test="house.area != null "> and jh.area = #{house.area}</if>
        <if test="house.propertyPrice != null "> and jh.property_price = #{house.propertyPrice}</if>
        <if test="house.serviceDue != null "> and jh.service_due = #{house.serviceDue}</if>
        <if test="house.floor != null "> and jh.floor = #{house.floor}</if>
        <if test="house.building != null  and house.building != ''"> and jh.building = #{house.building}</if>
        <if test="house.unit != null  and house.unit != ''"> and jh.unit = #{house.unit}</if>
        <if test="house.room != null  and house.room != ''"> and jh.room = #{house.room}</if>
        <if test="house.buildingNo != null "> and jh.building_no = #{house.buildingNo}</if>
    </select>
    <!--房屋自定义详情查询-->
@@ -161,8 +165,8 @@
        jh.*,
        jhl.id as cid,jhl.*,jhl.remark as cremark
        from jczz_house jh
        left join jczz_user_house_label jhl on jh.house_code = jhl.house_code
        where jh.is_deleted = 0 and jhl.lable_type = 2
        left join jczz_user_house_label jhl on jh.house_code = jhl.house_code and jhl.lable_type = 2
        where jh.is_deleted = 0
        and jh.house_code = #{house.houseCode}
    </select>
@@ -263,6 +267,17 @@
        WHERE
        jda.nei_code = #{code}
        AND jh.is_deleted = 0
        <if test="buildingCode != null  and buildingCode != ''">
            and jda.building_code=#{buildingCode}
        </if>
        <if test="unitCode != null  and unitCode != ''">
            and jda.unit_code=#{unitCode}
        </if>
        <if test="aoiCode != null  and aoiCode != ''">
            and jda.aoi_code=#{aoiCode}
        </if>
        <if test="userId != null">
        AND jda.address_code IN (
        SELECT DISTINCT
@@ -294,6 +309,19 @@
        WHERE
        jda.nei_code = #{code}
        AND jh.is_deleted = 0
        and jda.doorplate_type = '户室牌'
        <if test="buildingCode != null  and buildingCode != ''">
            and jda.building_code=#{buildingCode}
        </if>
        <if test="unitCode != null  and unitCode != ''">
            and jda.unit_code=#{unitCode}
            AND jda.unit_code is not null
        </if>
        <if test="aoiCode != null  and aoiCode != ''">
            and jda.aoi_code=#{aoiCode}
        </if>
        <if test="userId != null">
            AND jda.address_code IN (
            SELECT DISTINCT
@@ -321,6 +349,19 @@
        WHERE
        jda.nei_code =  #{code}
        AND jhh.is_deleted = 0
        and jda.doorplate_type = '户室牌'
        <if test="buildingCode != null  and buildingCode != ''">
            and jda.building_code=#{buildingCode}
        </if>
        <if test="unitCode != null  and unitCode != ''">
            and jda.unit_code=#{unitCode}
            AND jda.unit_code is not null
        </if>
        <if test="aoiCode != null  and aoiCode != ''">
            and jda.aoi_code=#{aoiCode}
        </if>
        <if test="userId != null">
        AND jda.address_code IN (
        SELECT
@@ -350,6 +391,18 @@
        WHERE
        jda.nei_code = #{code}
        AND jh.is_deleted = 0
        AND jda.unit_code is not null
        <if test="buildingCode != null  and buildingCode != ''">
            and jda.building_code=#{buildingCode}
        </if>
        <if test="unitCode != null  and unitCode != ''">
            and jda.unit_code=#{unitCode}
        </if>
        <if test="aoiCode != null  and aoiCode != ''">
            and jda.aoi_code=#{aoiCode}
        </if>
        <if test="userId != null">
            AND jda.address_code IN (
            SELECT DISTINCT