package com.qmth.exam.reserve.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qmth.exam.reserve.bean.apply.ApplyVO;
import com.qmth.exam.reserve.bean.apply.TicketInfo;
import com.qmth.exam.reserve.bean.stdapply.StudentApplyReq;
import com.qmth.exam.reserve.bean.stdapply.StudentApplyVO;
import com.qmth.exam.reserve.entity.StudentApplyEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StudentApplyDao extends BaseMapper<StudentApplyEntity> {

    IPage<StudentApplyVO> page(Page<StudentApplyVO> page, @Param(value = "req") StudentApplyReq req);

    Integer getHaveApplyCount(@Param(value = "examSiteIds") List<Long> examSiteIds,
                              @Param(value = "cancel") Boolean cancel);

    List<ApplyVO> getStudentApplyList(@Param("studentId") Long studentId, @Param("cancel") Boolean cancel);

    Integer countApplyFinishForExamSiteAndTimePeriod(@Param("examSiteId") Long examSiteId, @Param("timePeriodId") Long timePeriodId);

    TicketInfo getStudentApplyTicket(
            @Param("studentId") Long studentId,
            @Param("examSiteId") Long examSiteId,
            @Param("timePeriodId") Long timePeriodId
    );

    List<StudentApplyEntity> listTimePeriod(@Param(value = "timePeriodIds") List<Long> timePeriodIds,
                                            @Param(value = "cancel") Boolean cancel);

    List<StudentApplyVO> listStudentApply(@Param("timePeriodId") Long timePeriodId, @Param("roomId") Long roomId);

}
