From c630d51c6619759f3639f23b6192865f8b3894d8 Mon Sep 17 00:00:00 2001 From: nixj Date: Fri, 12 Jul 2024 12:50:57 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90update=E3=80=91=E6=B6=88=E8=B4=B9?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E5=A7=93=E5=90=8D=E6=9F=A5=E8=AF=A2=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BASF=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/entity/query/ConsumptionDetailQuery.java | 1 + .../impl/JdbcConsumptionDetailRepositoryImpl.java | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/chint/manage/entity/query/ConsumptionDetailQuery.java b/src/main/java/com/chint/manage/entity/query/ConsumptionDetailQuery.java index b497c374..0f921087 100644 --- a/src/main/java/com/chint/manage/entity/query/ConsumptionDetailQuery.java +++ b/src/main/java/com/chint/manage/entity/query/ConsumptionDetailQuery.java @@ -19,6 +19,7 @@ public class ConsumptionDetailQuery extends BaseQuery{ */ private Integer productType; private String userName=""; + private String userCode=""; private String actualOrderNo=""; //申请单号 // private List orderIds=new ArrayList<>(); private List orderNos=new ArrayList<>(); 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 0ca0a472..0b473bbb 100644 --- a/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java +++ b/src/main/java/com/chint/manage/mapper/impl/JdbcConsumptionDetailRepositoryImpl.java @@ -183,14 +183,13 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai } private static String getString(ConsumptionDetailQuery dto, String query, Map params, PageRequest pageRequest) { - if (!dto.getUserName().isEmpty() && LEG_TYPE_HOTEL != dto.getProductType()) { - dto.setUserName(dto.getUserName() + "%"); - query += "AND tod.user_name LIKE (:userName)"; - } - if (!dto.getUserName().isEmpty() && dto.getProductType().equals(LEG_TYPE_HOTEL)) { + if (!dto.getUserName().isEmpty()) { dto.setUserName(dto.getUserName() + "%"); query += "AND tod.booking_name LIKE (:userName)"; } + if (!dto.getUserCode().isEmpty()) { + query += "AND tod.booking_user_code = (:userCode)"; + } if (!dto.getCompanyCodes().isEmpty()) { query += "AND roef.company_code IN (:companyCodes)"; @@ -200,6 +199,7 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai query += "AND tod.order_no IN (:orderNos)"; } + params.put("userCode", dto.getUserCode()); params.put("userName", dto.getUserName()); params.put("orderNos", dto.getOrderNos()); params.put("companyCodes", dto.getCompanyCodes());