Commit bc55252b authored by lixuan's avatar lixuan

feat: 房源

parent e352625f
...@@ -39,4 +39,6 @@ public class HouseResourcePageQuery extends PageDomain { ...@@ -39,4 +39,6 @@ public class HouseResourcePageQuery extends PageDomain {
private BigDecimal yearSellMax; private BigDecimal yearSellMax;
private List<String> wgCodes; private List<String> wgCodes;
private String name;
} }
...@@ -18,8 +18,9 @@ public class HouseResourceProfileGraph { ...@@ -18,8 +18,9 @@ public class HouseResourceProfileGraph {
private long kzCount; private long kzCount;
@Deprecated
private BigDecimal jzArea; private BigDecimal jzArea;
private BigDecimal areaTotal;
private List<HouseResourcePage> houseResources; private List<HouseResourcePage> houseResources;
} }
...@@ -187,9 +187,14 @@ public class HouseResourceServiceImpl implements HouseResourceService { ...@@ -187,9 +187,14 @@ public class HouseResourceServiceImpl implements HouseResourceService {
if (StringUtils.hasText(wgName)) { if (StringUtils.hasText(wgName)) {
houseResourceProfileGraph.setWgName(wgName); houseResourceProfileGraph.setWgName(wgName);
} }
String jzAreaByCode = gridRegionMapper.getJzAreaByCode(k);
if (StringUtils.hasText(jzAreaByCode)) {
houseResourceProfileGraph.setJzArea(new BigDecimal(jzAreaByCode));
}
houseResourceProfileGraph.setJyArea(v.stream().map(HouseResourcePage::getHouseArea).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)); houseResourceProfileGraph.setJyArea(v.stream().map(HouseResourcePage::getHouseArea).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
houseResourceProfileGraph.setKzCount(v.stream().filter(x -> x.getHouseResourceType() == HouseEnums.HouseResourceTypeEnum.KZ.getCode()).count()); houseResourceProfileGraph.setKzCount(v.stream().filter(x -> x.getHouseResourceType() == HouseEnums.HouseResourceTypeEnum.KZ.getCode()).count());
houseResourceProfileGraph.setKzArea(v.stream().filter(x -> x.getHouseResourceType() == HouseEnums.HouseResourceTypeEnum.KZ.getCode()).map(HouseResourcePage::getHouseArea).reduce(BigDecimal.ZERO, BigDecimal::add)); houseResourceProfileGraph.setKzArea(v.stream().filter(x -> x.getHouseResourceType() == HouseEnums.HouseResourceTypeEnum.KZ.getCode()).map(HouseResourcePage::getHouseArea).reduce(BigDecimal.ZERO, BigDecimal::add));
houseResourceProfileGraph.setAreaTotal(v.stream().map(HouseResourcePage::getHouseArea).reduce(BigDecimal.ZERO, BigDecimal::add));
List<HouseResourcePage> houseResourcePages = handleHouseList(v); List<HouseResourcePage> houseResourcePages = handleHouseList(v);
houseResourceProfileGraph.setHouseResources(houseResourcePages.stream().sorted(Comparator.comparing(HouseResourcePage::getHouseNumber)).collect(Collectors.toList())); houseResourceProfileGraph.setHouseResources(houseResourcePages.stream().sorted(Comparator.comparing(HouseResourcePage::getHouseNumber)).collect(Collectors.toList()));
resourceProfileGraphList.add(houseResourceProfileGraph); resourceProfileGraphList.add(houseResourceProfileGraph);
......
...@@ -152,6 +152,9 @@ ...@@ -152,6 +152,9 @@
<if test="query.houseResourceType != null"> <if test="query.houseResourceType != null">
and t1.house_resource_type = #{query.houseResourceType} and t1.house_resource_type = #{query.houseResourceType}
</if> </if>
<if test="query.name != null and query.name != ''">
and t3.name like concat('%', #{query.name}, '%')
</if>
<if test="query.yearSellMin != null and query.yearSellMin != '' and query.yearSellMax != null and query.yearSellMax != ''"> <if test="query.yearSellMin != null and query.yearSellMin != '' and query.yearSellMax != null and query.yearSellMax != ''">
and t4.year_sell <![CDATA[ >= ]]> #{query.yearSellMin} and t4.year_sell <![CDATA[ <= ]]> #{query.yearSellMax} and t4.year_sell <![CDATA[ >= ]]> #{query.yearSellMin} and t4.year_sell <![CDATA[ <= ]]> #{query.yearSellMax}
</if> </if>
......
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