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: MgmOrderSchedule 
 * @Description:  
 * @author: sunny_shi
 * @date: 2018-06-09 13:29:03
 */
@Table(name = "mgm_order_schedule")
@Entity
@DynamicInsert
@DynamicUpdate
public class MgmOrderSchedule extends  BaseEntity {

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

	/** 订单id  */
	private Integer orderId;  
	/** 订单状态  */
	private String orderState;  
	/** 填报人  */
	private Long fillUserid;  
	/** 填报人姓名  */
	private String fillUsername;  
	/** 填报内容  */
	private String fillContent;  
	/** 填报时间  */
	private java.util.Date fillTime;  
	/** 图片1  */
	private String imgeUrl1;  
	/** 图片2  */
	private String imgeUrl2;  
	/** 图片3  */
	private String imgeUrl3;  
	/** 图片4  */
	private String imgeUrl4;  
	/** 图片5  */
	private String imgeUrl5;  

	//private Integer id;
	@Id
	@SequenceGenerator(name="sequenceGenerator",sequenceName="mgm_order_schedule_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 = "order_state", columnDefinition="CHAR(1) " )
	public String getOrderState()
	{
		return orderState;
	}
	
	public void setOrderState(String orderState)
	{
		this.orderState= orderState;
	}
	
	
	@Column(name = "fill_userid", columnDefinition="NUMBER " )
	public Long getFillUserid()
	{
		return fillUserid;
	}
	
	public void setFillUserid(Long fillUserid)
	{
		this.fillUserid= fillUserid;
	}
	
	
	@Column(name = "fill_username", columnDefinition="VARCHAR2(20) " )
	public String getFillUsername()
	{
		return fillUsername;
	}
	
	public void setFillUsername(String fillUsername)
	{
		this.fillUsername= fillUsername;
	}
	
	
	@Column(name = "fill_content", columnDefinition="VARCHAR2(200) " )
	public String getFillContent()
	{
		return fillContent;
	}
	
	public void setFillContent(String fillContent)
	{
		this.fillContent= fillContent;
	}
	
	
	@Column(name = "fill_time", columnDefinition="DATE " )
	public java.util.Date getFillTime()
	{
		return fillTime;
	}
	
	public void setFillTime(java.util.Date fillTime)
	{
		this.fillTime= fillTime;
	}
			
	@Column(name = "imge_url1", columnDefinition="VARCHAR2(200) " )
	public String getImgeUrl1() {
		return imgeUrl1;
	}
	public void setImgeUrl1(String imgeUrl1) {
		this.imgeUrl1 = imgeUrl1;
	}
	@Column(name = "imge_url2", columnDefinition="VARCHAR2(200) " )
	public String getImgeUrl2() {
		return imgeUrl2;
	}
	public void setImgeUrl2(String imgeUrl2) {
		this.imgeUrl2 = imgeUrl2;
	}
	@Column(name = "imge_url3", columnDefinition="VARCHAR2(200) " )
	public String getImgeUrl3() {
		return imgeUrl3;
	}
	public void setImgeUrl3(String imgeUrl3) {
		this.imgeUrl3 = imgeUrl3;
	}
	@Column(name = "imge_url4", columnDefinition="VARCHAR2(200) " )
	public String getImgeUrl4() {
		return imgeUrl4;
	}
	public void setImgeUrl4(String imgeUrl4) {
		this.imgeUrl4 = imgeUrl4;
	}
	
	@Column(name = "imge_url5", columnDefinition="VARCHAR2(200) " )
	public String getImgeUrl5() {
		return imgeUrl5;
	}
	public void setImgeUrl5(String imgeUrl5) {
		this.imgeUrl5 = imgeUrl5;
	}
	
	
	
	 
	public Class entityClass()
	{
		return ENTITY_CLASS;
	}
	
	
 	protected StringBuilder toStringBuilder(StringBuilder sb)
 	{
 		return sb 
		.append(",id=").append(this.id)
		.append(",orderId=").append(this.orderId)
		.append(",orderState=").append(this.orderState)
		.append(",fillUserid=").append(this.fillUserid)
		.append(",fillUsername=").append(this.fillUsername)
		.append(",fillContent=").append(this.fillContent)
		.append(",fillTime=").append(this.fillTime)
		.append(",imgeUrl1=").append(this.imgeUrl1)
		.append(",imgeUrl2=").append(this.imgeUrl2)
		.append(",imgeUrl3=").append(this.imgeUrl3)
		.append(",imgeUrl4=").append(this.imgeUrl4)
		.append(",imgeUrl5=").append(this.imgeUrl5)
		.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("MgmOrderSchedule[")).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.orderState!=null){ map.put("orderState",this.orderState);}
	     if(this.fillUserid!=null){ map.put("fillUserid",this.fillUserid);}
	     if(this.fillUsername!=null){ map.put("fillUsername",this.fillUsername);}
	     if(this.fillContent!=null){ map.put("fillContent",this.fillContent);}
	     if(this.fillTime!=null){ map.put("fillTime",this.fillTime);}
	     if(this.imgeUrl1!=null) {map.put("imgeUrl1",this.imgeUrl1);}
	     if(this.imgeUrl2!=null) {map.put("imgeUrl2",this.imgeUrl2);}
	     if(this.imgeUrl3!=null) {map.put("imgeUrl3",this.imgeUrl3);}
	     if(this.imgeUrl4!=null) {map.put("imgeUrl4",this.imgeUrl4);}
	     if(this.imgeUrl5!=null) {map.put("imgeUrl5",this.imgeUrl5);}
		 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(MgmOrderSchedule en)
	{
		  if(this.id !=null){ en.setId(this.id);}
		  if(this.orderId !=null){ en.setOrderId(this.orderId);}
		  if(this.orderState !=null){ en.setOrderState(this.orderState);}
		  if(this.fillUserid !=null){ en.setFillUserid(this.fillUserid);}
		  if(this.fillUsername !=null){ en.setFillUsername(this.fillUsername);}
		  if(this.fillContent !=null){ en.setFillContent(this.fillContent);}
		  if(this.fillTime !=null){ en.setFillTime(this.fillTime);}
		  if(this.imgeUrl1!=null) {en.setImgeUrl1(this.imgeUrl1);}
		  if(this.imgeUrl2!=null) {en.setImgeUrl2(this.imgeUrl2);}
		  if(this.imgeUrl3!=null) {en.setImgeUrl3(this.imgeUrl3);}
		  if(this.imgeUrl4!=null) {en.setImgeUrl4(this.imgeUrl4);}
		  if(this.imgeUrl5!=null) {en.setImgeUrl5(this.imgeUrl5);}
		  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 MgmOrderSchedule)) {
  	 		super.copyFrom(obj);
  	 	}else {
  	  		MgmOrderSchedule bean=(MgmOrderSchedule)obj;
			this.setId(bean.getId());
			this.setOrderId(bean.getOrderId());
			this.setOrderState(bean.getOrderState());
			this.setFillUserid(bean.getFillUserid());
			this.setFillUsername(bean.getFillUsername());
			this.setFillContent(bean.getFillContent());
			this.setFillTime(bean.getFillTime());
			this.setImgeUrl1(bean.getImgeUrl1());
			this.setImgeUrl2(bean.getImgeUrl2());
			this.setImgeUrl3(bean.getImgeUrl3());
			this.setImgeUrl4(bean.getImgeUrl4());
			this.setImgeUrl5(bean.getImgeUrl5());
	     	this.setAttr1(bean.getAttr1());
	     	this.setAttr2(bean.getAttr2());
	     	this.setAttr3(bean.getAttr3());
	     	this.setCreateDate(bean.getCreateDate());
	     	this.setModifyDate(bean.getModifyDate());
	     	this.setIsDelete(bean.getIsDelete());
     	}
 	 }
}
