package io.renren.modules.sys.dao.algs;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import io.renren.modules.sys.entity.algs.Algorithm;
import io.renren.modules.sys.entity.algs.FileTest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FileTestMapper extends BaseMapper<FileTest> {
    int deleteByPrimaryKey(Long fileid);

    int insert(FileTest record);

    int insertSelective(FileTest record);

    FileTest selectByPrimaryKey(Long fileid);

    int updateByPrimaryKeySelective(FileTest record);

    int updateByPrimaryKey(FileTest record);

    @Select("SELECT a.* FROM file_test a ${ew.customSqlSegment}")
    List<FileTest> getFileInfo(@Param(Constants.WRAPPER) Wrapper wrapper);

    @Select("SELECT a.*, b.username FROM algorithm a sys_user b WHERE a.uid = b.user_id and a.uid = #{id,jdbcType=BIGINT}")
    List<FileTest> getAlgorithmInfoById(@Param("id") Long id);
}