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.*;
import com.qmth.distributed.print.business.bean.result.PrintPlanBrief;
import com.qmth.distributed.print.business.bean.result.PrintPlanResult;
import com.qmth.distributed.print.business.entity.ExamPrintPlan;
import com.qmth.distributed.print.business.enums.PrintPlanStatusEnum;
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 ExamPrintPlanMapper extends BaseMapper<ExamPrintPlan> {
    IPage<PrintPlanResult> findPrintPlanPage(@Param("iPage") Page<PrintPlanResult> iPage,
                                             @Param("schoolId") Long schoolId,
                                             @Param("semesterId") Long semesterId,
                                             @Param("examId") Long examId,
                                             @Param("printPlanIdList") List<Long> printPlanIdList,
                                             @Param("status") PrintPlanStatusEnum status,
                                             @Param("startTime") Long startTime,
                                             @Param("endTime") Long endTime,
                                             @Param("orgIds") Set<Long> orgIds);

    IPage<PrintPlanResult> findPrintPlanSyncPage(@Param("iPage") Page<PrintPlanResult> iPage,
                                                 @Param("schoolId") Long schoolId,
                                                 @Param("semesterId") Long semesterId,
                                                 @Param("examId") Long examId,
                                                 @Param("status") String[] status,
                                                 @Param("printPlanId") Long printPlanId,
                                                 @Param("startTime") Long startTime,
                                                 @Param("endTime") Long endTime,
                                                 @Param("orgIds") Set<Long> orgIds);

    List<PrintPlanBrief> list(@Param("schoolId") Long schoolId, @Param("source") String source, @Param("module") String module, @Param("status") String[] status, @Param("orgIds") Set<Long> orgIds);

    IPage<ClientPrintTaskDto> listClientPrintTask(Page<ClientPrintTaskDto> page, @Param("schoolId") Long schoolId, @Param("machineCode") String machineCode, @Param("printPlanId") String printPlanId, @Param("status") String status, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("examPlace") String examPlace, @Param("examRoom") String examRoom, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime, @Param("isDownload") Boolean isDownload, @Param("validate") Boolean validate, @Param("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);

    List<ClientPrintTaskDto> listClientPrintTask(@Param("schoolId") Long schoolId, @Param("machineCode") String machineCode, @Param("printPlanId") String printPlanId, @Param("status") String status, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("examPlace") String examPlace, @Param("examRoom") String examRoom, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime, @Param("isDownload") Boolean isDownload, @Param("validate") Boolean validate, @Param("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);

    ClientPrintTaskTotalDto clientTaskTotalData(@Param("schoolId") Long schoolId, @Param("printPlanId") String printPlanId, @Param("status") String status, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("examPlace") String examPlace, @Param("examRoom") String examRoom, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime, @Param("isDownload") Boolean isDownload, @Param("validate") Boolean validate, @Param("machineCode") String machineCode, @Param("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);

    IPage<ClientPrintStatisticsDto> listClientPrintStatistics(Page<ClientPrintStatisticsDto> page, @Param("schoolId") Long schoolId, @Param("printPlanId") String printPlanId, @Param("examPlace") String examPlace, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);

    ClientPrintStatisticsTotalDto clientStatisticsTotalData(@Param("schoolId") Long schoolId, @Param("printPlanId") String printPlanId, @Param("examPlace") String examPlace, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);

    List<ThirdObjectDto> listThirdObject(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId);

    List<PrintPlanBrief> listToClient(@Param("schoolId") Long schoolId, @Param("source") String source, @Param("module") String module, @Param("status") String[] status, @Param("orgId") Long orgId);
}
