package com.qmth.themis.business.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qmth.themis.business.bean.admin.ExamReexamListBean;
import com.qmth.themis.business.bean.admin.ReexamListDoneBean;
import com.qmth.themis.business.bean.admin.ReexamListNotDoneBean;
import com.qmth.themis.business.bean.admin.ReexamListRequestBean;
import com.qmth.themis.business.entity.TEExamReexam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Map;

/**
 * @Description: 考生重考处理 Mapper 接口
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2020/6/25
 */
@Mapper
public interface TEExamReexamMapper extends BaseMapper<TEExamReexam> {

    /**
     * 重考申请列表
     *
     * @param iPage
     * @param examId
     * @param examActivityId
     * @param roomCode
     * @param courseCode
     * @param name
     * @param identity
     * @param userId
     * @param orgId
     * @return
     */
    public IPage<ReexamListRequestBean> reexamPageRequestList(IPage<Map> iPage, @Param("examId") Long examId,
                                                              @Param("examActivityId") Long examActivityId,
                                                              @Param("roomCode") String roomCode,
                                                              @Param("courseCode") String courseCode,
                                                              @Param("name") String name,
                                                              @Param("identity") String identity,
                                                              @Param("userId") Long userId,
                                                              @Param("orgId") Long orgId);

    /**
     * 重考待审列表
     *
     * @param iPage
     * @param examId
     * @param examActivityId
     * @param roomCode
     * @param courseCode
     * @param name
     * @param identity
     * @param reason
     * @param reasonStartTime
     * @param reasonEndTime
     * @param applyName
     * @param userId
     * @param orgId
     * @return
     */
    public IPage<ReexamListNotDoneBean> reexamPageNotDoneList(IPage<Map> iPage, @Param("examId") Long examId,
                                                              @Param("examActivityId") Long examActivityId,
                                                              @Param("roomCode") String roomCode,
                                                              @Param("courseCode") String courseCode,
                                                              @Param("name") String name,
                                                              @Param("identity") String identity,
                                                              @Param("reason") String reason,
                                                              @Param("reasonStartTime") Long reasonStartTime,
                                                              @Param("reasonEndTime") Long reasonEndTime,
                                                              @Param("applyName") String applyName,
                                                              @Param("userId") Long userId,
                                                              @Param("orgId") Long orgId);

    /**
     * 重考待审提醒
     *
     * @param examId
     * @param userId
     * @param orgId
     * @return
     */
    public Integer reexamPageNotDoneCount(@Param("examId") Long examId, @Param("userId") Long userId, @Param("orgId") Long orgId);

    /**
     * 重考已审列表
     *
     * @param iPage
     * @param examId
     * @param examActivityId
     * @param roomCode
     * @param courseCode
     * @param name
     * @param identity
     * @param auditingStatus
     * @param reasonStartTime
     * @param reasonEndTime
     * @param applyName
     * @param userId
     * @param orgId
     * @return
     */
    public IPage<ReexamListDoneBean> reexamPageDoneList(IPage<Map> iPage, @Param("examId") Long examId,
                                                        @Param("examActivityId") Long examActivityId,
                                                        @Param("roomCode") String roomCode,
                                                        @Param("courseCode") String courseCode,
                                                        @Param("name") String name,
                                                        @Param("identity") String identity,
                                                        @Param("auditingStatus") Integer auditingStatus,
                                                        @Param("reasonStartTime") Long reasonStartTime,
                                                        @Param("reasonEndTime") Long reasonEndTime,
                                                        @Param("applyName") String applyName,
                                                        @Param("userId") Long userId,
                                                        @Param("orgId") Long orgId);

    public IPage<ExamReexamListBean> getExamReexamPage(IPage<ExamReexamListBean> iPage,@Param("orgId") Long orgId, @Param("examId") Long examId,
                                                       @Param("activityId") Long activityId, @Param("roomCode") String roomCode,
                                                       @Param("courseCode") String courseCode, @Param("name") String name, @Param("identity") String identity);
}
