package cn.com.qmth.stmms.biz.distributpaper.service;

import java.util.List;

import cn.com.qmth.stmms.biz.distributpaper.model.FormallyLibrary;
import cn.com.qmth.stmms.biz.distributpaper.query.FormallyLibrarySearchQuery;
import cn.com.qmth.stmms.common.enums.LibraryStatus;

public interface FormallyLibraryService {

    FormallyLibrary save(FormallyLibrary formallyLibrary);

    FormallyLibrary findById(Integer id);

    void deleteById(Integer id);

    void delete(FormallyLibrary formallyLibrary);

    List<FormallyLibrary> findByExamIdAndBlockId(Integer examId, Integer blockId);

    public long countByExamIdAndBlockId(Integer examId, Integer blockId);

    List<FormallyLibrary> findByExamIdAndBlockIdAndStatus(Integer examId, Integer blockId, LibraryStatus status);

    public long countByExamIdAndBlockIdAndStatus(Integer examId, Integer blockId, LibraryStatus status);

    List<FormallyLibrary> findByBlockIdAndSecretNo(Integer blockId, Integer secretNo);

    /**
     * 查询打回试卷
     * 
     * @param examId
     * @param blockId
     * @param getter
     * @param status
     * @return
     */
    List<FormallyLibrary> findByExamIdAndBlockIdAndGetterAndStatus(int examId, int blockId, int getter,
            LibraryStatus status);

    public FormallyLibrarySearchQuery findByQuery(final FormallyLibrarySearchQuery query);

    List<FormallyLibrary> randomCheck(int examId, String subjectCode);

    List<FormallyLibrary> findByExamIdAndSubjectCodeAndBlockIdAndSecretNoAndStatus(int examId, String subjectCode, int blockId, int secretNo, LibraryStatus status);

}
