|
@@ -57,19 +57,35 @@ public class BaseGgpFacilityServiceImpl extends AbstractCrudService<BaseGgpFacil
|
|
|
public List<BaseGgpFacilityStatisticVO> statistic(BaseGgpFacilityVO baseGgpFacilityVO){
|
|
|
List<BaseGgpFacilityStatisticVO> list = new ArrayList<>();
|
|
|
QueryWrapper<BaseGgpFacility> queryWrapper = Wrappers.query();
|
|
|
- queryWrapper.select("street_town as streetTown","count(*) as count")
|
|
|
- .in("facility_type",baseGgpFacilityVO.getFacilityType())
|
|
|
- .groupBy("street_town");
|
|
|
- List<Map<String,Object>> maps = this.listMaps(queryWrapper);
|
|
|
- if(maps.size() > 0){
|
|
|
- for (int i = 0; i < maps.size(); i++) {
|
|
|
- BaseGgpFacilityStatisticVO statisticVO = new BaseGgpFacilityStatisticVO();
|
|
|
- statisticVO.setStreetTown(maps.get(i).get("streetTown").toString());
|
|
|
- statisticVO.setCount(Integer.parseInt(maps.get(i).get("count").toString()));
|
|
|
- list.add(statisticVO);
|
|
|
+ if(baseGgpFacilityVO.getStatisticType().equals("street")){
|
|
|
+ queryWrapper.select("street_town as streetTown","count(*) as count")
|
|
|
+ .in("facility_type",baseGgpFacilityVO.getFacilityType())
|
|
|
+ .groupBy("street_town");
|
|
|
+ List<Map<String,Object>> maps = this.listMaps(queryWrapper);
|
|
|
+ if(maps.size() > 0){
|
|
|
+ for (int i = 0; i < maps.size(); i++) {
|
|
|
+ BaseGgpFacilityStatisticVO statisticVO = new BaseGgpFacilityStatisticVO();
|
|
|
+ statisticVO.setStreetTown(maps.get(i).get("streetTown").toString());
|
|
|
+ statisticVO.setCount(Integer.parseInt(maps.get(i).get("count").toString()));
|
|
|
+ list.add(statisticVO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if(baseGgpFacilityVO.getStatisticType().equals("facilityType")){
|
|
|
+ queryWrapper.select("facility_type as facilityType","count(*) as count")
|
|
|
+ .in("facility_type",baseGgpFacilityVO.getFacilityType())
|
|
|
+ .groupBy("facility_type");
|
|
|
+ List<Map<String,Object>> maps = this.listMaps(queryWrapper);
|
|
|
+ if(maps.size() > 0){
|
|
|
+ for (int i = 0; i < maps.size(); i++) {
|
|
|
+ BaseGgpFacilityStatisticVO statisticVO = new BaseGgpFacilityStatisticVO();
|
|
|
+ statisticVO.setFacilityType(Integer.parseInt(maps.get(i).get("facilityType").toString()));
|
|
|
+ statisticVO.setCount(Integer.parseInt(maps.get(i).get("count").toString()));
|
|
|
+ list.add(statisticVO);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
return list;
|
|
|
}
|
|
|
}
|