package com.ruoyi.web.modules.account.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.web.modules.account.domain.PlatformAdminQuery;
import com.ruoyi.web.modules.account.domain.PlatformAdminRow;
import com.ruoyi.web.modules.account.vo.PlatformAdminRoleOptionVO;

/**
 * 平台管理员 Mapper
 */
public interface PlatformAdminMapper
{
    List<PlatformAdminRow> selectList(PlatformAdminQuery query);

    PlatformAdminRow selectByUserId(@Param("userId") Long userId, @Param("listRoleKeys") List<String> listRoleKeys);

    int existsInListScope(@Param("userId") Long userId, @Param("listRoleKeys") List<String> listRoleKeys);

    List<PlatformAdminRoleOptionVO> selectRoleOptions(@Param("assignableRoleKeys") List<String> assignableRoleKeys);

    List<PlatformAdminRoleOptionVO> selectPlatformRolesByUserId(@Param("userId") Long userId,
            @Param("listRoleKeys") List<String> listRoleKeys);

    List<PlatformAdminRoleOptionVO> selectAllRolesByUserId(@Param("userId") Long userId);

    int countUsersWithRoleKey(@Param("roleKey") String roleKey);

    int countUsersWithRoleKeyAmong(@Param("roleKey") String roleKey, @Param("userIds") Long[] userIds);

    int userHasRoleKey(@Param("userId") Long userId, @Param("roleKey") String roleKey);
}
