package com.agileboot.system.role.mapper;

import com.agileboot.common.mybatis.mapper.BaseMapperDelete;
import com.agileboot.system.role.entity.SysRole;
import org.apache.ibatis.annotations.Select;

public interface SysRoleMapper extends BaseMapperDelete<SysRole> {

    /**
     * 判断菜单是否被角色分配
     */
    @Select("SELECT COUNT(1) != 0 FROM sys_role_menu WHERE menu_id = #{menuId}")
    boolean isMenuAssignToRoles(Long menuId);
}
