package com.qmth.teachcloud.mark.mapper;

import java.util.List;

import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qmth.teachcloud.mark.dto.ScanStudentDto;
import com.qmth.teachcloud.mark.entity.ScanOmrTask;
import com.qmth.teachcloud.mark.enums.OmrTaskStatus;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author xf
 * @since 2023-09-22
 */
public interface ScanOmrTaskMapper extends BaseMapper<ScanOmrTask> {

	List<ScanOmrTask> findUnMarked(@Param(value = "examId") Long examId, @Param(value = "pageNumber") int pageNumber,
			@Param(value = "pageSize") int pageSize, @Param(value = "status") OmrTaskStatus status);

	List<ScanStudentDto> listByExamIdAndStatusAndUserId(@Param(value = "examId") Long examId,
														@Param("courseCode") String courseCode,
														@Param("coursePaperId") String coursePaperId,
														@Param(value = "status") OmrTaskStatus status,
														@Param("markPaperStatus") String markPaperStatus, @Param("dpr") DataPermissionRule dpr);

	int getStudentCountByExamAndStatusAndUserId(@Param(value = "examId") Long examId,
												@Param("courseCode") String courseCode, @Param("coursePaperId") String coursePaperId, @Param(value = "status") String status, @Param("markPaperStatus") String markPaperStatus, @Param("dpr") DataPermissionRule dpr);

    int countOmrTask(@Param("scanOmrTask") ScanOmrTask scanOmrTask, @Param("dpr") DataPermissionRule dpr);
}
