Commit 0aa00895 authored by lixuan's avatar lixuan

feat: 房源

parent e4c26b40
...@@ -183,9 +183,10 @@ public class HouseResourceServiceImpl implements HouseResourceService { ...@@ -183,9 +183,10 @@ public class HouseResourceServiceImpl implements HouseResourceService {
private List<HouseResourcePage> handleHouseList(List<HouseResourcePage> list) { private List<HouseResourcePage> handleHouseList(List<HouseResourcePage> list) {
list.forEach(x -> { list.forEach(x -> {
GridRegion two = gridRegionMapper.selectByPrimaryKey(x.getTwo()); String wgNameByCode = gridRegionMapper.getWgNameByCode(x.getTwo());
x.setWgName2(two.getWgName()); if (StringUtils.hasText(wgNameByCode)) {
x.setWgName2(wgNameByCode);
}
GridRegion three = gridRegionMapper.selectByPrimaryKey(x.getThree()); GridRegion three = gridRegionMapper.selectByPrimaryKey(x.getThree());
x.setWgName3(three.getWgName()); x.setWgName3(three.getWgName());
x.setHouseResourceAttributeText(HouseEnums.HouseResourceAttributeEnum.getDescByCode(x.getHouseResourceAttribute())); x.setHouseResourceAttributeText(HouseEnums.HouseResourceAttributeEnum.getDescByCode(x.getHouseResourceAttribute()));
......
...@@ -112,35 +112,35 @@ ...@@ -112,35 +112,35 @@
<select id="selectPage" resultType="com.ruoyi.system.domain.house.vo.HouseResourcePage"> <select id="selectPage" resultType="com.ruoyi.system.domain.house.vo.HouseResourcePage">
SELECT SELECT
t1.wg_name AS wgName4, t2.wg_name AS wgName4,
t2.* t1.*
FROM FROM
grid_region t1 house_resource t1
LEFT JOIN house_resource t2 ON t1.id = t2.four LEFT JOIN grid_region t2 ON t2.wg_code = t1.four
<where> <where>
<if test="query.wgType != null"> <if test="query.wgType != null">
and t2.type = #{query.wgType} and t1.type = #{query.wgType}
</if> </if>
<if test="query.two != null and query.two != ''"> <if test="query.two != null and query.two != ''">
and t2.two = #{query.two} and t1.two = #{query.two}
</if> </if>
<if test="query.three != null and query.three != ''"> <if test="query.three != null and query.three != ''">
and t2.three = #{query.three} and t1.three = #{query.three}
</if> </if>
<if test="query.four != null and query.four != ''"> <if test="query.four != null and query.four != ''">
and t2.four = #{query.four} and t1.four = #{query.four}
</if> </if>
<if test="query.houseResourceAttribute != null"> <if test="query.houseResourceAttribute != null">
and t2.house_resource_attribute = #{query.houseResourceAttribute} and t1.house_resource_attribute = #{query.houseResourceAttribute}
</if> </if>
<if test="query.hireStatus != null"> <if test="query.hireStatus != null">
and t2.hire_status = #{query.hireStatus} and t1.hire_status = #{query.hireStatus}
</if> </if>
<if test="query.houseNumber != null and query.houseNumber != ''"> <if test="query.houseNumber != null and query.houseNumber != ''">
and t2.house_number like concat('%', #{query.houseNumber}, '%') and t1.house_number like concat('%', #{query.houseNumber}, '%')
</if> </if>
<if test="query.sortWay != null and query.sortWay != ''"> <if test="query.sortWay != null and query.sortWay != ''">
order by t2.house_area ${query.sortWay} order by t1.house_area ${query.sortWay}
</if> </if>
</where> </where>
</select> </select>
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
t1.* t1.*
FROM FROM
house_resource t1 house_resource t1
LEFT JOIN grid_region t2 ON t1.four = t2.id LEFT JOIN grid_region t2 ON t2.wg_code = t1.four
<where> <where>
<if test="query.wgType != null"> <if test="query.wgType != null">
and t1.type = #{query.wgType} and t1.type = #{query.wgType}
...@@ -173,39 +173,40 @@ ...@@ -173,39 +173,40 @@
<if test="query.houseNumber != null and query.houseNumber != ''"> <if test="query.houseNumber != null and query.houseNumber != ''">
and t1.house_number like concat('%', #{query.houseNumber}, '%') and t1.house_number like concat('%', #{query.houseNumber}, '%')
</if> </if>
order by t1.four DESC
</where> </where>
</select> </select>
<select id="selectList" resultType="com.ruoyi.system.domain.house.vo.HouseResourcePage"> <select id="selectList" resultType="com.ruoyi.system.domain.house.vo.HouseResourcePage">
SELECT SELECT
t1.wg_name AS wgName4, t2.wg_name AS wgName4,
t2.* t1.*
FROM FROM
grid_region t1 house_resource t1
LEFT JOIN house_resource t2 ON t1.id = t2.four LEFT JOIN grid_region t2 ON t2.wg_code = t1.four
<where> <where>
<if test="query.wgType != null"> <if test="query.wgType != null">
and t2.type = #{query.wgType} and t1.type = #{query.wgType}
</if> </if>
<if test="query.two != null and query.two != ''"> <if test="query.two != null and query.two != ''">
and t2.two = #{query.two} and t1.two = #{query.two}
</if> </if>
<if test="query.three != null and query.three != ''"> <if test="query.three != null and query.three != ''">
and t2.three = #{query.three} and t1.three = #{query.three}
</if> </if>
<if test="query.four != null and query.four != ''"> <if test="query.four != null and query.four != ''">
and t2.four = #{query.four} and t1.four = #{query.four}
</if> </if>
<if test="query.houseResourceAttribute != null"> <if test="query.houseResourceAttribute != null">
and t2.house_resource_attribute = #{query.houseResourceAttribute} and t1.house_resource_attribute = #{query.houseResourceAttribute}
</if> </if>
<if test="query.hireStatus != null"> <if test="query.hireStatus != null">
and t2.hire_status = #{query.hireStatus} and t1.hire_status = #{query.hireStatus}
</if> </if>
<if test="query.houseNumber != null and query.houseNumber != ''"> <if test="query.houseNumber != null and query.houseNumber != ''">
and t2.house_number like concat('%', #{query.houseNumber}, '%') and t1.house_number like concat('%', #{query.houseNumber}, '%')
</if> </if>
<if test="query.sortWay != null and query.sortWay != ''"> <if test="query.sortWay != null and query.sortWay != ''">
order by t2.house_area ${query.sortWay} order by t1.house_area ${query.sortWay}
</if> </if>
</where> </where>
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment