fix(组织设置): Filter deleted organization members
This commit is contained in:
parent
b424da274b
commit
893656a506
|
@ -54,7 +54,7 @@
|
|||
from (
|
||||
select u.*, urr.role_id
|
||||
from user_role_relation urr
|
||||
join `user` u on urr.user_id = u.id
|
||||
join `user` u on urr.user_id = u.id and u.deleted = false
|
||||
<where>
|
||||
<if test="request.organizationId != null and request.organizationId != ''">
|
||||
urr.source_id = #{request.organizationId}
|
||||
|
|
|
@ -675,9 +675,11 @@ public class OrganizationService {
|
|||
List<UserRoleRelation> userRoleRelations = userRoleRelationMapper.selectByExample(userRoleRelationExample);
|
||||
List<String> userIds = userRoleRelations.stream().map(UserRoleRelation::getUserId).distinct().toList();
|
||||
UserExample userExample = new UserExample();
|
||||
UserExample.Criteria criteria = userExample.createCriteria();
|
||||
if (CollectionUtils.isNotEmpty(userIds)) {
|
||||
userExample.createCriteria().andIdNotIn(userIds);
|
||||
criteria.andIdNotIn(userIds);
|
||||
}
|
||||
criteria.andDeletedEqualTo(false);
|
||||
List<User> users = userMapper.selectByExample(userExample);
|
||||
List<IdNameStructureDTO> userList = new ArrayList<>();
|
||||
for (User user : users) {
|
||||
|
|
Loading…
Reference in New Issue