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

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.distributed.print.business.bean.dto.ExamDetailCourseDto;
import com.qmth.distributed.print.business.bean.dto.SyncExamTaskDto;
import com.qmth.distributed.print.business.entity.ExamDetailCourse;
import com.qmth.distributed.print.business.enums.ExamTaskSyncStatusEnum;
import com.qmth.distributed.print.business.enums.SyncCardTypeEnum;
import com.qmth.teachcloud.common.entity.BasicCourse;
import org.apache.ibatis.annotations.Param;

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

/**
 * <p>
 * 考务数据（考场关联科目） Mapper 接口
 * </p>
 *
 * @author xf
 * @since 2021-03-23
 */
public interface ExamDetailCourseMapper extends BaseMapper<ExamDetailCourse> {

    @SuppressWarnings("MybatisXMapperMethodInspection")
    List<Map<String, Object>> listByExamDetailId(@Param("examDetailId") Long examDetailId, @Param("status") String status);

    List<ExamDetailCourse> listByExamDetailIdAndStatus(@Param("examDetailId") Long examDetailId, @Param("status") String status);

    List<BasicCourse> listCoursesByPrintPlanId(@Param("param") String param, @Param("printPlanIdList") List<Long> printPlanIdList);

    List<String> listPaperNumberByPrintPlanId(@Param("param") String param, @Param("printPlanIdList") List<Long> printPlanIdList, @Param("orgIds") Set<Long> orgIds);

    List<ExamDetailCourse> listByPrintPlanIdAndCourseCodeAndPaperNumber(@Param("schoolId") Long schoolId, @Param("printPlanId") Long printPlanId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber);

    List<ExamDetailCourse> listByAndCourseCodeAndPaperNumber(@Param("schoolId") Long schoolId,@Param("examId") Long examId,@Param("courseCode") String courseCode,@Param("paperNumber") String paperNumber);

    List<ExamDetailCourseDto> listByPrintPlanIdAndExamTaskId(@Param("printPlanIds") List<Long> printPlanIds, @Param("examTaskId") Long examTaskId);

    IPage<SyncExamTaskDto> listSyncCourseByPrintPlanId(@Param("ipage") Page<SyncExamTaskDto> ipage, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("orgIds") Set<Long> orgIds, @Param("cardType") SyncCardTypeEnum cardType, @Param("syncStatus") ExamTaskSyncStatusEnum syncStatus, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("startTime") Long startTime, @Param("endTime") Long endTime);
}
