Commit 90da7c48 authored by lixuan's avatar lixuan

Merge branch 'dev-lx' into 'dev'

feat: 房源

See merge request !133
parents 6c044a56 f69ee1d7
Pipeline #143270 passed with stages
in 5 minutes and 4 seconds
......@@ -53,8 +53,13 @@ public class HouseResourceController {
return AjaxResult.success(houseResourceService.pageHouseResources(query));
}
@GetMapping("/list")
@GetMapping("/profileGraph")
public AjaxResult getProfileGraphHouseResources(HouseResourcePageQuery query) {
return AjaxResult.success(houseResourceService.profileGraphHouseResources(query));
}
@GetMapping("/list")
public AjaxResult getListHouseResources(HouseResourcePageQuery query) {
return AjaxResult.success(houseResourceService.listHouseResources(query));
}
}
......@@ -23,4 +23,6 @@ public interface HouseResourceMapper {
IPage<HouseResourcePage> selectPage(IPage<HouseResource> page, @Param("query") HouseResourcePageQuery houseResourcePageQuery);
List<HouseResourcePage> selectProfileGraph(@Param("query") HouseResourcePageQuery houseResourcePageQuery);
List<HouseResourcePage> selectList(@Param("query") HouseResourcePageQuery houseResourcePageQuery);
}
......@@ -21,4 +21,6 @@ public interface HouseResourceService {
IPage<HouseResourcePage> pageHouseResources(HouseResourcePageQuery query);
List<HouseResourceProfileGraph> profileGraphHouseResources(HouseResourcePageQuery query);
List<HouseResourcePage> listHouseResources(HouseResourcePageQuery query);
}
......@@ -171,6 +171,16 @@ public class HouseResourceServiceImpl implements HouseResourceService {
return resourceProfileGraphList;
}
@Override
public List<HouseResourcePage> listHouseResources(HouseResourcePageQuery query) {
List<HouseResourcePage> list = houseResourceMapper.selectList(query);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
} else {
return handleHouseList(list);
}
}
private List<HouseResourcePage> handleHouseList(List<HouseResourcePage> list) {
list.forEach(x -> {
GridRegion two = gridRegionMapper.selectByPrimaryKey(x.getTwo());
......
......@@ -175,4 +175,38 @@
</if>
</where>
</select>
<select id="selectList" resultType="com.ruoyi.system.domain.house.vo.HouseResourcePage">
SELECT
t1.wg_name AS wgName4,
t2.*
FROM
grid_region t1
LEFT JOIN house_resource t2 ON t1.id = t2.four
<where>
<if test="query.wgType != null">
and t2.type = #{query.wgType}
</if>
<if test="query.two != null and query.two != ''">
and t2.two = #{query.two}
</if>
<if test="query.three != null and query.three != ''">
and t2.three = #{query.three}
</if>
<if test="query.four != null and query.four != ''">
and t2.four = #{query.four}
</if>
<if test="query.houseResourceAttribute != null">
and t2.house_resource_attribute = #{query.houseResourceAttribute}
</if>
<if test="query.hireStatus != null">
and t2.hire_status = #{query.hireStatus}
</if>
<if test="query.houseNumber != null and query.houseNumber != ''">
and t2.house_number like concat('%', #{query.houseNumber}, '%')
</if>
<if test="query.sortWay != null and query.sortWay != ''">
order by t2.house_area ${query.sortWay}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
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