package vip.xiaonuo.exam.mapper;

import vip.xiaonuo.exam.domain.ExamPaper;
import vip.xiaonuo.exam.domain.other.KeyValue;
import vip.xiaonuo.exam.viewmodel.admin.exam.ExamPaperPageRequestVM;
import vip.xiaonuo.exam.viewmodel.student.dashboard.PaperFilter;
import vip.xiaonuo.exam.viewmodel.student.dashboard.PaperInfo;
import vip.xiaonuo.exam.viewmodel.student.exam.ExamPaperPageVM;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface ExamPaperMapper extends BaseMapper<ExamPaper> {

    List<ExamPaper> page(ExamPaperPageRequestVM requestVM);

    List<ExamPaper> taskExamPage(ExamPaperPageRequestVM requestVM);

    List<ExamPaper> studentPage(ExamPaperPageVM requestVM);

    List<PaperInfo> indexPaper(PaperFilter paperFilter);

    Integer selectAllCount();

    List<KeyValue> selectCountByDate(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    int updateTaskPaper(@Param("taskId") Integer taskId,@Param("paperIds") List<Integer> paperIds);

    int clearTaskPaper(@Param("paperIds") List<Integer> paperIds);
}
