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

import java.util.Date;

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

/**
 * 平台里面，以供应商的角度来查看采购询价单
 * 
 * <pre>
 * 数据库虚拟列里面用到的函数，是不允许操作动态数据的；原over_sysdate函数用法存在问题；
 * 改用视图{@code v$purc$inquiry}处理
 * </pre>
 * 
 * @author yingp
 * 
 */
@Table(name = "v$purc$inquiry")
@Entity
public class PurchaseInquirySimpleInfo {

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

	/**
	 * 日期
	 */
	@Column(name = "in_date")
	private Date date;

	/**
	 * 询价企业
	 */
	@OneToOne
	@JoinColumn(name = "in_enuu", insertable = false, updatable = false)
	private EnterpriseSimpleInfo vend;

	/**
	 * 流水号
	 */
	@Column(name = "in_code")
	private String code;

	/**
	 * 是否过期
	 */
	@Column(name = "in_overdue", insertable = false, updatable = false)
	private Short overdue;

	/**
	 * 报价截止日期
	 */
	@Column(name = "in_enddate")
	private Date endDate;

	/**
	 * 客户已提交（0为未提交，1为已提交）
	 */
	@Column(name = "in_checked")
	private Short check;

	public Long getId() {
		return id;
	}

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

	public EnterpriseSimpleInfo getVend() {
		return vend;
	}

	public void setVend(EnterpriseSimpleInfo vend) {
		this.vend = vend;
	}

	public String getCode() {
		return code;
	}

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

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Short getOverdue() {
		return overdue;
	}

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

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public Short getCheck() {
		return check;
	}

	public void setCheck(Short check) {
		this.check = check;
	}

	@Override
	public String toString() {
		return "PurchaseInquirySimpleInfo [id=" + id + ", date=" + date + ", vend=" + vend + ", code=" + code
				+ ", overdue=" + overdue + ", endDate=" + endDate + ", check=" + check + "]";
	}

}
