package com.qmth.distributed.print.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qmth.distributed.print.business.bean.dto.FinalScoreDto;
import com.qmth.distributed.print.business.bean.result.FinalScoreResult;
import com.qmth.distributed.print.business.entity.TCFinalScore;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 期末考试成绩表 Mapper 接口
 * </p>
 *
 * @author wangliang
 * @since 2024-02-18
 */
public interface TCFinalScoreMapper extends BaseMapper<TCFinalScore> {

    /**
     * 期末成绩列表（分页）
     *
     * @param iPage
     * @param examId
     * @param courseCode
     * @param paperNumber
     * @param teachCourseId
     * @return
     */
    public IPage<TCFinalScore> finalScoreList(IPage<Map> iPage, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("teachCourseId") Long teachCourseId);

    /**
     * 查找期末成绩分数图
     *
     * @param examId
     * @param courseCode
     * @param paperNumber
     * @param teachCourseId
     * @return
     */
    public FinalScoreDto finalScoreScoreOverView(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("teachCourseId") Long teachCourseId);

    /**
     * 查找期末成绩分数区间
     *
     * @param examId
     * @param courseCode
     * @param paperNumber
     * @param teachCourseId
     * @param start
     * @param end
     * @return
     */
    public int getCountByScoreRange(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("teachCourseId") Long teachCourseId, @Param("start") Double start, @Param("end") Double end);

    /**
     * 查找考生成绩
     *
     * @param examId
     * @param courseCode
     * @param paperNumber
     * @param teachCourseId
     * @return
     */
    public List<FinalScoreResult> examStudentOverview(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("teachCourseId") Long teachCourseId);
}
