|
@@ -361,8 +361,11 @@ public class OrgController extends ControllerSupport {
|
|
Specification<OrgEntity> specification = (root, query, cb) -> {
|
|
Specification<OrgEntity> specification = (root, query, cb) -> {
|
|
List<Predicate> predicates = new ArrayList<>();
|
|
List<Predicate> predicates = new ArrayList<>();
|
|
predicates.add(cb.equal(root.get("rootId"), getRootOrgId()));
|
|
predicates.add(cb.equal(root.get("rootId"), getRootOrgId()));
|
|
|
|
+ predicates.add(cb.isNotNull(root.get("parentId")));
|
|
if (StringUtils.isNotBlank(name)) {
|
|
if (StringUtils.isNotBlank(name)) {
|
|
- predicates.add(cb.like(root.get("name"), toSqlSearchPattern(name)));
|
|
|
|
|
|
+ Predicate pr1 = cb.like(root.get("name"), toSqlSearchPattern(name));
|
|
|
|
+ Predicate pr2 = cb.like(root.get("code"), toSqlSearchPattern(name));
|
|
|
|
+ predicates.add(cb.or(pr1, pr2));
|
|
}
|
|
}
|
|
if (null != enable) {
|
|
if (null != enable) {
|
|
predicates.add(cb.equal(root.get("enable"), enable));
|
|
predicates.add(cb.equal(root.get("enable"), enable));
|