package com.uas.platform.b2b.model;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;


/**
 * 客户分配表
 * @author aof
 * @date 2016年1月4日 上午10:58:07
 *
 */
@Entity
@Table(name = "purc$distribute")
public class Distribute implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "pd_id")
	private Long id;
	
	/**
	 * 客户关联id
	 */
	@Column(name = "pd_vdid")
	private Long vendorId;
	
	/**
	 * 客户关联id
	 */
	@OneToOne(cascade = { CascadeType.REFRESH,CascadeType.MERGE })
	@JoinColumn(name = "pd_vdid", insertable = false, updatable = false)
	private Vendor vendor;
	
	/**
	 * 个人UU
	 */
	@Column(name = "pd_useruu")
	private Long userUU;
	
	/**
	 * 关联user
	 */
	@OneToOne(cascade = { CascadeType.REFRESH,CascadeType.MERGE })
	@JoinColumn(name = "pd_useruu", insertable = false, updatable = false)
	private User user;

	/**
	 * 是否被转移权限 (是1可以继续绑定其他人，或转移权限，为0则只能转移自己权限，无法再绑定他人)
	 */
	@Column(name = "pd_istransfer")
	private Short isTransfer;

	/**
	 * 分配此权限的人的uu号
	 */
	@Column(name = "pd_leaderuu")
	private Long leaderUU;

	public Long getId() {
		return id;
	}

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

	public Long getVendorId() {
		return vendorId;
	}

	public void setVendorId(Long vendorId) {
		this.vendorId = vendorId;
	}

	public Vendor getVendor() {
		return vendor;
	}

	public void setVendor(Vendor vendor) {
		this.vendor = vendor;
	}

	public Long getUserUU() {
		return userUU;
	}

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

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Short getIsTransfer() {
		return isTransfer;
	}

	public void setIsTransfer(Short isTransfer) {
		this.isTransfer = isTransfer;
	}

	public Long getLeaderUU() {
		return leaderUU;
	}

	public void setLeaderUU(Long leaderUU) {
		this.leaderUU = leaderUU;
	}
}
