提交 45f86f23 编写于 作者: Z zhourui

改由通过unit进行判断

上级 d5e18800
...@@ -118,8 +118,8 @@ class ActionListLike extends BaseAction { ...@@ -118,8 +118,8 @@ class ActionListLike extends BaseAction {
CriteriaQuery<String> cq = cb.createQuery(String.class); CriteriaQuery<String> cq = cb.createQuery(String.class);
Root<Identity> root = cq.from(Identity.class); Root<Identity> root = cq.from(Identity.class);
Predicate p = cb.conjunction(); Predicate p = cb.conjunction();
p = cb.and(p, cb.or(cb.like(cb.lower(root.get(Identity_.name)), "%" + str + "%", StringTools.SQL_ESCAPE_CHAR), p = cb.and(p, cb.or(cb.like(cb.lower(root.get(Identity_.name)), str + "%", StringTools.SQL_ESCAPE_CHAR),
cb.like(cb.lower(root.get(Identity_.unique)), "%" + str + "%", StringTools.SQL_ESCAPE_CHAR), cb.like(cb.lower(root.get(Identity_.unique)), str + "%", StringTools.SQL_ESCAPE_CHAR),
cb.like(cb.lower(root.get(Identity_.pinyin)), str + "%", StringTools.SQL_ESCAPE_CHAR), cb.like(cb.lower(root.get(Identity_.pinyin)), str + "%", StringTools.SQL_ESCAPE_CHAR),
cb.like(cb.lower(root.get(Identity_.pinyinInitial)), str + "%", StringTools.SQL_ESCAPE_CHAR), cb.like(cb.lower(root.get(Identity_.pinyinInitial)), str + "%", StringTools.SQL_ESCAPE_CHAR),
cb.like(cb.lower(root.get(Identity_.distinguishedName)), str + "%", StringTools.SQL_ESCAPE_CHAR))); cb.like(cb.lower(root.get(Identity_.distinguishedName)), str + "%", StringTools.SQL_ESCAPE_CHAR)));
...@@ -134,8 +134,10 @@ class ActionListLike extends BaseAction { ...@@ -134,8 +134,10 @@ class ActionListLike extends BaseAction {
set.addAll(unitDutyIdentities); set.addAll(unitDutyIdentities);
} }
if (ListTools.isNotEmpty(wi.getUnitList())) { if (ListTools.isNotEmpty(wi.getUnitList())) {
List<String> identityIds = business.expendUnitToIdentity(wi.getUnitList()); List<String> units = business.expendUnitToUnit(wi.getUnitList());
set.addAll(identityIds); if (units.isEmpty()) {
p = cb.and(p, root.get(Identity_.unit).in(units));
}
} }
if (ListTools.isNotEmpty(wi.getGroupList())) { if (ListTools.isNotEmpty(wi.getGroupList())) {
List<String> identityIds = business.expendGroupToIdentity(wi.getGroupList()); List<String> identityIds = business.expendGroupToIdentity(wi.getGroupList());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册