Commit e458606c authored by unset's avatar unset

新增违章查询接口

parent 4f9620d1
......@@ -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