diff --git a/src/main/java/com/chint/manage/entity/query/ItineraryPageQuery.java b/src/main/java/com/chint/manage/entity/query/ItineraryPageQuery.java index 4d743c9d..a2b4e568 100644 --- a/src/main/java/com/chint/manage/entity/query/ItineraryPageQuery.java +++ b/src/main/java/com/chint/manage/entity/query/ItineraryPageQuery.java @@ -13,7 +13,7 @@ public class ItineraryPageQuery extends BaseQuery { private String applicant="";// 申请人 private String actualOrderNo=""; //申请单号 private List userIds=new ArrayList<>(); - private List routeIds; + private List routeIds=new ArrayList<>(); public String getActualOrderNo() { diff --git a/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java b/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java index a9556787..60ba4768 100644 --- a/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java +++ b/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java @@ -46,8 +46,11 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai @Override public Page itineraryPageQueryByDto(ItineraryPageQuery dto) { String query = "SELECT * FROM route_order " - + "WHERE route_id IN (:routeIds) " - + "AND actual_order_no IS NOT NULL "; + + "WHERE actual_order_no IS NOT NULL "; + + if (!dto.getRouteIds().isEmpty()) { + query+="AND route_id IN (:routeIds) "; + } if (!dto.getUserIds().isEmpty()) { query+="AND user_id IN (:userIds) ";