package com.ga.core.mapper.user;

import com.ga.core.vo.user.RoleVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RoleMapper {
    List<RoleVO> selectAll();
    RoleVO selectById(@Param("roleId") Long roleId);
    int insert(RoleVO vo);
    int update(RoleVO vo);
    int deleteById(@Param("roleId") Long roleId);

    /** 역할의 (menu_id, perm_code) 권한 목록 */
    List<java.util.Map<String, Object>> selectRolePermissions(@Param("roleId") Long roleId);
    int deleteRolePermissions(@Param("roleId") Long roleId);
    int insertRolePermission(@Param("roleId") Long roleId,
                             @Param("menuId") Long menuId,
                             @Param("permCode") String permCode,
                             @Param("isGranted") String isGranted);
}
