package com.keyware.shandan.system.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.keyware.shandan.common.mapper.IBaseMapper;
import com.keyware.shandan.system.entity.SysFile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.cursor.Cursor;
import org.apache.ibatis.mapping.ResultSetType;

import java.util.List;

/**
 * <p>
 * 系统文件表 Mapper 接口
 * </p>
 *
 * @author GuoXin
 * @since 2021-06-07
 */
@Mapper
public interface SysFileMapper extends IBaseMapper<SysFile> {

    List<SysFile> listByDirId(String dirId);

    @Select("SELECT * FROM SYS_FILE ${ew.customSqlSegment}")
    @Options(resultSetType = ResultSetType.FORWARD_ONLY, fetchSize = 2)
    Cursor<SysFile> streamList(@Param(Constants.WRAPPER) Wrapper<SysFile> wrapper);
}
