【fix】预订人查询问题修复

This commit is contained in:
nixj 2024-06-19 08:54:22 +08:00
parent 832144c773
commit 4a55a9fd31
3 changed files with 15 additions and 4 deletions

View File

@ -42,7 +42,7 @@ public interface JdbcOrderDetailRepository extends CrudRepository<OrderDetail, L
"AND (:#{#dto.startTime} IS NULL OR :#{#dto.endTime} IS NULL OR order_date BETWEEN :#{#dto.startTime} AND :#{#dto.endTime}) " + "AND (:#{#dto.startTime} IS NULL OR :#{#dto.endTime} IS NULL OR order_date BETWEEN :#{#dto.startTime} AND :#{#dto.endTime}) " +
"AND (:#{#dto.productType} ='' OR product_type = :#{#dto.productType}) " + "AND (:#{#dto.productType} ='' OR product_type = :#{#dto.productType}) " +
"AND (:#{#dto.employeeNo} ='' OR employee_no = :#{#dto.employeeNo}) " + "AND (:#{#dto.employeeNo} ='' OR employee_no = :#{#dto.employeeNo}) " +
"AND (:#{#dto.employeeNos} IS NULL OR employee_no IN (:#{#dto.employeeNos})) " + "AND (:#{#dto.employeeNosEmpty} = TRUE OR employee_no IN (:#{#dto.employeeNos}))" +
"LIMIT :#{#pageRequest.pageSize} OFFSET :#{#pageRequest.pageNumber}") "LIMIT :#{#pageRequest.pageSize} OFFSET :#{#pageRequest.pageNumber}")
List<OrderDetail> listByCondition(@Param("dto") OrderPageQuery dto, @Param("pageRequest")PageRequest pageRequest); List<OrderDetail> listByCondition(@Param("dto") OrderPageQuery dto, @Param("pageRequest")PageRequest pageRequest);
@ -52,6 +52,6 @@ public interface JdbcOrderDetailRepository extends CrudRepository<OrderDetail, L
"AND (:#{#dto.startTime} IS NULL OR :#{#dto.endTime} IS NULL OR order_date BETWEEN :#{#dto.startTime} AND :#{#dto.endTime} ) " + "AND (:#{#dto.startTime} IS NULL OR :#{#dto.endTime} IS NULL OR order_date BETWEEN :#{#dto.startTime} AND :#{#dto.endTime} ) " +
"AND (:#{#dto.productType} ='' OR product_type = :#{#dto.productType}) "+ "AND (:#{#dto.productType} ='' OR product_type = :#{#dto.productType}) "+
"AND (:#{#dto.employeeNo} ='' OR employee_no = :#{#dto.employeeNo}) " + "AND (:#{#dto.employeeNo} ='' OR employee_no = :#{#dto.employeeNo}) " +
"AND (:#{#dto.employeeNos} IS NULL OR employee_no IN (:#{#dto.employeeNos})) ") "AND (:#{#dto.employeeNosEmpty} = TRUE OR employee_no IN (:#{#dto.employeeNos}))")
Integer countByCondition(@Param("dto") OrderPageQuery dto); Integer countByCondition(@Param("dto") OrderPageQuery dto);
} }

View File

@ -29,4 +29,15 @@ public class OrderPageQuery extends BaseQuery {
private List<String> employeeNos=null; private List<String> employeeNos=null;
private List<Long> routeIds=null; private List<Long> routeIds=null;
private boolean employeeNosEmpty;
public boolean getEmployeeNosEmpty() {
if(employeeNos==null||employeeNos.isEmpty()){
return true;
}else {
return false;
}
}
} }

View File

@ -177,7 +177,7 @@ public class ManageServiceImpl implements ManageService {
} }
dto.setRouteIds(dataRouteIds); dto.setRouteIds(dataRouteIds);
//预订人 todo 预订人查询还有点问题 //预订人
if (!dto.getApplicant().equals("")){ if (!dto.getApplicant().equals("")){
List<User> users=jdbcUserRepository.findAllByNameContains(dto.getApplicant()); List<User> users=jdbcUserRepository.findAllByNameContains(dto.getApplicant());
if (users==null||users.isEmpty()) { if (users==null||users.isEmpty()) {