package org.cs.mgr.order.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Transient;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Version;
import java.util.HashMap;
import java.math.BigDecimal;
import java.util.Map;
import java.util.Date;
import org.cs.core.model.BaseEntity;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

/**
 * 订单终止申请 
 * 
 * @ClassName: MgmOrderBreak 
 * @Description:  
 * @author: sunny_shi
 * @date: 2018-06-09 13:29:03
 */
@Table(name = "mgm_order_break")
@Entity
@DynamicInsert
@DynamicUpdate
public class MgmOrderBreak extends  BaseEntity {

    /**
	 * 
	 */
	private static final long serialVersionUID = -182672592640409189L;
	private static final Class<MgmOrderBreak> ENTITY_CLASS = MgmOrderBreak.class;
    
	public MgmOrderBreak()
	{
	}

	/** 订单id  */
	private Integer orderId;  
	/** 申请人Id*/
	private Integer userId;
	/** 申请时间  */
	private java.util.Date applyTime;  
	/** 申请原因  */
	private String applyReason;  
	/** 订单状态  */
	private String orderState;  
	/** 申请状态  */
	private String applyState;  
	/** 审批人id  */
	private Integer approverId;  
	/** 审批人  */
	private String approver;  
	/** 审批意见  */
	private String approveReamrk;  
	//private Integer id;
	@Id
	@SequenceGenerator(name="sequenceGenerator",sequenceName="mgm_order_break_seq")
	@GeneratedValue(generator="sequenceGenerator",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;
	}

	@Column(name = "order_id", columnDefinition="NUMBER " )
	public Integer getOrderId()
	{
		return orderId;
	}
	
	public void setOrderId(Integer orderId)
	{
		this.orderId= orderId;
	}
	
	
	@Column(name = "apply_time", columnDefinition="DATE " )
	public java.util.Date getApplyTime()
	{
		return applyTime;
	}
	
	public void setApplyTime(java.util.Date applyTime)
	{
		this.applyTime= applyTime;
	}
	
	
	@Column(name = "apply_reason", columnDefinition="VARCHAR2(200) " )
	public String getApplyReason()
	{
		return applyReason;
	}
	
	public void setApplyReason(String applyReason)
	{
		this.applyReason= applyReason;
	}
	
	
	@Column(name = "order_state", columnDefinition="CHAR(1) " )
	public String getOrderState()
	{
		return orderState;
	}
	
	public void setOrderState(String orderState)
	{
		this.orderState= orderState;
	}
	
	
	@Column(name = "apply_state", columnDefinition="CHAR(1) " )
	public String getApplyState()
	{
		return applyState;
	}
	
	public void setApplyState(String applyState)
	{
		this.applyState= applyState;
	}
	
	
	@Column(name = "approver_id", columnDefinition="NUMBER " )
	public Integer getApproverId()
	{
		return approverId;
	}
	
	public void setApproverId(Integer approverId)
	{
		this.approverId= approverId;
	}
	
	
	@Column(name = "approver", columnDefinition="VARCHAR2(2) " )
	public String getApprover()
	{
		return approver;
	}
	
	public void setApprover(String approver)
	{
		this.approver= approver;
	}
	
	
	@Column(name = "approve_reamrk", columnDefinition="VARCHAR2(200) " )
	public String getApproveReamrk()
	{
		return approveReamrk;
	}
	
	public void setApproveReamrk(String approveReamrk)
	{
		this.approveReamrk= approveReamrk;
	}
	
	
	 
	public Class entityClass()
	{
		return ENTITY_CLASS;
	}
	
	
 	protected StringBuilder toStringBuilder(StringBuilder sb)
 	{
 		return sb 
		.append(",id=").append(this.id)
		.append(",orderId=").append(this.orderId)
		.append(",applyTime=").append(this.applyTime)
		.append(",applyReason=").append(this.applyReason)
		.append(",orderState=").append(this.orderState)
		.append(",applyState=").append(this.applyState)
		.append(",approverId=").append(this.approverId)
		.append(",approver=").append(this.approver)
		.append(",approveReamrk=").append(this.approveReamrk)
		.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("MgmOrderBreak[")).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.orderId!=null){ map.put("orderId",this.orderId);}
	     if(this.applyTime!=null){ map.put("applyTime",this.applyTime);}
	     if(this.applyReason!=null){ map.put("applyReason",this.applyReason);}
	     if(this.orderState!=null){ map.put("orderState",this.orderState);}
	     if(this.applyState!=null){ map.put("applyState",this.applyState);}
	     if(this.approverId!=null){ map.put("approverId",this.approverId);}
	     if(this.approver!=null){ map.put("approver",this.approver);}
	     if(this.approveReamrk!=null){ map.put("approveReamrk",this.approveReamrk);}
		 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(MgmOrderBreak en)
	{
		  if(this.id !=null){ en.setId(this.id);}
		  if(this.orderId !=null){ en.setOrderId(this.orderId);}
		  if(this.applyTime !=null){ en.setApplyTime(this.applyTime);}
		  if(this.applyReason !=null){ en.setApplyReason(this.applyReason);}
		  if(this.orderState !=null){ en.setOrderState(this.orderState);}
		  if(this.applyState !=null){ en.setApplyState(this.applyState);}
		  if(this.approverId !=null){ en.setApproverId(this.approverId);}
		  if(this.approver !=null){ en.setApprover(this.approver);}
		  if(this.approveReamrk !=null){ en.setApproveReamrk(this.approveReamrk);}
		  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 MgmOrderBreak)) {
  	 		super.copyFrom(obj);
  	 	}else {
  	  		MgmOrderBreak bean=(MgmOrderBreak)obj;
			this.setId(bean.getId());
			this.setOrderId(bean.getOrderId());
			this.setApplyTime(bean.getApplyTime());
			this.setApplyReason(bean.getApplyReason());
			this.setOrderState(bean.getOrderState());
			this.setApplyState(bean.getApplyState());
			this.setApproverId(bean.getApproverId());
			this.setApprover(bean.getApprover());
			this.setApproveReamrk(bean.getApproveReamrk());
     	this.setAttr1(bean.getAttr1());
     	this.setAttr2(bean.getAttr2());
     	this.setAttr3(bean.getAttr3());
     	this.setCreateDate(bean.getCreateDate());
     	this.setModifyDate(bean.getModifyDate());
     	this.setIsDelete(bean.getIsDelete());
     	}
 	 }
  	@Column(name = "user_id", columnDefinition="NUMBER " )
	public Integer getUserId() {
		return userId;
	}
	public void setUserId(Integer userId) {
		this.userId = userId;
	}
}
