package com.bocloud.ims.entity.resource;

import com.bocloud.common.utils.DateDeserializer;
import com.bocloud.common.utils.DateSerializer;
import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.IgnoreAll;
import com.bocloud.entity.annotations.IgnoreInsert;
import com.bocloud.entity.annotations.IgnoreUpdate;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.bean.GenericEntity;
import com.bocloud.entity.meta.PKStrategy;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 机房类
 * 
 * @author wei wei
 * @version 1.0
 * @since 2016.02.26
 */
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Table("room")
public class Room extends GenericEntity {

	@PK(value = PKStrategy.AUTO)
	private Long id; // ID
	@Column("location_sn")
	private String locationSn; // 位置编号
	@Column("contact_phone")
	private String contactPhone; // 联系电话
	@Column("contacter")
	private String contacter; // 联系人
	@Column("type")
	private String type; // 机房类型
	@Column("config")
	private String config;
	@IgnoreInsert
	@IgnoreUpdate
	private String typeName;
	@Column("commission_date")
	@JsonSerialize(using = DateSerializer.class)
	@JsonDeserialize(using = DateDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date commissionDate; // 投产日期
	@Column("total_area")
	private String totalArea; // 总面积
	@Column("row_num")
	private Integer rowNum;
	@Column("col_num")
	private Integer colNum;
	@Column("dc_id")
	private Long dcId; // 数据中心ID
	@IgnoreInsert
	@IgnoreUpdate
	private String dcname; // 数据中心名称
	@IgnoreInsert
	@IgnoreUpdate
	private Integer rooms; // 机房数量
	@IgnoreInsert
	@IgnoreUpdate
	private Integer racks; // 机柜数量
	@IgnoreInsert
	@IgnoreUpdate
	private Integer servers; // 服务器数量
	@IgnoreAll
	private Long cmdbId;// cmdb对应主键ID

}
