package top.tqx.demo_1.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import top.tqx.demo_1.entity.FilePermission;

import java.util.List;

@Mapper
public interface FilePermissionMapper extends BaseMapper<FilePermission> {

    FilePermission selectByUserAndFile(@Param("userId") Long userId, @Param("fileId") Long fileId);

    FilePermission selectByDeptAndFile(@Param("deptId") Long deptId, @Param("fileId") Long fileId);

    List<FilePermission> selectByUserId(@Param("userId") Long userId);

    List<FilePermission> selectByFileId(@Param("fileId") Long fileId);

    List<FilePermission> selectByUserIdAndFileId(@Param("userId") Long userId, @Param("fileId") Long fileId);

    int deleteByFileId(@Param("fileId") Long fileId);

    int deleteByUserId(@Param("userId") Long userId);
}
