package com.xhkjedu.sstudy.service.paper;

import com.xhkjedu.sstudy.mapper.paper.PaperScantronQtypeMapper;
import com.xhkjedu.sstudy.model.paper.TPaperScantronQtype;
import com.xhkjedu.sstudy.vo.paper.PaperScantronQtypeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName PaperScantronQtypeService
 * Description 作业答题卡题型
 * Author WN
 * Date 2020/6/8 18:27
 **/
@Service
public class PaperScantronQtypeService {
    @Autowired
    private PaperScantronQtypeMapper paperScantronQtypeMapper;

    /**
     *功能描述  添加答题卡题型
     * @author WN
     * @date 2020/6/8
     * @param  * @param sqtype
     * @return java.lang.Integer
     */
    public Integer add(TPaperScantronQtype sqtype){
        paperScantronQtypeMapper.insertUseGeneratedKeys(sqtype);
        return sqtype.getId();
    }

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

    /**
     *功能描述 获取答题卡题型及答题卡
     * @author WN
     * @date 2020/6/11
     * @param  * @param paperid
     * @return java.util.List<com.xhkjedu.vo.paper.PaperScantronQtypeVo>
     */
    public List<PaperScantronQtypeVo> listQtypeScans(Integer paperid){
        return paperScantronQtypeMapper.listQtypeScans(paperid);
    }
}
