mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-24 19:59:31 +08:00
优化用户列表过滤
This commit is contained in:
@@ -6,6 +6,10 @@ import xyz.playedu.api.service.internal.UserDepartmentService;
|
||||
import xyz.playedu.api.mapper.UserDepartmentMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【user_department】的数据库操作Service实现
|
||||
@@ -14,6 +18,18 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class UserDepartmentServiceImpl extends ServiceImpl<UserDepartmentMapper, UserDepartment>
|
||||
implements UserDepartmentService {
|
||||
|
||||
@Override
|
||||
public List<Integer> getUserIdsByDepIds(Integer[] depIds) {
|
||||
List<Integer> ids = new ArrayList<>();
|
||||
List<UserDepartment> userDepartments = list(query().getWrapper().in("dep_id", Arrays.asList(depIds)));
|
||||
if (userDepartments.size() > 0) {
|
||||
for (UserDepartment userDepartment : userDepartments) {
|
||||
ids.add(userDepartment.getUserId());
|
||||
}
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user