package com.yida.data.school.exam.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yida.data.common.core.entity.exam.CoreExaminationPublishRecord;
import com.yida.data.common.core.entity.exam.CoreExaminationStudent;
import com.yida.data.school.vo.exam.ScoreTrendVO;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface CoreExaminationPublishRecordMapper extends BaseMapper<CoreExaminationPublishRecord> {

    /**
     * 查询成绩趋势
     */
    List<ScoreTrendVO> findScoreTrend(@Param("startDate") LocalDate startDate,
                                      @Param("endDate") LocalDate endDate,
                                      @Param("studentId") Long studentId,
                                      @Param("courseId") Long courseId);

    /**
     * 查询成绩
     */
    IPage<CoreExaminationStudent> findStudentScore(Page page,
                                                   @Param("courseId") Long courseId,
                                                   @Param("examId") Long examId,
                                                   @Param("studentName") String studentName,
                                                   @Param("classId") List<Long> classId);
}