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

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qmth.teachcloud.report.business.bean.result.ExamRecordResult;
import com.qmth.teachcloud.report.business.bean.result.SurveyTeacherDistributionResult;
import com.qmth.teachcloud.report.business.bean.result.TeachCourseResult;
import com.qmth.teachcloud.report.business.entity.TAExamCourseRecord;
import com.qmth.teachcloud.report.business.mapper.TAExamCourseRecordMapper;
import com.qmth.teachcloud.report.business.service.TAExamCourseRecordService;
import org.springframework.stereotype.Service;

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

/**
 * <p>
 * 参考课程考生成绩维度表 服务实现类
 * </p>
 *
 * @author wangliang
 * @since 2021-06-01
 */
@Service
public class TAExamCourseRecordServiceImpl extends ServiceImpl<TAExamCourseRecordMapper, TAExamCourseRecord> implements TAExamCourseRecordService {

    @Resource
    TAExamCourseRecordMapper taExamCourseRecordMapper;

    /**
     * 查询考生信息
     *
     * @param examId
     * @param courseCode
     * @return
     */
    @Override
    public List<ExamRecordResult> findExamRecordByExamIdAndCourseCode(Long examId, String courseCode) {
        return taExamCourseRecordMapper.findExamRecordByExamIdAndCourseCode(examId, courseCode);
    }

    /**
     * 开课学院分数段
     *
     * @param examId
     * @param courseCode
     * @param filter
     * @param inspectCollegeId
     * @return
     */
    @Override
    public List<SurveyTeacherDistributionResult> surveyTeacherDistribution(Long examId, String courseCode, boolean filter, Long inspectCollegeId) {
        return taExamCourseRecordMapper.surveyTeacherDistribution(examId, courseCode, filter, inspectCollegeId);
    }

    /**
     * 我的课堂考试分析-考试概况，查找我的课堂数据
     *
     * @param schoolId
     * @param semesterId
     * @param examId
     * @param courseCode
     * @param inspectCollegeId
     * @param teacherId
     * @return
     */
    @Override
    public List<TeachCourseResult> findTeacherInspect(Long schoolId, Long semesterId, Long examId, String courseCode, Long inspectCollegeId, Long teacherId) {
        return taExamCourseRecordMapper.findTeacherInspect(schoolId, semesterId, examId, courseCode, inspectCollegeId, teacherId);
    }
}
