package com.qmth.jkserver.dao;

//import java.util.List;
//
//import org.springframework.data.mongodb.repository.MongoRepository;
//import org.springframework.data.repository.query.QueryByExampleExecutor;
//import org.springframework.stereotype.Repository;
//
//import com.qmth.jkserver.model.ExamPlan;
//
//@Repository
//public interface ExamPlanDao extends MongoRepository<ExamPlan, String>, QueryByExampleExecutor<ExamPlan> {
//
//	public ExamPlan findById(String id);
//
//	public ExamPlan deleteById(String id);
//
//	public List<ExamPlan> findByExamCode(String examCode);
//
//	public List<ExamPlan> findByName(String name);
//
//}

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qmth.jkserver.dto.result.ExamPlanAnaTaskResult;
import com.qmth.jkserver.model.ExamPlan;
import org.apache.ibatis.annotations.Param;

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

/**
 * <p>
 * 考试计划 Mapper 接口
 * </p>
 *
 * @author wangliang
 * @since 2023-03-01
 */
public interface ExamPlanDao extends BaseMapper<ExamPlan> {

    public ExamPlan findById(@Param("id") Long id);

    public ExamPlan deleteById(@Param("id") Long id);

    public List<ExamPlan> findByExamCode(@Param("examCode") String examCode);

    public List<ExamPlan> findByName(@Param("name") String name);

    public IPage<ExamPlanAnaTaskResult> findByExamCodeAndExamTask(IPage<Map> iPage,
                                                                  @Param("examCode") String examCode,
                                                                  @Param("status") String status,
                                                                  @Param("result") String result,
                                                                  @Param("examType") String examType,
                                                                  @Param("examStatus") String examStatus,
                                                                  @Param("enable") Boolean enable,
                                                                  @Param("schoolId") Long schoolId,
                                                                  @Param("creatorId") Long creatorId);

    public long findByExamCodeAndExamTaskCount(@Param("examCode") String examCode,
                                               @Param("status") String status,
                                               @Param("result") String result,
                                               @Param("examType") String examType,
                                               @Param("examStatus") String examStatus,
                                               @Param("enable") Boolean enable,
                                               @Param("schoolId") Long schoolId,
                                               @Param("creatorId") Long creatorId);

    public IPage<ExamPlan> findByNameByIpage(IPage<Map> iPage,
                                      @Param("name") String name,
                                      @Param("examType") String examType,
                                      @Param("examStatus") String examStatus,
                                      @Param("startTime") Long startTime,
                                      @Param("endTime") Long endTime,
                                      @Param("schoolId") Long schoolId);
}

