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

import cn.com.qmth.stmms.biz.common.BaseQuery;
import cn.com.qmth.stmms.biz.mark.model.MarkLibrary;
import cn.com.qmth.stmms.common.enums.LibraryStatus;

import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;

import java.util.HashSet;
import java.util.Set;

public class MarkLibrarySearchQuery extends BaseQuery<MarkLibrary> {

    private int examId;

    private String subjectCode;

    private int campusId;

    private Integer studentId;

    private String examNumber;

    private String secretNumber;

    private Set<LibraryStatus> statusSet;

    private int markerId;

    private Integer groupNumber;

    private Double markerScore;

    private Double startScore;

    private Double endScore;

    private boolean unselective;

    private String questionScore;

    private Integer headerId;

    private String rejectReason;

    private String subjectCodeIn;

    public MarkLibrarySearchQuery() {
        super();
        this.statusSet = new HashSet<>();
    }

    public void orderByMarkerTimeDesc() {
        setSort(new Sort(Direction.DESC, "markerTime"));
    }

    public void orderByHeaderTimeDesc() {
        setSort(new Sort(Direction.DESC, "headerTime"));
    }

    public void orderByExamNumber() {
        setSort(new Sort(Direction.ASC, "examNumber"));
    }

    public int getExamId() {
        return examId;
    }

    public void setExamId(int examId) {
        this.examId = examId;
    }

    public String getSubjectCode() {
        return subjectCode;
    }

    public void setSubjectCode(String subjectCode) {
        this.subjectCode = subjectCode;
    }

    public Integer getStudentId() {
        return studentId;
    }

    public void setStudentId(Integer studentId) {
        this.studentId = studentId;
    }

    public String getExamNumber() {
        return examNumber;
    }

    public void setExamNumber(String examNumber) {
        this.examNumber = examNumber;
    }

    public String getSecretNumber() {
        return secretNumber;
    }

    public void setSecretNumber(String secretNumber) {
        this.secretNumber = secretNumber;
    }

    public int getMarkerId() {
        return markerId;
    }

    public void setMarkerId(int markerId) {
        this.markerId = markerId;
    }

    public int getCampusId() {
        return campusId;
    }

    public void setCampusId(int campusId) {
        this.campusId = campusId;
    }

    public Integer getGroupNumber() {
        return groupNumber;
    }

    public void setGroupNumber(Integer groupNumber) {
        this.groupNumber = groupNumber;
    }

    public Set<LibraryStatus> getStatusSet() {
        return statusSet;
    }

    public void clearStatus() {
        this.statusSet.clear();
    }

    public void addStatus(LibraryStatus status) {
        this.statusSet.add(status);
    }

    public Double getMarkerScore() {
        return markerScore;
    }

    public void setMarkerScore(Double markerScore) {
        this.markerScore = markerScore;
    }

    public boolean isUnselective() {
        return unselective;
    }

    public void setUnselective(boolean unselective) {
        this.unselective = unselective;
    }

    public String getQuestionScore() {
        return questionScore;
    }

    public void setQuestionScore(String questionScore) {
        this.questionScore = questionScore;
    }

    public Integer getHeaderId() {
        return headerId;
    }

    public void setHeaderId(Integer headerId) {
        this.headerId = headerId;
    }

    public Double getStartScore() {
        return startScore;
    }

    public void setStartScore(Double startScore) {
        this.startScore = startScore;
    }

    public Double getEndScore() {
        return endScore;
    }

    public void setEndScore(Double endScore) {
        this.endScore = endScore;
    }

    public String getRejectReason() {
        return rejectReason;
    }

    public void setRejectReason(String rejectReason) {
        this.rejectReason = rejectReason;
    }

    public String getSubjectCodeIn() {
        return subjectCodeIn;
    }

    public void setSubjectCodeIn(String subjectCodeIn) {
        this.subjectCodeIn = subjectCodeIn;
    }

}
