//根据竞买人客户名称进行查询 In<Long> in = cb.in(root.get(BailPay_.customerId)); if(customerName != null && !customerName.isEmpty()){ List<Customer> customerList = customerRepository.findAllByCustomerName(customerName); if (customerList != null && customerList.size()>0) { for (Customer customer : customerList) { if (customer != null) { in.value(customer.id()); } } predicates.add(in); }else{ Predicate predicateCustomerId = cb.equal(root.get(BailPay_.customerId), 0L); predicates.add(predicateCustomerId); } }
Spring-data-jpa 之Specification in的用法
最新推荐文章于 2024-05-11 16:06:25 发布