package cn.xluobo.business.sys.admin.repo.mapper;

import cn.xluobo.business.sys.admin.domain.req.ReqSearchSysUser;
import cn.xluobo.core.page.RespPage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 用户表 Mapper 接口
 * </p>
 *
 * @author zhangby
 * @since 2020-01-12
 */
public interface ISysUserMapper extends BaseMapper<SysUser> {

    List<SysUser> selectUserList(@Param("reqSearchSysUser") ReqSearchSysUser reqSearchSysUser, @Param("page") RespPage page);

    /**
     * 用户角色count
     *
     * @param userId
     * @param roleCode
     * @return
     */
    int selectSuperTenantUserRoleCount(@Param("userId") Long userId, @Param("roleCode") String roleCode);

    /**
     * 用户角色count
     * @param userId
     * @param tenantId
     * @param roleCodes
     * @return
     */
    int selectUserHasAnyRoleCount(@Param("userId") String userId, @Param("tenantId") String tenantId, @Param("roleCodes") String[] roleCodes);
}
