com.didiglobal.logi.security.dao.impl.UserRoleDaoImpl Maven / Gradle / Ivy
The newest version!
package com.didiglobal.logi.security.dao.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.didiglobal.logi.security.common.entity.UserRole;
import com.didiglobal.logi.security.common.po.UserRolePO;
import com.didiglobal.logi.security.dao.UserRoleDao;
import com.didiglobal.logi.security.dao.mapper.UserRoleMapper;
import com.didiglobal.logi.security.util.CopyBeanUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author cjm
*/
@Component
public class UserRoleDaoImpl extends BaseDaoImpl implements UserRoleDao {
@Autowired
private UserRoleMapper userRoleMapper;
@Override
public List selectUserIdListByRoleId(Integer roleId) {
if(roleId == null) {
return new ArrayList<>();
}
QueryWrapper queryWrapper = getQueryWrapper();
queryWrapper.select(FieldConstant.USER_ID).eq(FieldConstant.ROLE_ID, roleId);
List