package com.qmth.teachcloud.report.business.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qmth.teachcloud.report.business.bean.dto.AnswerDetailBean;
import com.qmth.teachcloud.report.business.bean.dto.query.BasicAnswerDto;
import com.qmth.teachcloud.report.business.bean.dto.query.ValidAnswerDetailDto;
import com.qmth.teachcloud.report.business.bean.result.TBAnswerResult;
import com.qmth.teachcloud.report.business.entity.TBAnswer;
import com.qmth.teachcloud.report.business.mapper.TBAnswerMapper;
import com.qmth.teachcloud.report.business.service.TBAnswerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.LinkedList;
import java.util.List;

/**
 * <p>
 * 基础考生作答记录详情表 服务实现类
 * </p>
 *
 * @author wangliang
 * @since 2021-06-01
 */
@Service
public class TBAnswerServiceImpl extends ServiceImpl<TBAnswerMapper, TBAnswer> implements TBAnswerService {

    @Resource
    private TBAnswerMapper tbAnswerMapper;

    @Override
    public List<BasicAnswerDto> findByPaperId(Long paperId) {
        return tbAnswerMapper.findByPaperId(paperId);
    }

    @Override
    public List<ValidAnswerDetailDto> findValid(Long examId, String courseCode) {
        return tbAnswerMapper.findValid(examId, courseCode);
    }

    /**
     * 查找有效答案
     *
     * @param examId
     * @param courseCode
     * @return
     */
    @Override
    public List<TBAnswerResult> findValidAnswerDetail(Long examId, String courseCode) {
        return tbAnswerMapper.findValidAnswerDetail(examId, courseCode);
    }

    @Override
    public LinkedList<AnswerDetailBean> findValidAnswerDetailWithPap(Long examId, String courseCode) {
        return tbAnswerMapper.findValidAnswerDetailWithPap(examId, courseCode);
    }
}
