package com.qmth.distributed.print.business.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.distributed.print.business.bean.dto.BasicPrintConfigDto;
import com.qmth.teachcloud.common.entity.BasicPrintConfig;

import java.util.List;

/**
 * <p>
 * 印品配置 服务类
 * </p>
 *
 * @author xf
 * @since 2021-03-23
 */
public interface BasicPrintConfigService extends IService<BasicPrintConfig> {
    IPage<BasicPrintConfigDto> listPage(Long examId, Boolean enable, Long createStartTime, Long createEndTime, Integer pageNumber, Integer pageSize);

    boolean enable(Long id, Boolean enable);

    boolean savePrintConfig(BasicPrintConfig basicPrintConfig);

    /**
     * 根据考试ID和课程代码获取印品
     * @param examId 考试ID
     * @param courseCode 课程代码
     * @return BasicPrintConfig
     */
    BasicPrintConfig getByExamIdAndCourseCode(Long examId, String courseCode);

    /**
     * 根据课程代码和试卷编号获取印品
     * @param courseCode 课程代码
     * @param paperNumber 试卷编号
     * @return BasicPrintConfig
     */
    BasicPrintConfig getByCourseCodeAndPaperNumber(String courseCode, String paperNumber);

    /**
     * 根据examId和orgId查询印品
     *
     * @param examId 考试ID
     * @param orgId 机构ID
     * @return BasicPrintConfig
     */
    BasicPrintConfig getByExamIdAndOrgId(Long examId, Long orgId);

    /**
     * 查询考试下设置印品的机构集合
     * @param id
     * @param examId 考试ID
     */
    List<String> listOrgIdsByExamId(Long id, Long examId);

    /**
     * 删除
     * @param id 印品配置ID
     */
    boolean delete(Long id);
}
