| | |
| | | String propName = q.propName(); |
| | | String joinName = q.joinName(); |
| | | String blurry = q.blurry(); |
| | | // wcd加 |
| | | String isOr = q.isOr(); |
| | | // |
| | | String attributeName = isBlank(propName) ? field.getName() : propName; |
| | | Class<?> fieldType = field.getType(); |
| | | Object val = field.get(query); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | // wcd加 |
| | | if (ObjectUtil.isNotEmpty(isOr)) { |
| | | String[] isOrs = isOr.split(","); |
| | | List<Predicate> orP = new ArrayList<>(); |
| | | for (String s : isOrs) { |
| | | orP.add(cb.equal(root.get(s) |
| | | .as(String.class), val)); |
| | | } |
| | | Predicate[] orpr = new Predicate[orP.size()]; |
| | | list.add(cb.or(orP.toArray(orpr))); |
| | | continue; |
| | | } |
| | | // |
| | | |
| | | switch (q.type()) { |
| | | case EQUAL: |
| | | list.add(cb.equal(getExpression(attributeName,join,root) |