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.CardCustDto;
import com.qmth.distributed.print.business.bean.dto.CardDetailDto;
import com.qmth.distributed.print.business.bean.dto.SyncExamCardDto;
import com.qmth.distributed.print.business.entity.ExamCard;
import org.apache.ibatis.annotations.Param;

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

/**
 * <p>
 * 题卡 Mapper 接口
 * </p>
 *
 * @author xf
 * @since 2021-03-23
 */
public interface ExamCardMapper extends BaseMapper<ExamCard> {

    IPage<CardCustDto> listCardCust(Page<CardCustDto> page, @Param("schoolId") String schoolId, @Param("status") String status, @Param("paperNumber") String paperNumber, @Param("userId") String userId, @Param("applyStartTime") Long applyStartTime, @Param("applyEndTime") Long applyEndTime, @Param("finishStartTime") Long finishStartTime, @Param("finishEndTime") Long finishEndTime);

    CardDetailDto getCardDetail(Long cardId);

    List<ExamCard> listGenericCard(@Param("schoolId") Long schoolId, @Param("orgIds") Set<Long> orgIds, @Param("type") String type, @Param("cardRuleId") Long cardRuleId);

    List<ExamCard> listCustom(@Param("schoolId") Long schoolId, @Param("orgId") Long orgId, @Param("courseCode") String courseCode, @Param("type") String type);

    CardDetailDto getCardDetailBySelect(Long cardId);

    List<SyncExamCardDto> listSyncCardByCourseCodeAndPaperNumber(@Param("schoolId") Long schoolId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber);

    IPage<ExamCard> listPage(@Param("page") Page<ExamCard> page, @Param("schoolId") Long schoolId, @Param("type") String type, @Param("title") String title, @Param("createMethod") String createMethod, @Param("enable") Boolean enable, @Param("createStartTime") Long createStartTime, @Param("createEndTime") Long createEndTime);
}
