增加统计门店车辆数接口
This commit is contained in:
@ -35,4 +35,11 @@ public class CarController {
|
||||
public Result<CarDTO> getCarByCarCondition(@RequestBody CarQueryConditionReq req){
|
||||
return Result.ok(carService.getCarByCondition(req));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "统计门店车辆数量")
|
||||
@GetMapping("/countCarByStoreId")
|
||||
public Result<Long> countCarByStoreId(@RequestParam(name = "storeId") Long storeId){
|
||||
return Result.ok(carService.countCarByStoreId(storeId));
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,4 +16,11 @@ public interface CarService {
|
||||
* @return
|
||||
*/
|
||||
CarDTO getCarByCondition(CarQueryConditionReq req);
|
||||
|
||||
/**
|
||||
* 根据门店查车辆数量
|
||||
* @param storeId
|
||||
* @return
|
||||
*/
|
||||
Long countCarByStoreId(Long storeId);
|
||||
}
|
||||
|
||||
@ -35,4 +35,9 @@ public class CarServiceImpl implements CarService {
|
||||
CarPO carPO = carRepo.getOne(queryWrapper);
|
||||
return CarConvert.INSTANCE.poToDto(carPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countCarByStoreId(Long storeId) {
|
||||
return carRepo.count(new LambdaQueryWrapper<CarPO>().eq(CarPO::getStoreId, storeId));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user