package org.cs.mgr.setting.model;
import javax.persistence.*;
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: SysAdvPosition 
 * @Description:  
 * @author: sunny_shi
 * @date: 2018-06-09 13:29:15
 */
@Table(name = "sys_adv_position")
@Entity
@DynamicInsert
@DynamicUpdate
public class SysAdvPosition extends  BaseEntity {

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

	/** 广告位名称  */
	private String apName;  
	/** 广告位简介  */
	private String apIntro;  
	/** 展示方式  */
	private String apDisplay;  
	/** 是否启用  */
	private String isUse;  
	/** 广告位宽度  */
	private Integer apWidth;  
	/** 广告位高度  */
	private Integer apHeight;  
	/** 默认内容  */
	private String defaultContent;  
	/** 展示平台  */
	private String client;  
	/** 广告code  */
	private String code;

	@Id
	@SequenceGenerator(name="TB_MGM_PRODUCT",sequenceName="ADVPOSITION_SEQ")
	@GeneratedValue(generator="TB_MGM_PRODUCT",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 = "ap_name", columnDefinition="VARCHAR2(50) " )
	public String getApName()
	{
		return apName;
	}
	
	public void setApName(String apName)
	{
		this.apName= apName;
	}
	
	
	@Column(name = "ap_intro", columnDefinition="VARCHAR2(100) " )
	public String getApIntro()
	{
		return apIntro;
	}
	
	public void setApIntro(String apIntro)
	{
		this.apIntro= apIntro;
	}
	
	
	@Column(name = "ap_display", columnDefinition="CHAR(1) " )
	public String getApDisplay()
	{
		return apDisplay;
	}
	
	public void setApDisplay(String apDisplay)
	{
		this.apDisplay= apDisplay;
	}
	
	
	@Column(name = "is_use", columnDefinition="CHAR(1) " )
	public String getIsUse()
	{
		return isUse;
	}
	
	public void setIsUse(String isUse)
	{
		this.isUse= isUse;
	}
	
	
	@Column(name = "ap_width", columnDefinition="NUMBER " )
	public Integer getApWidth()
	{
		return apWidth;
	}
	
	public void setApWidth(Integer apWidth)
	{
		this.apWidth= apWidth;
	}
	
	
	@Column(name = "ap_height", columnDefinition="NUMBER " )
	public Integer getApHeight()
	{
		return apHeight;
	}
	
	public void setApHeight(Integer apHeight)
	{
		this.apHeight= apHeight;
	}
	
	
	@Column(name = "default_content", columnDefinition="VARCHAR2(100) " )
	public String getDefaultContent()
	{
		return defaultContent;
	}
	
	public void setDefaultContent(String defaultContent)
	{
		this.defaultContent= defaultContent;
	}
	
	
	@Column(name = "client", columnDefinition="CHAR(1) " )
	public String getClient()
	{
		return client;
	}
	
	public void setClient(String client)
	{
		this.client= client;
	}
	
	
	@Column(name = "code", columnDefinition="VARCHAR2(30) " )
	public String getCode()
	{
		return code;
	}
	
	public void setCode(String code)
	{
		this.code= code;
	}
	
	
	 
	public Class entityClass()
	{
		return ENTITY_CLASS;
	}
	
	
 	protected StringBuilder toStringBuilder(StringBuilder sb)
 	{
 		return sb 
		.append(",id=").append(this.id)
		.append(",apName=").append(this.apName)
		.append(",apIntro=").append(this.apIntro)
		.append(",apDisplay=").append(this.apDisplay)
		.append(",isUse=").append(this.isUse)
		.append(",apWidth=").append(this.apWidth)
		.append(",apHeight=").append(this.apHeight)
		.append(",defaultContent=").append(this.defaultContent)
		.append(",client=").append(this.client)
		.append(",code=").append(this.code)
		.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("SysAdvPosition[")).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.apName!=null){ map.put("apName",this.apName);}
	     if(this.apIntro!=null){ map.put("apIntro",this.apIntro);}
	     if(this.apDisplay!=null){ map.put("apDisplay",this.apDisplay);}
	     if(this.isUse!=null){ map.put("isUse",this.isUse);}
	     if(this.apWidth!=null){ map.put("apWidth",this.apWidth);}
	     if(this.apHeight!=null){ map.put("apHeight",this.apHeight);}
	     if(this.defaultContent!=null){ map.put("defaultContent",this.defaultContent);}
	     if(this.client!=null){ map.put("client",this.client);}
	     if(this.code!=null){ map.put("code",this.code);}
		 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(SysAdvPosition en)
	{
		  if(this.id !=null){ en.setId(this.id);}
		  if(this.apName !=null){ en.setApName(this.apName);}
		  if(this.apIntro !=null){ en.setApIntro(this.apIntro);}
		  if(this.apDisplay !=null){ en.setApDisplay(this.apDisplay);}
		  if(this.isUse !=null){ en.setIsUse(this.isUse);}
		  if(this.apWidth !=null){ en.setApWidth(this.apWidth);}
		  if(this.apHeight !=null){ en.setApHeight(this.apHeight);}
		  if(this.defaultContent !=null){ en.setDefaultContent(this.defaultContent);}
		  if(this.client !=null){ en.setClient(this.client);}
		  if(this.code !=null){ en.setCode(this.code);}
		  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 SysAdvPosition)) {
  	 		super.copyFrom(obj);
  	 	}else {
  	  		SysAdvPosition bean=(SysAdvPosition)obj;
			this.setId(bean.getId());
			this.setApName(bean.getApName());
			this.setApIntro(bean.getApIntro());
			this.setApDisplay(bean.getApDisplay());
			this.setIsUse(bean.getIsUse());
			this.setApWidth(bean.getApWidth());
			this.setApHeight(bean.getApHeight());
			this.setDefaultContent(bean.getDefaultContent());
			this.setClient(bean.getClient());
			this.setCode(bean.getCode());
     	this.setAttr1(bean.getAttr1());
     	this.setAttr2(bean.getAttr2());
     	this.setAttr3(bean.getAttr3());
     	this.setCreateDate(bean.getCreateDate());
     	this.setModifyDate(bean.getModifyDate());
     	this.setIsDelete(bean.getIsDelete());
     	}
 	 }
}
