根据条件查询车辆信息接口

This commit is contained in:
2025-07-30 23:52:27 +08:00
parent 1c5d393c38
commit a9610be1ad
2 changed files with 4 additions and 2 deletions

View File

@ -31,7 +31,7 @@ public class CarController {
@ApiOperation(value = "根据查询条件查询车辆")
@GetMapping("/getCarByCarCondition")
@PostMapping("/getCarByCarCondition")
public Result<CarDTO> getCarByCarCondition(@RequestBody CarQueryConditionReq req){
return Result.ok(carService.getCarByCondition(req));
}

View File

@ -29,7 +29,9 @@ public class CarServiceImpl implements CarService {
LambdaQueryWrapper<CarPO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(StringUtils.isNotBlank(req.getLicensePlate()),CarPO::getLicensePlate, req.getLicensePlate())
.eq(StringUtils.isNotBlank(req.getVin()),CarPO::getVin, req.getVin())
.eq(Objects.nonNull(req.getCarId()),CarPO::getId, req.getCarId()).last(" limit 1");
.eq(Objects.nonNull(req.getCarId()),CarPO::getId, req.getCarId())
.eq(CarPO::getDelFlag, "0")
.last(" limit 1");
CarPO carPO = carRepo.getOne(queryWrapper);
return CarConvert.INSTANCE.poToDto(carPO);
}