package org.cs.mgr.product.model;
import java.util.HashMap;
import java.util.Map;

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

import org.cs.core.model.BaseEntity;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

/**
 * 意向下单
 * 
 * @ClassName: MgmIntentOrder 
 * @Description:  
 * @author: sunny_shi
 * @date: 2018-06-09 13:29:10
 */
@Table(name = "mgm_intent_order")
@Entity
@DynamicInsert
@DynamicUpdate
public class MgmIntentOrder extends  BaseEntity {

    private static final Class<MgmIntentOrder> ENTITY_CLASS = MgmIntentOrder.class;
    
	public MgmIntentOrder()
	{
	}

	@Id
	@SequenceGenerator(name="TB_MGM_INTENT_ORDER",sequenceName="INTENT_ORDER_SEQ")
	@GeneratedValue(generator="TB_MGM_INTENT_ORDER",strategy=GenerationType.SEQUENCE)
	@Column(name = "id", unique = true, nullable = false, precision = 11, scale = 0)
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	private String customerName;//客户名称
	
	private String customerPhone;//客户手机号
	
	/** 填报人  */
	private Integer userId;  
	//工号
	private String jobNumber;
	/** 产品意向  */
	private String productIntent;  
	/** 意向时间  */
	private java.util.Date intentTime; 
	
	//产品id
	private Integer productId;
	
	
	@Column(name = "product_id", columnDefinition="NUMBER" )
	public Integer getProductId() {
		return productId;
	}

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

	@Column(name = "user_id", columnDefinition="NUMBER" )
	public Integer getUserId()
	{
		return userId;
	}
	
	public void setUserId(Integer userId)
	{
		this.userId= userId;
	}
	
	@Column(name = "customer_name", columnDefinition="VARCHAR2(100)" )
	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}
	@Column(name = "customer_phone", columnDefinition="VARCHAR2(50)" )
	public String getCustomerPhone() {
		return customerPhone;
	}

	public void setCustomerPhone(String customerPhone) {
		this.customerPhone = customerPhone;
	}
	@Column(name = "job_number", columnDefinition="VARCHAR2(255)" )
	public String getJobNumber() {
		return jobNumber;
	}

	public void setJobNumber(String jobNumber) {
		this.jobNumber = jobNumber;
	}
	@Column(name = "product_intent", columnDefinition="VARCHAR2(1000)" )
	public String getProductIntent() {
		return productIntent;
	}

	public void setProductIntent(String productIntent) {
		this.productIntent = productIntent;
	}
	@Column(name = "intent_time", columnDefinition="DATE " )
	public java.util.Date getIntentTime() {
		return intentTime;
	}

	public void setIntentTime(java.util.Date intentTime) {
		this.intentTime = intentTime;
	}

	 
	public Class entityClass()
	{
		return ENTITY_CLASS;
	}
	
	
 	protected StringBuilder toStringBuilder(StringBuilder sb)
 	{
 		return sb 
		.append(",id=").append(this.id)
		.append(",userId=").append(this.userId)
		.append(",attr1=").append(this.attr1)
		.append(",attr2=").append(this.attr2)
		.append(",attr3=").append(this.attr3)
		.append(",createDate=").append(this.createDate)
		.append(",modifyDate=").append(this.modifyDate)
		.append(",isDelete=").append(this.isDelete)
		;
 	}
 	
 	
 	@Override
	public String toString()
	{
		return toStringBuilder(new StringBuilder().append("MgmProductView[")).append(']').toString();
	}
	 
	
	public Map<String,Object> mapValue()
	{
	    Map<String,Object> map=new HashMap<String,Object>();
	     if(this.id!=null){ map.put("id",this.id);}
	     if(this.userId!=null){ map.put("userId",this.userId);}
		 if(this.attr1 !=null){ map.put("attr1", this.attr1);}
		 if(this.attr2 !=null){ map.put("attr2", this.attr2);}
		 if(this.attr3 !=null){ map.put("attr3", this.attr3);}
		 if(this.createDate != null){ map.put("createDate", this.createDate);}
		 if(this.modifyDate != null){ map.put("modifyDate", this.modifyDate);}
		 if(this.isDelete != null){ map.put("isDelete", this.isDelete);}
		return map;
	}
	
	public void mergeTo(MgmIntentOrder en)
	{
		  if(this.id !=null){ en.setId(this.id);}
		  if(this.userId !=null){ en.setUserId(this.userId);}
		  if(this.attr1!=null){ en.setAttr1(this.attr1);}
		  if(this.attr2!=null){ en.setAttr2(this.attr2);}
		  if(this.attr3!=null){ en.setAttr3(this.attr3);}
		  if(this.createDate != null){ en.setCreateDate(this.createDate);}
		  if(this.modifyDate != null){ en.setModifyDate(this.modifyDate);}
		  if(this.isDelete != null){ en.setIsDelete(this.isDelete);}
	}
	
  	@Override
  	public void copyFrom(Object obj)
  	{  
  		 if(!(obj instanceof MgmIntentOrder)) {
  	 		super.copyFrom(obj);
  	 	}else {
  	  		MgmIntentOrder bean=(MgmIntentOrder)obj;
			this.setId(bean.getId());
			this.setUserId(bean.getUserId());
     	this.setAttr1(bean.getAttr1());
     	this.setAttr2(bean.getAttr2());
     	this.setAttr3(bean.getAttr3());
     	this.setCreateDate(bean.getCreateDate());
     	this.setModifyDate(bean.getModifyDate());
     	this.setIsDelete(bean.getIsDelete());
     	}
 	 }
}
