From f45b80c5f8836bfb16b6cfff7df29aec631131ed Mon Sep 17 00:00:00 2001 From: 44323 <443237572@qq.com> Date: 星期二, 16 一月 2024 17:19:56 +0800 Subject: [PATCH] 发布房源 默认为审核通过和已上架状态 --- guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/AppUserMapper.xml | 78 ++++++++++++++++++++++++++++++++++----- 1 files changed, 68 insertions(+), 10 deletions(-) diff --git a/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/AppUserMapper.xml b/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/AppUserMapper.xml index 55c7584..b3ff126 100644 --- a/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/AppUserMapper.xml +++ b/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/AppUserMapper.xml @@ -9,30 +9,88 @@ COUNT(t2.id) AS houseCount from t_app_user t1 left join t_house_resource t2 on t1.id = t2.insert_user_id + and t2.auth_status = 2 + and t2.is_delete = 0 + and t2.status = 1 + and t2.type = 2 <where> <if test="null != req.name and '' != req.name"> - and t1.nickname = CONCAT('%', #{req.name}, '%') + and t1.nickname like CONCAT('%', #{req.name}, '%') + or t1.company_name like CONCAT('%', #{req.name}, '%') </if> - <if test="null != cityIds"> + + <if test="null != districtIds and districtIds.size()>0"> and t1.city_id in - <foreach collection="cityIds" item="item" index="index" separator="," open="(" close=")"> - #{item} - </foreach> - </if> - <if test="null != districtIds"> - and t1.district_id in <foreach collection="districtIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </if> - and t1.audit_status = 2 + + <if test="null != cityIds and cityIds.size()>0"> + and t1.district_id in + <foreach collection="cityIds" item="item" index="index" separator="," open="(" close=")"> + #{item} + </foreach> + </if> + and t1.auth = 2 + and t1.status = 1 + and t1.user_type = 3 + </where> + group by t1.id + order by houseCount desc + limit #{req.pageNum}, #{req.pageSize} + </select> + <select id="searchIntermediaryList1" + resultType="com.stylefeng.guns.modular.system.warpper.res.SearchIntermediaryListRes"> + select t1.id,t1.profile_photo as profilePhoto,t1.nickname as nickname,t1.company_name as companyName, + t1.company_address as companyAddress,t1.introduce as introduce,t1.phone as phone, + COUNT(t2.id) AS houseCount + from t_app_user t1 + left join t_house_resource t2 on t1.id = t2.insert_user_id + and t2.auth_status = 2 + and t2.is_delete = 0 + and t2.status = 1 + and t2.type = 2 + <where> + <if test="null != req.name and '' != req.name"> + and t1.nickname like CONCAT('%', #{req.name}, '%') + or t1.company_name like CONCAT('%', #{req.name}, '%') + </if> + <if test="null != cityIds and cityIds.size()>0"> + and t1.district_id in + <foreach collection="cityIds" item="item" index="index" separator="," open="(" close=")"> + #{item} + </foreach> + </if> + <if test="null != districtIds and districtIds.size()>0"> + and t1.city_id in + <foreach collection="districtIds" item="item" index="index" separator="," open="(" close=")"> + #{item} + </foreach> + </if> + and t1.auth = 2 + and t1.status = 1 + and t1.user_type = 3 + </where> + group by t1.id + order by houseCount desc + </select> + <select id="searchIntermediaryInfo" resultType="com.stylefeng.guns.modular.system.warpper.res.SearchIntermediaryListRes"> + select t1.id,t1.profile_photo as profilePhoto,t1.nickname as nickname,t1.company_name as companyName, + t1.company_address as companyAddress,t1.introduce as introduce,t1.phone as phone, + COUNT(t2.id) AS houseCount + from t_app_user t1 + left join t_house_resource t2 on t1.id = t2.insert_user_id + where + t1.audit_status = 2 and t1.status = 1 and t1.user_type = 3 and t2.auth_status = 2 + and t2.app_user_id = #{id} and t2.is_delete = 0 and t2.status = 1 and t2.type=2 - </where> + and t1.id = #{id} group by t1.id order by houseCount desc </select> -- Gitblit v1.7.1