根据条件查询车辆信息接口
This commit is contained in:
@ -31,7 +31,7 @@ public class CarController {
|
|||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "根据查询条件查询车辆")
|
@ApiOperation(value = "根据查询条件查询车辆")
|
||||||
@GetMapping("/getCarByCarCondition")
|
@PostMapping("/getCarByCarCondition")
|
||||||
public Result<CarDTO> getCarByCarCondition(@RequestBody CarQueryConditionReq req){
|
public Result<CarDTO> getCarByCarCondition(@RequestBody CarQueryConditionReq req){
|
||||||
return Result.ok(carService.getCarByCondition(req));
|
return Result.ok(carService.getCarByCondition(req));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,7 +29,9 @@ public class CarServiceImpl implements CarService {
|
|||||||
LambdaQueryWrapper<CarPO> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<CarPO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(StringUtils.isNotBlank(req.getLicensePlate()),CarPO::getLicensePlate, req.getLicensePlate())
|
queryWrapper.eq(StringUtils.isNotBlank(req.getLicensePlate()),CarPO::getLicensePlate, req.getLicensePlate())
|
||||||
.eq(StringUtils.isNotBlank(req.getVin()),CarPO::getVin, req.getVin())
|
.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);
|
CarPO carPO = carRepo.getOne(queryWrapper);
|
||||||
return CarConvert.INSTANCE.poToDto(carPO);
|
return CarConvert.INSTANCE.poToDto(carPO);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user