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

import java.util.List;

import cn.com.qmth.stmms.biz.exam.model.ExamSubject;
import cn.com.qmth.stmms.biz.exam.model.Marker;
import cn.com.qmth.stmms.biz.mark.model.MarkLibrary;
import cn.com.qmth.stmms.biz.mark.query.MarkLibrarySearchQuery;
import cn.com.qmth.stmms.common.enums.LibraryStatus;

public interface MarkLibraryService {

    MarkLibrary save(MarkLibrary library);

    MarkLibrary findById(int id);

    MarkLibrary findByStudentId(int studentId);

    long countByQuery(MarkLibrarySearchQuery query);

    MarkLibrarySearchQuery findByQuery(MarkLibrarySearchQuery query);

    List<MarkLibrary> findByStatus(int examId, String subjectCode, LibraryStatus status, int pageNumber, int pageSize);

    void resetBySubject(ExamSubject subject);

    void resetByMarker(Marker marker);

    void resetById(int id);

    void delete(MarkLibrary library);

    void deleteByStudent(int studentId);

    void deleteByExam(int examId);

    long countByExam(int examId);

    long countByExamAndStatus(int examId, LibraryStatus status);

    long countByExamAndSubject(int examId, String subjectCode);

    long countByExamAndSubjectAndStatus(int examId, String subjectCode, LibraryStatus status);

    List<Integer> findTagCampusId(int examId);

    List<String> findTagSubjectCode(int examId);

    List<Object[]> getMarkerInfo(Integer markerId, String subjectCode);

    List<Double> getAllScore(Integer id, String subjectCode);

    List<String> getCodeListByMidGBCodeCount(int markerId, LibraryStatus status);

    long countByMidAndStatus(int markerId, LibraryStatus status);

    List<Object[]> getMarkerInfo(int markerId, LibraryStatus status);

    MarkLibrarySearchQuery findGroupByQuery(final MarkLibrarySearchQuery query);

    long countByMidAndSubjectCodeStatus(int markerId, String subjectCode, LibraryStatus status);

    MarkLibrarySearchQuery getByCondition(final MarkLibrarySearchQuery query);
}
