package shop.alien.gateway.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import shop.alien.entity.store.StorePlatformRoleMenu;

/**
 * 角色菜单关联表 Mapper 接口（Gateway）
 *
 * @author system
 * @since 2025-01-01
 */
@Mapper
public interface StorePlatformRoleMenuGatewayMapper extends BaseMapper<StorePlatformRoleMenu> {
    
    /**
     * 根据角色ID查询菜单权限数量
     *
     * @param roleId 角色ID
     * @return 菜单权限数量
     */
    @Select("SELECT COUNT(*) FROM store_platform_role_menu WHERE role_id = #{roleId}")
    Integer countMenuByRoleId(@Param("roleId") Long roleId);
}
