package com.cloudcross.ssp.model;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import com.cloudcross.ssp.common.utils.FieldInfo;

/**
 * 创建人：rongying
 * 创建时间：2015.12.11
 * dsp-广告主-创意实体对象
 */

@SuppressWarnings("serial")
public class DspBanner implements Serializable {
	
	private Long id;//创意id
	
	private Long dspId;//dspid（t_dsp_agent.id）
	
	private Long advertiserId;//广告主id（t_dsp_advertiser.id）
	
	private String path;//文件路径
	
	private Long height;//高
	
	private Long width;//宽
	
	private Long rheight;//比率高
	
	private Long rwidth;//比率宽
	
	private Integer state;//状态（0通过，1待检查，2检查未通过）
	
	private String memo;//备注

	private Date updated;//最后更新时间

	public Long getId() {
		return id;
	}

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

	public Long getDspId() {
		return dspId;
	}

	public void setDspId(Long dspId) {
		this.dspId = dspId;
	}

	public Long getAdvertiserId() {
		return advertiserId;
	}

	public void setAdvertiserId(Long advertiserId) {
		this.advertiserId = advertiserId;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public Long getHeight() {
		return height;
	}

	public void setHeight(Long height) {
		this.height = height;
	}

	public Long getWidth() {
		return width;
	}

	public void setWidth(Long width) {
		this.width = width;
	}
	
	public Long getRheight() {
		return rheight;
	}

	public void setRheight(Long rheight) {
		this.rheight = rheight;
	}

	public Long getRwidth() {
		return rwidth;
	}

	public void setRwidth(Long rwidth) {
		this.rwidth = rwidth;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public Date getUpdated() {
		return updated;
	}

	public void setUpdated(Date updated) {
		this.updated = updated;
	}

	@Override
	public String toString() {
		return "DspBanner [id=" + id + ", dspId=" + dspId + " advertiserId=" + advertiserId 
				+ ", path=" + path + ", height=" + height + ", width=" + width + ", "
				+ ", rheight=" + height + ", rwidth=" + width + ", "
				+ "state=" + state + ", memo=" + memo + ", " + "updated=" + updated + "]";
	}
	
	/**
	 * 组装t_dsp_banner表结构
	 * @return
	 */
	public static Map<String,FieldInfo> getFieldInfoForDspBanner(){
		Map<String,FieldInfo> map = new HashMap<String,FieldInfo>();
		String[] columnNames = {"id","dspId","advertiserId","path","height","width","rheight","rwidth","state","memo","updated"};
		String[] isNulls = {"NO","NO","NO","NO","NO","NO","NO","NO","NO","YES","NO"};
		String[] dataTypes= {"Long","Long","Long","String","Long","Long","Long","Long","Integer","String","Date"};
		int[] maxLengths = {11,11,11,255,11,11,11,11,3,255,0};
		for (int i = 0, l = columnNames.length; i<l; i++) {
			FieldInfo field = new FieldInfo();
			field.setColumnName(columnNames[i]);
			field.setIsNull(isNulls[i]);
			field.setDataType(dataTypes[i]);
			field.setMaxLength(maxLengths[i]);
			field.setPointNum(0);
			map.put(columnNames[i], field);
		}
		return map;
	}

}

