package com.uas.search.console.b2b.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * 平台新增询价单明细
 * 
 * @author hejq
 * @time 创建时间：2017年4月17日
 */
@Entity
@Table(name = "PURC$PUINQUIRYITEMS")
public class PurcInquiryItemSimpleInfo {

	@Id
	@Column(name = "id_id")
	private Long id;

	/**
	 * 序号
	 */
	@Column(name = "id_number")
	private Short number;

	/**
	 * 询价单
	 */
	@ManyToOne(cascade = CascadeType.ALL, optional = true)
	@JoinColumn(name = "id_inid", nullable = false)
	private PurcInquirySimpleInfo inquiry;

	/**
	 * 买家采购员UU
	 */
	@Column(name = "id_useruu")
	private Long userUU;

	/**
	 * 产品
	 */
	@OneToOne(cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "id_prid", insertable = false, updatable = false)
	private ProductSimpleInfo product;

	@Column(name = "id_prid")
	private Long productId;

	/**
	 * （卖家报的）物料品牌
	 */
	@Column(name = "id_brand")
	private String brand;

	/**
	 * （卖家报的）供应商物料编号
	 */
	@Column(name = "id_vendorprodcode")
	private String vendorprodcode;

	/**
	 * search项目进行是否已过期时实际根据主表中enddate与当前时间的比较获取，但是数据库无字段会报“标识符无效”的错误
	 * 所以建立此字段，但是此字段不会赋值。
	 * 
	 * @return
	 */
	@Column(name = "id_overdue")
	private Short overdue;

	public Long getId() {
		return id;
	}

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

	public Short getNumber() {
		return number;
	}

	public void setNumber(Short number) {
		this.number = number;
	}

	public PurcInquirySimpleInfo getInquiry() {
		return inquiry;
	}

	public void setInquiry(PurcInquirySimpleInfo inquiry) {
		this.inquiry = inquiry;
	}

	public Long getUserUU() {
		return userUU;
	}

	public void setUserUU(Long userUU) {
		this.userUU = userUU;
	}

	public ProductSimpleInfo getProduct() {
		return product;
	}

	public void setProduct(ProductSimpleInfo product) {
		this.product = product;
	}

	public Long getProductId() {
		return productId;
	}

	public void setProductId(Long productId) {
		this.productId = productId;
	}

	public String getBrand() {
		return brand;
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}

	public String getVendorprodcode() {
		return vendorprodcode;
	}

	public void setVendorprodcode(String vendorprodcode) {
		this.vendorprodcode = vendorprodcode;
	}

	public Short getOverdue() {
		return overdue;
	}

	public void setOverdue(Short overdue) {
		this.overdue = overdue;
	}

}
