Commit dbd42313 by 丁伟峰

动态条件查询修订

1 parent 35878afd
......@@ -21,5 +21,12 @@ public interface EngineerInfoDao extends JpaRepository<EngineerInfoEntity, Integ
List<EngineerInfoEntity> findByEngineerCodeIn(List<String> engineerCodes);
Page<EngineerInfoEntity> findAllByEngineerCodeIn(List<String> engineerCodes, Specification<EngineerInfoEntity> engineerInfoEntitySpecification, Pageable pageable);
default Page<EngineerInfoEntity> findAllByEngineerCodeIn(List<String> engineerCodes, Specification<EngineerInfoEntity> engineerInfoEntitySpecification, Pageable pageable) {
Specification<EngineerInfoEntity> spec = Specification.where(engineerCodeIn(engineerCodes)).and(engineerInfoEntitySpecification);
return findAll(spec, pageable);
}
static Specification<EngineerInfoEntity> engineerCodeIn(List<String> engineerCodes) {
return (root, query, criteriaBuilder) -> root.get("engineerCode").in(engineerCodes);
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!