From 37630ab65cf1eba16c8936cb2b1e310c7e6862af Mon Sep 17 00:00:00 2001 From: nixj Date: Wed, 26 Jun 2024 10:38:35 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90update=E3=80=91=E8=A1=8C=E7=A8=8B?= =?UTF-8?q?=E5=8D=95=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/chint/manage/entity/query/ItineraryPageQuery.java | 2 +- .../mapper/impl/JdbcConsumptionDetailRepositoryImpl.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) 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) ";