package com.qmth.qrzk.supplypaper.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

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

/**
 * 供卷省份及信息
 * @author zhengmin
 *
 */
@Entity
@Table(name="qr_province")
public class Province {


	/**
	 * 国家代码
	 */
	public static final int NATION_CODE = 10;
	/**
	 * 四川代码
	 */
	public static final int SICHUAN_CODE = 51;
	/**
	 * 西藏代码
	 */
	public static final int XIZANG_CODE = 54;
	
	@Id
	private int code;//代码
	private String name;//名称
	private String zipcode;//邮编
	private String address;//地址
	private String office;//办公室
	private String phone;//联系电话
	private String receiver;//收件人
	
	private String unit;//工作单位
	
	@Transient
	private Long supplyProvId;
	private boolean enabled;
	
	@Enumerated(EnumType.STRING)
	@Column(name="paper_type")
	private PaperType paperType = PaperType.BLANK;//试卷类型
	@Transient
	private String paperFormat = "SEPERATE";//试卷格式
	@Transient String paperTypeLabel;
	
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getZipcode() {
		return zipcode;
	}
	public void setZipcode(String zipcode) {
		this.zipcode = zipcode;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getOffice() {
		return office;
	}
	public void setOffice(String office) {
		this.office = office;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getReceiver() {
		return receiver;
	}
	public void setReceiver(String receiver) {
		this.receiver = receiver;
	}
	public boolean isEnabled() {
		return enabled;
	}
	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}
	public PaperType getPaperType() {
		return paperType;
	}
	public void setPaperType(PaperType paperType) {
		this.paperType = paperType;
	}
	public String getPaperFormat() {
		return paperFormat;
	}
	public void setPaperFormat(String paperFormat) {
		this.paperFormat = paperFormat;
	}
	public Long getSupplyProvId() {
		return supplyProvId;
	}
	public void setSupplyProvId(Long supplyProvId) {
		this.supplyProvId = supplyProvId;
	}
	public String getPaperTypeLabel() {
		return paperType != null?paperType.getValue():"";
	}
	public void setPaperTypeLabel(String paperTypeLabel) {
		this.paperTypeLabel = paperTypeLabel;
	}
	
	public String getUnit() {
		return unit;
	}
	public void setUnit(String unit) {
		this.unit = unit;
	}
}
