package com.uas.platform.b2b.model;

import java.io.Serializable;
import java.sql.Date;

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;

@Entity
@Table(name = "sale$orderitems")
public class SaleOrderItem implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

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

	/**
	 * 销售订单
	 */
	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
	@JoinColumn(name = "sd_said")
	private SaleOrder order;

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

	/**
	 * 产品ID
	 */
	@Column(name = "sd_prid")
	private Long productId;

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

	/**
	 * 数量
	 */
	@Column(name = "sd_qty")
	private Double qty;

	/**
	 * 备注
	 */
	@Column(name = "sd_remark")
	private String remark;

	/**
	 * 含税单价
	 */
	@Column(name = "sd_price")
	private Double price;

	/**
	 * 含税金额
	 */
	@Column(name = "sd_amount", insertable = false, updatable = false)
	private Double amount;

	/**
	 * 交货日期
	 */
	@Column(name = "sd_delivery")
	private Date delivery;

	private Short isok;

	public Long getId() {
		return id;
	}

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

	public SaleOrder getOrder() {
		return order;
	}

	public void setOrder(SaleOrder order) {
		this.order = order;
	}

	public Short getNumber() {
		return number;
	}

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

	public Long getProductId() {
		return productId;
	}

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

	public Product getProduct() {
		return product;
	}

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

	public Double getQty() {
		return qty;
	}

	public void setQty(Double qty) {
		this.qty = qty;
	}

	public String getRemark() {
		return remark;
	}

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

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public Double getAmount() {
		return amount;
	}

	public void setAmount(Double amount) {
		this.amount = amount;
	}

	public Date getDelivery() {
		return delivery;
	}

	public void setDelivery(Date delivery) {
		this.delivery = delivery;
	}

	public Short getIsok() {
		return isok;
	}

	public void setIsok(Short isok) {
		this.isok = isok;
	}
}
