|
@@ -95,8 +95,10 @@ public class UserService {
|
|
|
// Predicate predicate = cb.notEqual(subRootEntity.get("roleCode"), RoleMeta.MARKER.name());
|
|
|
// subquery.select(subRootEntity).where(predicate);
|
|
|
// predicates.add(cb.exists(subquery));
|
|
|
- predicates.add(cb.equal(root.get("type"),userCriteria.getType()));
|
|
|
+ predicates.add(cb.equal(root.get("type"),UserType.NOT_STUDENT));
|
|
|
predicates.add(cb.equal(root.get("rootOrgId"),userCriteria.getRootOrgId()));
|
|
|
+ Join join = root.join("userRoles");
|
|
|
+ predicates.add(cb.notEqual(join.get("roleCode"), "MARKER"));
|
|
|
if(StringUtils.isNotEmpty(userCriteria.getLoginName())){
|
|
|
predicates.add(cb.like(root.get("loginName"),"%"+userCriteria.getLoginName()+"%"));
|
|
|
}
|
|
@@ -343,25 +345,24 @@ public class UserService {
|
|
|
* @param pageable
|
|
|
* @return
|
|
|
*/
|
|
|
- public Page<User> getALLMaker(Long rootOrgId,Pageable pageable){
|
|
|
- //Specification<User> specification = getSpecification(user);
|
|
|
- return userRepo.findMarkerByRootOrgId(rootOrgId,pageable);
|
|
|
+ public Page<User> getAllMaker(User user,Pageable pageable){
|
|
|
+ Specification<User> specification = getSpecification(user);
|
|
|
+ return userRepo.findAll(specification,pageable);
|
|
|
}
|
|
|
|
|
|
public Specification<User> getSpecification(User user){
|
|
|
Specification<User> specification = (root, query, cb) -> {
|
|
|
List<Predicate> predicates = new ArrayList<>();
|
|
|
- predicates.add(cb.equal(root.get("type"),user.getType()));
|
|
|
+ predicates.add(cb.equal(root.get("type"),UserType.NOT_STUDENT));
|
|
|
predicates.add(cb.equal(root.get("rootOrgId"),user.getRootOrgId()));
|
|
|
+ Join join = root.join("userRoles");
|
|
|
+ predicates.add(cb.equal(join.get("roleCode"), "MARKER"));
|
|
|
if(StringUtils.isNotEmpty(user.getLoginName())){
|
|
|
predicates.add(cb.like(root.get("loginName"),"%"+user.getLoginName()+"%"));
|
|
|
}
|
|
|
if(StringUtils.isNotEmpty(user.getName())){
|
|
|
predicates.add(cb.like(root.get("name"),"%"+user.getName()+"%"));
|
|
|
}
|
|
|
- if(user.getOrgId() != null){
|
|
|
- predicates.add(cb.equal(root.get("orgId"),user.getOrgId()));
|
|
|
- }
|
|
|
if(user.getEnable() != null){
|
|
|
predicates.add(cb.equal(root.get("enable"),user.getEnable()));
|
|
|
}
|