package com.cloudcross.ssp.model;

import java.util.Date;

import com.cloudcross.ssp.web.widget.SelectorController.ISelector;

/**
 * 订单表
 * <p/>
 * 与t_order表相关。
 */
public class Order implements ISelector {
		// 主键
		private Long id;
		// 广告主ID
		private Long advertiserId;
		// 订单名称
		private Long operatorId;
		private String name;
		// 订单预算
		private float budget;
		// 订单备注
		private String comment;
		// 状态（0开启，1暂停）
		private Integer status;
		// 更新日期
		private Date updated;
		// 新增/status更新时间
		private Date supdated;
		/**
		 * 活动个数
		 * <p/>
		 * 与t_campaign表相关。
		 */
		//活动个数campaign
		private Long campaignNumber;
		
		private Long agentId;
		
		
		public Long getAgentId() {
			return agentId;
		}
		public void setAgentId(Long agentId) {
			this.agentId = agentId;
		}
		public Long getCampaignNumber() {
			return campaignNumber;
		}
		public void setCampaignNumber(Long campaignNumber) {
			this.campaignNumber = campaignNumber;
		}
		public Long getId() {
			return id;
		}
		public void setId(Long id) {
			this.id = id;
		}
		public Long getAdvertiserId() {
			return advertiserId;
		}
		public void setAdvertiserId(Long advertiserId) {
			this.advertiserId = advertiserId;
		}
		
		public Long getOperatorId() {
			return operatorId;
		}
		public void setOperatorId(Long operatorId) {
			this.operatorId = operatorId;
		}
		public String getName() {
			return name;
		}
		public void setName(String name) {
			this.name = name;
		}
		public float getBudget() {
			return budget;
		}
		public void setBudget(float budget) {
			this.budget = budget;
		}
		public String getComment() {
			return comment;
		}
		public void setComment(String comment) {
			this.comment = comment;
		}
		public Integer getStatus() {
			return status;
		}
		public void setStatus(Integer status) {
			this.status = status;
		}
		
		public Date getUpdated() {
			return updated;
		}
		public void setUpdated(Date updated) {
			this.updated = updated;
		}
		public Date getSupdated() {
			return supdated;
		}
		public void setSupdated(Date supdated) {
			this.supdated = supdated;
		}
		@Override
		public String toString() {
			return "Order [id=" + id + ", advertiserId=" + advertiserId
					+ ", agentId=" + agentId + ",name=" + name + ", budget=" + budget + ", comment="
					+ comment + ", status=" + status + ", upDate=" + updated
					+ "]";
		}
		@Override
		public String getLabel() {
			
			return this.name;
		}
		@Override
		public String getValue() {
			
			return String.valueOf(this.id);
		}
		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result
					+ ((advertiserId == null) ? 0 : advertiserId.hashCode());
			result = prime * result + Float.floatToIntBits(budget);
			result = prime * result
					+ ((comment == null) ? 0 : comment.hashCode());
			result = prime * result + ((name == null) ? 0 : name.hashCode());
			return result;
		}
		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Order other = (Order) obj;
			if (advertiserId == null) {
				if (other.advertiserId != null)
					return false;
			} else if (!advertiserId.equals(other.advertiserId))
				return false;
			if (Float.floatToIntBits(budget) != Float
					.floatToIntBits(other.budget))
				return false;
			if (comment == null) {
				if (other.comment != null)
					return false;
			} else if (!comment.equals(other.comment))
				return false;
			if (name == null) {
				if (other.name != null)
					return false;
			} else if (!name.equals(other.name))
				return false;
			return true;
		}
	
		
		
		
}
