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());