44323
2023-12-04 fd83395529437e0c02b8d69b039fe52d40a4ec62
guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml
@@ -29,6 +29,7 @@
        left join t_region rc on (hr.district_id = rc.id)
        left join t_region rp on (rp.id = rc.parent_id)
        where hr.is_delete = 0 and hr.`status` = 1 and hr.auth_status = 2
        and hr.type=2
        <if test="null != req.type">
            and hr.data_type = #{req.type}
        </if>
@@ -41,13 +42,13 @@
        <if test="null != req.content and '' != req.content">
            and hr.title = CONCAT('%', #{req.content}, '%')
        </if>
        <if test="null != cityIds">
        <if test="null != cityIds and cityIds.size()>0" >
            and hr.city_id in
            <foreach collection="cityIds" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
        <if test="null != districtIds">
        <if test="null != districtIds and districtIds.size()>0">
            and hr.district_id in
            <foreach collection="districtIds" item="item" index="index" separator="," open="(" close=")">
                #{item}
@@ -124,6 +125,7 @@
        from t_house_resource hr
        left join t_app_user au on (hr.app_user_id = au.id)
        where hr.is_delete = 0 and hr.`status` = 1 and hr.auth_status = 2
        and hr.type=2
        <if test="null != req.type">
            and hr.data_type = #{req.type}
        </if>
@@ -136,13 +138,13 @@
        <if test="null != req.content and '' != req.content">
            and hr.title = CONCAT('%', #{req.content}, '%')
        </if>
        <if test="null != cityIds">
        <if test="null != cityIds and cityIds.size()>0" >
            and hr.city_id in
            <foreach collection="cityIds" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
        <if test="null != districtIds">
        <if test="null != districtIds and districtIds.size()>0">
            and hr.district_id in
            <foreach collection="districtIds" item="item" index="index" separator="," open="(" close=")">
                #{item}
@@ -215,6 +217,7 @@
            from t_house_resource hr
            left join t_app_user au on (hr.app_user_id = au.id)
            where hr.is_delete = 0 and hr.`status` = 1 and hr.auth_status = 2
        and hr.type=2
            <if test="null != userType and 4 != userType">
                and au.user_type = #{userType} and au.status = 1 and au.audit_status = 2
            </if>
@@ -229,6 +232,97 @@
        left join t_region r on (dn.district_id = r.id)
        left join t_region pr on (pr.id = r.parent_id)
    </select>
    <select id="listHouse"
            resultType="com.stylefeng.guns.modular.system.warpper.res.SearchHouseResourceListRes">
        select
        hr.id,
        hr.house_photo as imgUrl,
        hr.title,
        hr.house_area as houseArea,
        hr.house_model as houseModel,
        concat(rp.`name`, rc.`name`) as address,
        hr.longitude,
        hr.latitude,
        hr.sale_amount as saleAmount,
        hr.elevator,
        hr.drying_area as dryingArea,
        hr.garden,
        hr.carport,
        hr.balcony,
        hr.keep_pet as keepPet
        from t_house_resource hr
        left join t_region rc on (hr.district_id = rc.id)
        left join t_region rp on (rp.id = rc.parent_id)
        where hr.is_delete = 0 and hr.`status` = 1 and hr.auth_status = 2
        and hr.type=2
        and hr.app_user_id = #{query.id}
        and hr.data_type = #{query.type}
    </select>
    <select id="collect" resultType="com.stylefeng.guns.modular.system.warpper.res.CollectListRes">
        select
        hr.id,
        hr.title,
        hr.sale_amount as saleAmount,
        hr.elevator,
        hr.drying_area as dryingArea,
        hr.garden,
        hr.carport,
        hr.balcony,
        hr.city_id as cityId,
        hr.district_id as districtId,
        hr.keep_pet as keepPet,
        hr.views_number as viewsNumber,
        hr.code as code,
        hr.leaseTime as leaseTime,
        hr.data_type as dataType,
        hr.insert_time as insertTime,hr.type as `type`,
        hr.status as status
        from t_house_resource hr
        left join t_collection_house_resource t1 on hr.id = t1.house_resource_id
        where hr.is_delete = 0 and hr.`status` = 1 and hr.auth_status = 2
        <if test="null != ids and ids.size()>0">
            and hr.id in
            <foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
    </select>
    <select id="release" resultType="com.stylefeng.guns.modular.system.warpper.res.CollectListRes">
        select
        hr.id,
        hr.title,
        hr.sale_amount as saleAmount,
        hr.elevator,
        hr.drying_area as dryingArea,
        hr.garden,
        hr.carport,
        hr.balcony,
        hr.app_user_id as appUserId,
        hr.city_id as cityId,
        hr.district_id as districtId,
        hr.keep_pet as keepPet,
        hr.views_number as viewsNumber,
        hr.code as code,
        hr.leaseTime as leaseTime,
        hr.data_type as dataType,
        hr.house_photo as housePhoto,
        hr.house_video as houseVideo,
        hr.insert_time as insertTime,hr.type as `type`,
        hr.status as status,
        au.profile_photo as profilePhoto,
        au.nickname as nickname,
        au.user_type as userType
        from t_house_resource hr
        left join t_collection_house_resource t1 on hr.id = t1.house_resource_id
        left join t_app_user au on hr.app_user_id = au.id
        where hr.is_delete = 0 and hr.`status` = 1 and hr.auth_status = 2
        <if test="null != ids and ids.size()>0">
            and hr.id in
            <foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
    </select>
</mapper>