待研究知识点:
这种复杂的sql查询,左外连接,条件判断等
OrderController层
/**
*
* @param areaId
* @param startDate
* @param endDate
* @param sources
* @param keyword
* @param supplierIds
* @param statuses
* @param handleStatuses
* @param types
* @param scheduleDate
* @param scheduleBeginDate
* @param scheduleEndDate
* @param pageModel
* @return
*/
@GetMapping
public DataGridResult<OrderListVO> findPage(@RequestParam(required = false) Long areaId,
@RequestParam(required = false) Date startDate,
@RequestParam(required = false) Date endDate,
@RequestParam(required = false, value = "sources[]") Integer[] sources,
@RequestParam(required = false) String keyword,
@RequestParam(required = false, value = "supplierIds[]") Long[] supplierIds,
@RequestParam(required = false, value = "statuses[]") Integer[] statuses,
@RequestParam(required = false, value = "handleStatuses[]") Integer[] handleStatuses,
@RequestParam(required = false, value = "types[]") Integer[] types,
@RequestParam(required = false) Date scheduleDate,
@RequestParam(required = false) Date scheduleBeginDate,
@RequestParam(required = false) Date scheduleEndDate,
PageModel pageModel) {
Admin admin = getCurrentAdmin();
if (admin.getType() == 2) {
supplierIds = new Long[]{admin.getId()};
}
return new DataGridResult<>(orderService.findPageByCondition(areaId, startDate, endDate, sources, supplierIds, keyword, null, null, statuses, handleStatuses, types, scheduleDate, scheduleBeginDate, scheduleEndDate, null, new PageParam(pageModel.getPage(), pageModel.getRows()), null));
}
OrderService层:
/**
* 获取订单列表
*
* @param areaId 区域ID
* @param startDate