package top.tqx.demo_1.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import top.tqx.demo_1.entity.File;

import java.util.List;

@Mapper
public interface FileMapper extends BaseMapper<File> {

    List<File> selectByPermission(@Param("condition") String condition, IPage<File> page);

    List<File> selectByDeptId(@Param("deptId") Long deptId);

    List<File> selectByUploadUserId(@Param("uploadUserId") Long uploadUserId);

    @Select("SELECT * FROM file WHERE file_name = #{fileName} LIMIT 1")
    File findByFileName(@Param("fileName") String fileName);
}
