Commit 5973821a authored by wujipeng's avatar wujipeng
Browse files

优化

parent dbb37824
...@@ -33,7 +33,8 @@ public class BasicController { ...@@ -33,7 +33,8 @@ public class BasicController {
* 各路段检测修复汇总 * 各路段检测修复汇总
*/ */
@GetMapping("/summary") @GetMapping("/summary")
public Result<Map<String, Integer>> roadSummary(@RequestParam(name = "type") String type) { public Result<Map<String, Integer>> roadSummary(@RequestParam(name = "type") String type,
return Result.success(basicService.roadSummary(type)); @RequestParam(name = "region") String region) {
return Result.success(basicService.roadSummary(type, region));
} }
} }
...@@ -15,5 +15,5 @@ import java.util.Map; ...@@ -15,5 +15,5 @@ import java.util.Map;
public interface BasicService extends IService<BasicEntity> { public interface BasicService extends IService<BasicEntity> {
Map<String, Integer> roadDetail(RoadDTO roadDTO); Map<String, Integer> roadDetail(RoadDTO roadDTO);
Map<String, Integer> roadSummary(String type); Map<String, Integer> roadSummary(String type,String region);
} }
...@@ -59,10 +59,10 @@ public class BasicServiceImpl extends ServiceImpl<BasicMapper, BasicEntity> impl ...@@ -59,10 +59,10 @@ public class BasicServiceImpl extends ServiceImpl<BasicMapper, BasicEntity> impl
} }
@Override @Override
public Map<String, Integer> roadSummary(String type) { public Map<String, Integer> roadSummary(String type, String region) {
Map<String, Integer> result = new HashMap<>(); Map<String, Integer> result = new HashMap<>();
//获取基础信息 //获取基础信息
List<BasicEntity> basicList = list(); List<BasicEntity> basicList = list(new LambdaQueryWrapper<>(BasicEntity.class).eq(BasicEntity::getRegion, region));
Map<String, String> basicMap = new HashMap<>(); Map<String, String> basicMap = new HashMap<>();
for (BasicEntity basicEntity : basicList) { for (BasicEntity basicEntity : basicList) {
basicMap.put(basicEntity.getRelId(), basicEntity.getRoadName()); basicMap.put(basicEntity.getRelId(), basicEntity.getRoadName());
......
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