package com.qmth.qrzk.supplypaper.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
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.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

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

/**
 * 供卷课程。表示需要供卷的所有课程
 * @author zhengmin
 *
 */
@Entity
@Table(name="qr_supply_course")
public class SupplyCourse {

	@Id
	@GeneratedValue
	private Long id;
	@Column(name="course_code")
	private String courseCode;//课程代码
	@Column(name="course_name")
	private String courseName;//课程名称
	@Column(name="batch_id")
	private Integer batchId;//批次id
	@Column(name="batch_code")
	private String batchCode;//批次代码
	@Column(name="paper_id")
	private Long paperId;
	@Column(name="paper_code")
	private String paperCode;//试卷代码
	@Enumerated(EnumType.STRING)
	@Column(name="paper_status")
	private PaperStatus paperStatus;//试卷状态
	@Transient
	private String paperStatusLabel;//试卷状态标签
	@Column(name="merge_count")
	private int mergeCount;//合卷数量
	@Column(name="sep_count")
	private int sepCount;//分卷数量
	private int total;//总数
	@Column(name="exam_time")
	private String examTime;//考试时间
	
	@Column(name="created_by")
	private long createdBy;//创建人
	@Column(name="updated_time")
	private Date updatedTime;//最后更新时间
	
	private boolean printed; //是否打印
	
	//各省课程供卷信息
	@OneToMany(cascade=CascadeType.ALL)
	@JoinColumn(name="supply_course_id")
	private List<SupplyProvInfo> supplyProvInfo = new ArrayList<SupplyProvInfo>();

	public Long getId() {
		return id;
	}

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

	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 getBatchCode() {
		return batchCode;
	}

	public void setBatchCode(String batchCode) {
		this.batchCode = batchCode;
	}

	public Long getPaperId() {
		return paperId;
	}

	public void setPaperId(Long paperId) {
		this.paperId = paperId;
	}

	public String getPaperCode() {
		return paperCode;
	}

	public void setPaperCode(String paperCode) {
		this.paperCode = paperCode;
	}

	public PaperStatus getPaperStatus() {
		return paperStatus;
	}

	public void setPaperStatus(PaperStatus paperStatus) {
		this.paperStatus = paperStatus;
	}

	public int getMergeCount() {
		return mergeCount;
	}

	public void setMergeCount(int mergeCount) {
		this.mergeCount = mergeCount;
	}

	public int getSepCount() {
		return sepCount;
	}

	public void setSepCount(int sepCount) {
		this.sepCount = sepCount;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public String getExamTime() {
		return examTime;
	}

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

	public List<SupplyProvInfo> getSupplyProvInfo() {
		return supplyProvInfo;
	}

	public void setSupplyProvInfo(List<SupplyProvInfo> supplyProvInfo) {
		this.supplyProvInfo = supplyProvInfo;
	}

	public Integer getBatchId() {
		return batchId;
	}

	public void setBatchId(Integer batchId) {
		this.batchId = batchId;
	}

	public String getPaperStatusLabel() {
		return paperStatus == null?"":paperStatus.getValue();
	}

	public void setPaperStatusLabel(String paperStatusLabel) {
		this.paperStatusLabel = paperStatusLabel;
	}

	public long getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(long createdBy) {
		this.createdBy = createdBy;
	}

	public Date getUpdatedTime() {
		return updatedTime;
	}

	public void setUpdatedTime(Date updatedTime) {
		this.updatedTime = updatedTime;
	}

	public boolean isPrinted() {
		return printed;
	}

	public void setPrinted(boolean printed) {
		this.printed = printed;
	}
	
	
}
