Commit 7eb166c9 authored by unset's avatar unset

Merge branch 'dev-chw-vehicle' into dev-chw

parents 7837591c e458606c
......@@ -74,7 +74,7 @@ public class OrderViolationController extends BaseController<OrderViolationBiz,
* @return
*/
@GetMapping("/getOne/{detailId}")
public ObjectRestResponse<OrderViolation> getOne(@PathVariable Integer detailId) {
public ObjectRestResponse<List<OrderViolation>> getOne(@PathVariable Integer detailId) {
Example exa = Example.builder(OrderViolation.class)
.where(WeekendSqls.<OrderViolation>custom().andEqualTo(OrderViolation::getDetailId, detailId)
.andEqualTo(OrderViolation::getIsDel, 0)).build();
......@@ -82,9 +82,7 @@ public class OrderViolationController extends BaseController<OrderViolationBiz,
if (orderViolations.size() > 1) {
throw new BaseException("The database has multiple records");
}
OrderViolation orderViolation = new OrderViolation();
orderViolation = (orderViolations.size() == 0) ? null : orderViolations.get(0);
return ObjectRestResponse.succ(orderViolation);
return ObjectRestResponse.succ(orderViolations);
}
......
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