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

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import cn.com.qmth.stmms.biz.mark.model.PictureConfigItem;
import cn.com.qmth.stmms.common.enums.ExamStatus;

@Entity
@Table(name = "eb_exam")
public class Exam implements Serializable {

    private static final long serialVersionUID = 5179623303410999209L;

    public static final String SUBJECT_ID_SPLIT = ",";

    @Id
    @GeneratedValue
    private Integer id;

    private String name;

    @Column(name = "school_id")
    private Integer schoolId;

    @Temporal(TemporalType.DATE)
    @Column(name = "exam_time")
    private Date examTime;

    @Enumerated(EnumType.STRING)
    @Column(name = "status", length = 16, nullable = false)
    private ExamStatus status;

    @Column(name = "description", length = 128, nullable = true)
    private String description;

    /**
     * 开启强制特殊标记
     */
    @Column(name = "force_special_tag", nullable = false)
    private boolean forceSpecialTag;

    /**
     * 裁切图配置
     */
    @Column(name = "slice_config", nullable = true)
    private String sliceConfig;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "create_time")
    private Date createTime;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "update_time")
    private Date updateTime;

    @Column(name = "creator_id")
    private Integer creatorId;

    /**
     * 是否需要统分
     */
    @Column(name = "need_calculate", nullable = false)
    private boolean needCalculate;

    /**
     * 及格分数
     */
    @Column(name = "pass_score")
    private Double passScore;

    /**
     * 优秀分数
     */
    @Column(name = "excellent_score")
    private Double excellentScore;

    /**
     * 统分进度
     */
    @Column(name = "process")
    private Double process;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getExamTime() {
        return examTime;
    }

    public void setExamTime(Date examTime) {
        this.examTime = examTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getCreatorId() {
        return creatorId;
    }

    public void setCreatorId(Integer creatorId) {
        this.creatorId = creatorId;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public ExamStatus getStatus() {
        return status;
    }

    public void setStatus(ExamStatus status) {
        this.status = status;
    }

    public Integer getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(Integer schoolId) {
        this.schoolId = schoolId;
    }

    public boolean isForceSpecialTag() {
        return forceSpecialTag;
    }

    public void setForceSpecialTag(boolean forceSpecialTag) {
        this.forceSpecialTag = forceSpecialTag;
    }

    public String getSliceConfig() {
        return sliceConfig;
    }

    public void setSliceConfig(String sliceConfig) {
        this.sliceConfig = sliceConfig;
    }

    public List<PictureConfigItem> getSliceConfigList() {
        return PictureConfigItem.parse(sliceConfig);
    }

    public boolean isNeedCalculate() {
        return needCalculate;
    }

    public void setNeedCalculate(boolean needCalculate) {
        this.needCalculate = needCalculate;
    }

    public Double getPassScore() {
        return passScore;
    }

    public void setPassScore(Double passScore) {
        this.passScore = passScore;
    }

    public Double getExcellentScore() {
        return excellentScore;
    }

    public void setExcellentScore(Double excellentScore) {
        this.excellentScore = excellentScore;
    }

    public Double getProcess() {
        return process;
    }

    public void setProcess(Double process) {
        this.process = process;
    }

}
