package com.CUST.brain.dao.mapper;

import com.CUST.brain.common.dto.system.PermissionTreeVO;
import com.CUST.brain.dao.domain.system.SysPermission;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 系统权限Mapper接口
 */
public interface SysPermissionMapper extends BaseMapper<SysPermission> {
    
    /**
     * 根据用户ID查询权限列表
     *
     * @param userId 用户ID
     * @return 权限列表
     */

    List<SysPermission> selectPermissionsByUserId(@Param("userId") String userId);

    List<PermissionTreeVO> selectPermissionsWithRoleStatus(@Param("roleId") String roleId, @Param("isSuperAdmin") boolean isSuperAdmin);

    List<SysPermission> selectPermissionsByRoleId(@Param("roleId") String roleId);

    void deleteRolePermissionsByRoleId(@Param("roleId") String roleId);

    void insertRolePermissionsBatch(@Param("list") List<com.CUST.brain.dao.domain.relation.SysRolePermission> list);

} 