package cn.com.qmth.stmms.ms.core.domain;

import cn.com.qmth.stmms.ms.core.vo.Subject;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 考题
 * Created by zhengmin on 2016/9/21.
 */
@Entity
public class ExamQuestion implements Serializable {

    private static final long serialVersionUID = 966670964450775040L;

    @Id
    @GeneratedValue
    private Long id;

    @NotNull
    private String areaCode;

    @NotNull
    private String name;

    @NotNull
    @Enumerated(value = EnumType.STRING)
    private Subject subject;

    @NotNull
    private Long workId;

    private String areaName;

    @Basic
    @Column(name = "is_test")
    private int test; //是否试评，1:数据已导入，2:试评中

    public int getTest() {
        return test;
    }

    public void setTest(int test) {
        this.test = test;
    }

    public ExamQuestion(String areaCode, Subject subject, Long workId, String areaName) {
        this.areaCode = areaCode;
        this.name = subject.getName() + this.areaCode;
        this.subject = subject;
        this.workId = workId;
        this.areaName = areaName;
    }

    public ExamQuestion(String areaCode, Subject subject, String subjectName, Long workId, String areaName) {
        this.areaCode = areaCode;
        this.name = subjectName + this.areaCode;
        this.subject = subject;
        this.workId = workId;
        this.areaName = areaName;
    }

    public ExamQuestion() {
    }

    public Long getId() {
        return id;
    }

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

    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }

    public String getName() {
        return name;
    }

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

    public Subject getSubject() {
        return subject;
    }

    public void setSubject(Subject subject) {
        this.subject = subject;
    }

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Long getWorkId() {
        return workId;
    }

    public void setWorkId(Long workId) {
        this.workId = workId;
    }
}
