Commit bf86d636 authored by lixuan's avatar lixuan

Merge branch 'dev-lx' into 'dev'

feat: 房源

See merge request !142
parents e9fae526 eddc7e0a
Pipeline #143317 passed with stages
in 5 minutes and 11 seconds
......@@ -163,8 +163,10 @@ public class HouseResourceServiceImpl implements HouseResourceService {
collect.forEach((k, v) -> {
HouseResourceProfileGraph houseResourceProfileGraph = new HouseResourceProfileGraph();
houseResourceProfileGraph.setId(k);
GridRegion gridRegion = gridRegionMapper.selectByPrimaryKey(k);
houseResourceProfileGraph.setWgName(gridRegion.getWgName());
String wgName = gridRegionMapper.getWgNameByCode(k);
if (StringUtils.hasText(wgName)) {
houseResourceProfileGraph.setWgName(wgName);
}
houseResourceProfileGraph.setHouseResources(handleHouseList(v));
resourceProfileGraphList.add(houseResourceProfileGraph);
});
......@@ -183,12 +185,18 @@ public class HouseResourceServiceImpl implements HouseResourceService {
private List<HouseResourcePage> handleHouseList(List<HouseResourcePage> list) {
list.forEach(x -> {
String wgNameByCode = gridRegionMapper.getWgNameByCode(x.getTwo());
if (StringUtils.hasText(wgNameByCode)) {
x.setWgName2(wgNameByCode);
GridRegionExample twoExample = new GridRegionExample();
twoExample.createCriteria().andWgTypeEqualTo(String.valueOf(x.getType())).andWgCodeEqualTo(x.getTwo());
List<GridRegion> two = gridRegionMapper.selectByExample(twoExample);
if (!CollectionUtils.isEmpty(two)) {
x.setWgName2(two.get(0).getWgName());
}
GridRegionExample threeExample = new GridRegionExample();
threeExample.createCriteria().andWgTypeEqualTo(String.valueOf(x.getType())).andWgCodeEqualTo(x.getThree());
List<GridRegion> three = gridRegionMapper.selectByExample(threeExample);
if (!CollectionUtils.isEmpty(three)) {
x.setWgName3(three.get(0).getWgName());
}
GridRegion three = gridRegionMapper.selectByPrimaryKey(x.getThree());
x.setWgName3(three.getWgName());
x.setHouseResourceAttributeText(HouseEnums.HouseResourceAttributeEnum.getDescByCode(x.getHouseResourceAttribute()));
x.setHouseResourceTypeText(HouseEnums.HouseResourceTypeEnum.getDescByCode(x.getHouseResourceType()));
x.setOrientationText(HouseEnums.OrientationEnum.getDescByCode(x.getOrientation()));
......
......@@ -139,10 +139,10 @@
<if test="query.houseNumber != null and query.houseNumber != ''">
and t1.house_number like concat('%', #{query.houseNumber}, '%')
</if>
<if test="query.sortWay != null and query.sortWay != ''">
order by t1.house_area ${query.sortWay}
</if>
</where>
<if test="query.sortWay != null and query.sortWay != ''">
order by t1.house_area ${query.sortWay}
</if>
</select>
<select id="selectProfileGraph" resultType="com.ruoyi.system.domain.house.vo.HouseResourcePage">
SELECT
......@@ -173,8 +173,8 @@
<if test="query.houseNumber != null and query.houseNumber != ''">
and t1.house_number like concat('%', #{query.houseNumber}, '%')
</if>
order by t1.four DESC
</where>
order by t1.four DESC
</select>
<select id="selectList" resultType="com.ruoyi.system.domain.house.vo.HouseResourcePage">
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