package com.qmth.qrzk.paper.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.qmth.qrzk.repository.common.enumeration.PaperStatus;

/**
 * 试卷Model
 * @author zhengmin
 *
 */
@Entity
@Table(name="qr_paper")
public class Paper {
	
	@Id
	@GeneratedValue
	private Long id;
	
	private String code;
	
	@Column(name="course_code")
	private String courseCode;
	
	@Column(name="course_name")
	private String courseName;
	
	@Column(name="book_name")
	private String bookName;
	
	@Column(name="book_author")
	private String bookAuthor;
	
	@Column(name="book_press")
	private String bookPress;
	
	@Column(name="book_press_year")
	private String bookPressYear;
	
	private String school;
	
	private String status;
	
	@Transient
	private String statusLabel;
	
	@Column(name="paper_path")
	private String paperPath;
	
	@Column(name="separate_paper_path")
	private String separatePaperPath;
	
	@Column(name="w_paper_path")
	private String wpPaperPath;
	
	@Column(name="standard_answer_path")
	private String standardAnswerPath;
	
	@Column(name="answer_sheet_path")
	private String answerSheetPath;
	
	@Column(name="zy_path")
	private String zyPath;
	
	@Column(name="attachments_path")
	private String attachmentsPath;
	
	@Column(name="pictures_path")
	private String picturesPath;
	
	@Column(name="is_special_answer_sheet")
	private Boolean isSpecialAnswerSheet; 
	
	private String remark;
	
	private String reserved;

	public Long getId() {
		return id;
	}

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

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getCourseCode() {
		return courseCode;
	}

	public void setCourseCode(String courseCode) {
		this.courseCode = courseCode;
	}

	public String getCourseName() {
		return courseName;
	}

	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}

	public String getBookName() {
		return bookName;
	}

	public void setBookName(String bookName) {
		this.bookName = bookName;
	}

	public String getBookAuthor() {
		return bookAuthor;
	}

	public void setBookAuthor(String bookAuthor) {
		this.bookAuthor = bookAuthor;
	}

	public String getBookPress() {
		return bookPress;
	}

	public void setBookPress(String bookPress) {
		this.bookPress = bookPress;
	}

	public String getBookPressYear() {
		return bookPressYear;
	}

	public void setBookPressYear(String bookPressYear) {
		this.bookPressYear = bookPressYear;
	}

	public String getSchool() {
		return school;
	}

	public void setSchool(String school) {
		this.school = school;
	}

	public String getStatus() {
		return status;
	}

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

	public String getStatusLabel() {
		String label = null;
		PaperStatus ps = PaperStatus.valueOf(this.status);
		if(ps != null){
			label = ps.getValue();
		}
		return label;
	}

	public void setStatusLabel(String statusLabel) {
		this.statusLabel = statusLabel;
	}

	public String getPaperPath() {
		return paperPath;
	}

	public void setPaperPath(String paperPath) {
		this.paperPath = paperPath;
	}

	public String getSeparatePaperPath() {
		return separatePaperPath;
	}

	public void setSeparatePaperPath(String separatePaperPath) {
		this.separatePaperPath = separatePaperPath;
	}

	public String getWpPaperPath() {
		return wpPaperPath;
	}

	public void setWpPaperPath(String wpPaperPath) {
		this.wpPaperPath = wpPaperPath;
	}

	public String getStandardAnswerPath() {
		return standardAnswerPath;
	}

	public void setStandardAnswerPath(String standardAnswerPath) {
		this.standardAnswerPath = standardAnswerPath;
	}

	public String getAnswerSheetPath() {
		return answerSheetPath;
	}

	public void setAnswerSheetPath(String answerSheetPath) {
		this.answerSheetPath = answerSheetPath;
	}

	public String getAttachmentsPath() {
		return attachmentsPath;
	}

	public void setAttachmentsPath(String attachmentsPath) {
		this.attachmentsPath = attachmentsPath;
	}

	public String getPicturesPath() {
		return picturesPath;
	}

	public void setPicturesPath(String picturesPath) {
		this.picturesPath = picturesPath;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getReserved() {
		return reserved;
	}

	public void setReserved(String reserved) {
		this.reserved = reserved;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Paper other = (Paper) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	public Boolean getIsSpecialAnswerSheet() {
		return isSpecialAnswerSheet;
	}

	public void setIsSpecialAnswerSheet(Boolean isSpecialAnswerSheet) {
		this.isSpecialAnswerSheet = isSpecialAnswerSheet;
	}

	public String getZyPath() {
		return zyPath;
	}

	public void setZyPath(String zyPath) {
		this.zyPath = zyPath;
	}
	
}
