增加统计门店车辆数接口

This commit is contained in:
2025-07-31 23:43:10 +08:00
parent a9610be1ad
commit 446c4e920c
3 changed files with 19 additions and 0 deletions

View File

@ -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));
}
}

View File

@ -16,4 +16,11 @@ public interface CarService {
* @return
*/
CarDTO getCarByCondition(CarQueryConditionReq req);
/**
* 根据门店查车辆数量
* @param storeId
* @return
*/
Long countCarByStoreId(Long storeId);
}

View File

@ -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));
}
}