package com.qmth.jkserver.dao;

//import org.springframework.data.mongodb.repository.MongoRepository;
//import org.springframework.stereotype.Repository;
//
//import com.qmth.jkserver.model.ExamStudentAnswer;
//
//import java.util.List;
//
//@Repository
//public interface ExamStudentAnswerDao extends MongoRepository<ExamStudentAnswer, String>{
//
//	public void deleteById(String id);
//
//	public List<ExamStudentAnswer> findByExamCode(String examCode);
//
//	public List<ExamStudentAnswer> findByExamCodeAndIsAbort(String examCode,boolean isAbort);
//
//	public List<ExamStudentAnswer> findByExamCodeAndIsAbsent(String examCode,boolean isAbsent);
//
//	public List<ExamStudentAnswer> findByExamCodeAndIsCheat(String examCode,boolean isCheat);
//}

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qmth.jkserver.model.ExamStudentAnswer;
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 ExamStudentAnswerDao extends BaseMapper<ExamStudentAnswer> {

    public void deleteById(@Param("id") Long id);

    public List<ExamStudentAnswer> findByExamCode(@Param("examCode") String examCode, @Param("courseCode") String courseCode);

    public List<ExamStudentAnswer> findByExamCodeAndIsAbort(@Param("examCode") String examCode, @Param("isAbort") Boolean isAbort);

    public List<ExamStudentAnswer> findByExamCodeAndIsAbsent(@Param("examCode") String examCode, @Param("isAbsent") Boolean isAbsent);

    public List<ExamStudentAnswer> findByExamCodeAndIsCheat(@Param("examCode") String examCode, @Param("isCheat") Boolean isCheat);

    public Long findByExamCodeAndPlaceCodeAndRoomCodeCount(@Param("examCode") String examCode, @Param("placeCode") String placeCode, @Param("roomCode") String roomCode);

    public Long findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortAndPlaceNameCount(@Param("examCode") String examCode,
                                                                                                                    @Param("stageId") String stageId,
                                                                                                                    @Param("batchId") String batchId,
                                                                                                                    @Param("placeCodeSet") Set<String> placeCodeSet,
                                                                                                                    @Param("roomCode") String roomCode,
                                                                                                                    @Param("absent") Boolean absent,
                                                                                                                    @Param("cheat") Boolean cheat,
                                                                                                                    @Param("abort") Boolean abort,
                                                                                                                    @Param("placeName") String placeName);

    public IPage<Map> findByExamCodeAndStageIdAndBatchIdAndPlaceCodeAndRoomCodeAndAbsentAndCheatAndAbortAndPlaceNameByIpage(IPage<Map> iPage,
                                                                                                                            @Param("examCode") String examCode,
                                                                                                                            @Param("stageId") String stageId,
                                                                                                                            @Param("batchId") String batchId,
                                                                                                                            @Param("placeCodeSet") Set<String> placeCodeSet,
                                                                                                                            @Param("roomCode") String roomCode,
                                                                                                                            @Param("absent") Boolean absent,
                                                                                                                            @Param("cheat") Boolean cheat,
                                                                                                                            @Param("abort") Boolean abort,
                                                                                                                            @Param("placeName") String placeName);

    public List<ExamStudentAnswer> findByExamCodeByTicketNo(@Param("examCode") String examCode);

    public IPage<ExamStudentAnswer> findByExamCodeByPage(IPage<Map> iPage, @Param("examCode") String examCode);

    public IPage<ExamStudentAnswer> findByExamCodeByPaperNamePage(IPage<Map> iPage, @Param("examCode") String examCode);

    public List<ExamStudentAnswer> findByExamCodeByCourseCode(@Param("examCode") String examCode, @Param("courseCode") String courseCode);

    public List<ExamStudentAnswer> findByExamCodeByPlaceCodeAndRoomCode(@Param("examCode") String examCode,
                                                                        @Param("placeCode") String placeCode,
                                                                        @Param("roomCode") String roomCode);

    public List<ExamStudentAnswer> findByExamCodeByTicketNoDel(@Param("examCode") String examCode,
                                                               @Param("ticketNo") String ticketNo);

    public List<ExamStudentAnswer> findByExamCodeByTicketNoAndCourseCode(@Param("examCode") String examCode,
                                                                         @Param("ticketNo") String ticketNo,
                                                                         @Param("courseCode") String courseCode);
}
