package com.xhkjedu.sstudy.service.paper;

import com.xhkjedu.sstudy.mapper.paper.PaperFileMapper;
import com.xhkjedu.sstudy.model.paper.TPaperFile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName PaperFileService
 * Description 作业附件
 * Author WN
 * Date 2020/6/8 18:21
 **/
@Service
public class PaperFileService {
    @Autowired
    private PaperFileMapper paperFileMapper;

    /**
     *功能描述 批量保存
     * @author WN
     * @date 2020/6/8
     * @param  * @param lst
     * @return void
     */
    public void addBatch(List<TPaperFile> lst){
        paperFileMapper.insertList(lst);
    }

    /**
     *功能描述 删除附件--根据作业id
     * @author WN
     * @date 2020/6/11
     * @param  * @param paperid
     * @return void
     */
    public void deleteByPaperid(Integer paperid){
        paperFileMapper.deleteByPaperid(paperid);
    }

    /**
     *功能描述 根据作业id获取作业文件集合
     * @author WN
     * @date 2020/6/11
     * @param  * @param paperid
     * @return java.util.List<com.xhkjedu.model.paper.TPaperFile>
     */
    public List<TPaperFile> listObjsByPaperid(Integer paperid){
        return paperFileMapper.listObjsByPaperid(paperid);
    }
}
