訂單展示時展示2中狀態訂單並按創建訂單的時間倒敘排序
用java8性特性解決很簡單
1 orderDTO.setStatus(BaseConstant.NEW_ORDER); 2 List<OrderDTO> orders=orderMapper.selectAll(orderDTO); 3 orderDTO.setStatus(BaseConstant.NOT_ACCEPT_STATUS); 4 List<OrderDTO> order=orderMapper.selectAll(orderDTO); 5 order.addAll(orders); 6 List<OrderDTO> collect = order.stream().sorted(Comparator.comparing(OrderDTO::getOrderTime).reversed()).collect(Collectors.toList());
