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

import java.util.List;

import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
import cn.com.qmth.stmms.biz.exam.query.ExamStudentSearchQuery;

public interface ExamStudentService {

    public ExamStudent findById(int id);

    public int batchSave(List<ExamStudent> list);

    public ExamStudent save(ExamStudent student);

    public void deleteById(int id);

    public void delete(ExamStudent student);

    public void deleteByExamId(int examId);

    public ExamStudentSearchQuery findByQuery(ExamStudentSearchQuery query);

    public long countByQuery(final ExamStudentSearchQuery query);

    List<ExamStudent> findByExamId(int examId);

    List<ExamStudent> findByExamIdAndUpload(int examId, boolean upload, int pageNumber, int pageSize);

    List<ExamStudent> findByExamIdAndUploadAndAbsent(int examId, boolean upload, boolean absent, int pageNumber,
            int pageSize);

    ExamStudent findByExamIdAndExamNumber(int examId, String examNumber);

    public long countByExamId(int examId);

    public long countByExamIdAndSubjectCode(int examId, String subjectCode);

    public long countByExamIdAndSubjectCode(int examId, String subjectCode, boolean upload);

    List<String> findDistinctCampusName(int examId);

    ExamStudentSearchQuery findDistinctCampusName(ExamStudentSearchQuery query);

    List<ExamStudent> findByExamIdAndCampusName(int examId, String campusCode, int pageNumber, int pageSize);

    List<String> findDistinctPackageCode(int examId);

    long countByExamIdAndCampusName(int examId, String campusName);

    long countByExamIdAndCampusName(int examId, String campusName, boolean upload);

    long countByExamIdAndSubjectCode(int examId, String subjectCode, boolean upload, boolean absent);

    public long countByNoAbsentAndBreach(int examId, String subjectCode, boolean upload, boolean absent,
            boolean breach);

    public long countByAbsentAndBreach(int examId, String subjectCode, Boolean absent, Boolean breach);

    long countCampusByExam(int examId);

    long countByExamIdAndUpload(int examId, boolean upload);

    void updateSubjectiveScore(int id, double score, String scoreList);

    void updateManualAbsent(int id, boolean manualAbsent);

    void updateManualAbsent(int examId, String examNumber, boolean manualAbsent);

    void clearManualAbsent(int examId);

    void updateException(int id, boolean exception);

    public ExamStudent findBySchoolIdAndSubjectCodeAndStudentCode(Integer schoolId, String subjectCode,
            String studentCode);

    public ExamStudent findBySchoolIdAndSubjectCodeAndStudentCodeAndRemark(Integer schoolId, String subjectCode,
            String studentCode, String examSeqCode);

    ExamStudent findByExamIdAndSchoolIdAndSubjectCodeAndStudentCode(Integer examId, Integer schoolId,
            String subjectCode, String studentCode);

    ExamStudent findByExamIdAndSubjectCodeAndStudentCode(Integer examId, String subjectCode, String studentCode);

    public List<Object[]> statisticsByExamIdAndSubjectCode(Integer examId, String code, Boolean upload, boolean absent);

    public List<Object[]> statisticsByExamIdAndSubjectCode(Integer examId, String code);

    public Long countByExamIdAndSubjectCodeAndCampus(Integer examId, String code, String campusName, boolean upload,
            boolean absent);

    public ExamStudent findBySchoolIdAndSubjectCodeStartingWithAndStudentCode(Integer schoolId, String subjectCode,
            String studentCode);

    public String findIdsByMarkLogin(String markLogin);

    public String findIdsByMarkName(String markName);

    List<ExamStudent> findByExamId(int examId, int pageNumber, int pageSize);

    List<Object[]> statisticsByAbsentAndBreach(Integer examId, String code, Boolean upload, boolean absent,
            boolean breach);

}
