| | |
| | | Set<Predicate> set = new HashSet<>(); |
| | | |
| | | param.getCommunicationStyles().forEach((communicationStyle) -> { |
| | | set.add(criteriaBuilder.like(root.get("concept"), "%" + param.getCommunicationStyles() + "%")); |
| | | set.add(criteriaBuilder.like(root.get("communicationStyle"), "%" + communicationStyle + "%")); |
| | | }); |
| | | |
| | | if(Objects.nonNull(param.getGender())) { |
| | |
| | | } |
| | | |
| | | if(Objects.nonNull(param.getAvgScore()) && param.getAvgScore().intValue() != 0) { |
| | | set.add(criteriaBuilder.between(root.get("avgScore"), param.getAvgScore().intValue() - 1, param.getAvgScore().intValue() + 1)); |
| | | set.add(criteriaBuilder.equal(root.get("avgScore"), param.getAvgScore())); |
| | | } |
| | | |
| | | Predicate[] predicates = new Predicate[set.size()]; |
| | | predicates = set.toArray(predicates); |
| | | return criteriaBuilder.or(predicates); |
| | | return criteriaBuilder.and(predicates); |
| | | } |
| | | }; |
| | | } |
| | |
| | | } |
| | | |
| | | if(Objects.nonNull(param.getAvgScore()) && param.getAvgScore().intValue() != 0) { |
| | | set.add(criteriaBuilder.between(root.get("avgScore"), param.getAvgScore().intValue() - 1, param.getAvgScore().intValue() + 1)); |
| | | set.add(criteriaBuilder.equal(root.get("avgScore"), param.getAvgScore())); |
| | | } |
| | | |
| | | if(StringUtils.isNotEmpty(param.getArea())) { |