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

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
import com.qmth.teachcloud.report.business.bean.dto.query.BasicExamRecordDto;
import com.qmth.teachcloud.report.business.entity.TBExamRecord;
import com.qmth.teachcloud.report.business.mapper.TBExamRecordMapper;
import com.qmth.teachcloud.report.business.service.TBExamRecordService;
import org.springframework.stereotype.Service;

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

/**
 * <p>
 * 考生考试记录 服务实现类
 * </p>
 *
 * @author wangliang
 * @since 2021-06-01
 */
@Service
public class TBExamRecordServiceImpl extends ServiceImpl<TBExamRecordMapper, TBExamRecord> implements TBExamRecordService {
    @Resource
    private TBExamRecordMapper tbExamRecordMapper;

    @Override
    public List<BasicExamRecordDto> findByExamIdAndCourseCodeS(Long examId, List<String> courseCodeS) {
        if (courseCodeS.size() == 0){
            throw ExceptionResultEnum.ERROR.exception("缺少课程编号");
        }
        return tbExamRecordMapper.findByExamIdAndCourseCodeS(examId,courseCodeS);
    }
}
