From aa8ff2d61669d0779fdacdba76e26388587b435d Mon Sep 17 00:00:00 2001 From: 44323 <443237572@qq.com> Date: 星期四, 22 二月 2024 15:40:23 +0800 Subject: [PATCH] 租房新增需求 --- guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml | 35 ++++++++++++++++++++++------------- 1 files changed, 22 insertions(+), 13 deletions(-) diff --git a/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml b/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml index 97aaf44..e385b58 100644 --- a/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml +++ b/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml @@ -7,7 +7,7 @@ <select id="searchHouseResource" resultType="com.stylefeng.guns.modular.system.warpper.res.SearchHouseResourceListRes"> select hr.id, - au.user_type as houseResource, + IFNULL(au.user_type,0)as houseResource, hr.house_photo as imgUrl, hr.title, hr.house_area as houseArea, @@ -15,6 +15,7 @@ concat(rp.`name`, rc.`name`) as address, hr.longitude, hr.latitude, + hr.headImg, hr.platform, hr.sale_amount as saleAmount, IFNULL(au.nickname,su.`name`) as nickname, @@ -37,10 +38,10 @@ left join t_region rp on (rp.id = rc.parent_id) left join t_house_type tp on hr.house_type_id = tp.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 2 == req.type"> - and hr.data_type = #{req.type} + <if test="null != req.type and req.type == 1"> + and (hr.data_type = #{req.type}) </if> - <if test="null != req.type and 1 == req.type"> + <if test="null != req.type and req.type == 2"> and hr.data_type = #{req.type} </if> <if test="null != req.userType and 2 == req.userType"> @@ -70,7 +71,7 @@ #{item} </foreach> </if> - <if test="null != saleAmountStart and null != saleAmountEnd"> + <if test="req.type!=null and req.type==2 and null != saleAmountStart and null != saleAmountEnd"> and hr.sale_amount >= #{saleAmountStart} and hr.sale_amount < #{saleAmountEnd} </if> <if test="null != houseModels"> @@ -146,25 +147,30 @@ hr.latitude, hr.platform, hr.sale_amount as saleAmount, + IFNULL(au.nickname,su.`name`) as nickname, + IFNULL(au.profile_photo,su.avatar) as profilePhoto, au.profile_photo as profilePhoto, - au.nickname, - hr.elevator, hr.drying_area as dryingArea, hr.garden, hr.carport, hr.air, hr.balcony, + hr.is_manage as isManage, hr.leaseTime, - hr.keep_pet as keepPet + tp.name as houseTypeName, + hr.keep_pet as keepPet, + hr.insert_time as insertTime from t_house_resource hr left join t_app_user au on (hr.app_user_id = au.id) + LEFT JOIN sys_user su ON hr.insert_user_id = su.id AND hr.is_manage = 1 left join t_region rc on (hr.district_id = rc.id) left join t_region rp on (rp.id = rc.parent_id) + left join t_house_type tp on hr.house_type_id = tp.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 2 == req.type"> - and hr.data_type = #{req.type} + <if test="null != req.type and req.type == 1"> + and (hr.data_type = #{req.type}) </if> - <if test="null != req.type and 1 == req.type"> + <if test="null != req.type and req.type == 2"> and hr.data_type = #{req.type} </if> <if test="null != req.userType and 2 == req.userType"> @@ -194,7 +200,7 @@ #{item} </foreach> </if> - <if test="null != saleAmountStart and null != saleAmountEnd"> + <if test="req.type!=null and req.type==2 and null != saleAmountStart and null != saleAmountEnd"> and hr.sale_amount >= #{saleAmountStart} and hr.sale_amount < #{saleAmountEnd} </if> <if test="null != houseModels"> @@ -242,7 +248,7 @@ <if test="null != req.dataType and req.dataType == 2"> and now() <= DATE_ADD(hr.insert_time,INTERVAL 21 day) </if> - order by au.user_type desc,hr.insert_time desc + order by au.user_type desc <if test="null != req.sort and req.sort == 1"> ,hr.insert_time desc </if> @@ -466,6 +472,8 @@ hr.garden as garden, hr.carport as carport, hr.balcony as balcony, + + hr.app_user_id as appuserId, hr.city_id as cityId, hr.district_id as districtId, @@ -496,6 +504,7 @@ hr.garden, hr.carport, hr.balcony, + hr.app_user_id as appUserId, hr.city_id as cityId, hr.district_id as districtId, -- Gitblit v1.7.1