package com.qmth.jkserver.dao;

//import java.util.List;
//
//import org.springframework.data.mongodb.repository.MongoRepository;
//import org.springframework.stereotype.Repository;
//
//import com.qmth.jkserver.model.ExamStudent;
//
//@Repository
//public interface ExamStudentDao extends MongoRepository<ExamStudent, String>{
//
//	public ExamStudent findById(String id);
//
//	public void deleteByExamCode(String examCode);
//
//	public List<ExamStudent> findByExamCodeAndTicketNo(String examCode,String ticketNo);
//
//	public List<ExamStudent> findByExamCodeAndTicketNoAndCourseCode(String examCode,String ticketNo, String courseCode);
//
//}

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qmth.jkserver.model.ExamStudent;
import org.apache.ibatis.annotations.Param;

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

/**
 * <p>
 * 考务考生表 Mapper 接口
 * </p>
 *
 * @author wangliang
 * @since 2023-03-01
 */
public interface ExamStudentDao extends BaseMapper<ExamStudent> {

    public ExamStudent findById(@Param("id") Long id);

    public void deleteByExamCode(@Param("examCode") String examCode);

    public List<ExamStudent> findByExamCode(@Param("examCode") String examCode);

    public List<ExamStudent> findByExamCodeAndTicketNo(@Param("examCode") String examCode, @Param("ticketNo") String ticketNo);

    public List<ExamStudent> findByExamCodeAndTicketNoAndCourseCode(@Param("examCode") String examCode, @Param("ticketNo") String ticketNo, @Param("courseCode") String courseCode);

    @SuppressWarnings("MybatisXMapperMethodInspection")
    public IPage<Map> findByExamCodeByMap(IPage<Map> iPage, @Param("examCode") String examCode);

    @SuppressWarnings("MybatisXMapperMethodInspection")
    public List<Map> findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndPlaceName(@Param("examCode") String examCode,
                                                                                 @Param("batchId") String batchId,
                                                                                 @Param("placeCodeSet") Set<String> placeCodeSet,
                                                                                 @Param("roomCode") String roomCode,
                                                                                 @Param("placeName") String placeName);

    @SuppressWarnings("MybatisXMapperMethodInspection")
    public IPage<Map> findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndPlaceNameByIpage(IPage<Map> iPage,
                                                                                         @Param("examCode") String examCode,
                                                                                         @Param("batchId") String batchId,
                                                                                         @Param("placeCodeSet") Set<String> placeCodeSet,
                                                                                         @Param("roomCode") String roomCode,
                                                                                         @Param("placeName") String placeName);

    public IPage<ExamStudent> findByIpage(IPage<Map> iPage,
                                          @Param("schoolId") Long schoolId,
                                          @Param("examCode") String examCode,
                                          @Param("batchId") String batchId,
                                          @Param("stageId") String stageId,
                                          @Param("placeCode") String placeCode,
                                          @Param("roomCode") String roomCode,
                                          @Param("courseCode") String courseCode,
                                          @Param("registrationStatus") Boolean registrationStatus,
                                          @Param("examFinishStatus") String examFinishStatus,
                                          @Param("pattern") String pattern);

    public Long findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeAndPlaceNameCount(@Param("examCode") String examCode,
                                                                                @Param("batchId") String batchId,
                                                                                @Param("placeCodeSet") Set<String> placeCodeSet,
                                                                                @Param("roomCode") String roomCode,
                                                                                @Param("placeName") String placeName);
}