package com.iformall.domain.po;

import cn.afterturn.easypoi.excel.annotation.Excel;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Table(name = "wx_shop")
public class WxShop implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
    protected Long id;
    
    @Transient
    protected List<String> ids;
    @Transient
    protected String sortColumns;
  
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	public String getSortColumns() {
		return sortColumns;
	}
	 
	public List<String> getIds() {
		return ids;
	}
	public void setIds(List<String> ids) {
		this.ids = ids;
	}

	@Transient
	private Long rentContractId;

	@Transient
	private String linkPerson;

	@Transient
	private String linkPhone;
	
	
	/*租户ID**/
	@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
	private String tenantId;

	@io.swagger.annotations.ApiModelProperty(value = "点位类型", name = "pointType")
	@Excel(name="类型",width = 20,orderNum = "1",
			replace = {"商铺_null", "固定点位_1", "临时促销点位_2", "宣传点位_3","ATM点位_4","仓库点位_5","其他点位_6"})
	private Integer pointType;
	/*商铺编号**/
	@io.swagger.annotations.ApiModelProperty(value="商铺编号",name="shopNumber")
	@Excel(name="商铺号/多径点位号",width = 20,orderNum = "2")
	private String shopNumber;
	/*建筑面积**/
	@io.swagger.annotations.ApiModelProperty(value="建筑面积",name="buildArea")
	@Excel(name="建筑面积(㎡)",width = 20,orderNum = "5")
	private String buildArea;
	/*经营面积**/
	@io.swagger.annotations.ApiModelProperty(value="经营面积",name="operationArea")
	@Excel(name="计租面积(㎡)",width = 20,orderNum = "6")
	private String operationArea;
	/*楼座号**/
	@io.swagger.annotations.ApiModelProperty(value="楼座号",name="building")
	private Long building;
	/*楼层号**/
	@io.swagger.annotations.ApiModelProperty(value="楼层号",name="floor")
	private Long floor;
	/*状态(0:未出租, 1:已出租)**/
	@io.swagger.annotations.ApiModelProperty(value="状态(0:未出租, 1:已出租)",name="status")
	@Excel(name="租赁状态",width = 20,orderNum = "7",replace = {"未出租_0","已出租_1"})
	private Integer status;
	/*店铺相对位置x**/
	@io.swagger.annotations.ApiModelProperty(value="店铺相对位置x",name="x")
	private BigDecimal x;
	/*店铺相对位置y**/
	@io.swagger.annotations.ApiModelProperty(value="店铺相对位置y",name="y")
	private BigDecimal y;
	/*地址**/
	@io.swagger.annotations.ApiModelProperty(value="地址",name="addr")
	private String addr;
	/*百度poi(省市区县street等)**/
	@io.swagger.annotations.ApiModelProperty(value="百度poi(省市区县street等)",name="baiduPoi")
	private String baiduPoi;
	/*经度- baidu poi**/
	@io.swagger.annotations.ApiModelProperty(value="经度- baidu poi",name="longitude")
	private BigDecimal longitude;
	/*维度-baidu poi**/
	@io.swagger.annotations.ApiModelProperty(value="维度-baidu poi",name="latitude")
	private BigDecimal latitude;
	/*创建时间**/
	@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate")
	private Date createDate;
	/*更新时间**/
	@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate")
	private Date updateDate;

	@io.swagger.annotations.ApiModelProperty(value="图片",name="imgUrl")
	private String imgUrl;

	@io.swagger.annotations.ApiModelProperty(value="管理人",name="manager")
	private String manager;

	@io.swagger.annotations.ApiModelProperty(value="管理人电话",name="managerPhone")
	private String managerPhone;

    @io.swagger.annotations.ApiModelProperty(value = "类型", name = "type")
    private Integer type;



    @io.swagger.annotations.ApiModelProperty(value = "备注", name = "comments")
    private String comments;

	@io.swagger.annotations.ApiModelProperty(value = "是否删除1是0否", name = " ")
	private Integer isDel;

	//开始时间
	@Transient
	private Date startdate;
	//结束时间
	@Transient
	private Date enddate;
	@Transient
	private Integer freeDay;

	public Integer getFreeDay() {
		return freeDay;
	}

	public void setFreeDay(Integer freeDay) {
		this.freeDay = freeDay;
	}

	public Integer getIsDel() {
		return isDel;
	}

	public void setIsDel(Integer isDel) {
		this.isDel = isDel;
	}

	public String  getTenantId() {
		return tenantId;
	}
	public void setTenantId(String _tenantId) {
		tenantId = _tenantId;
	}
	public String  getShopNumber() {
		return shopNumber;
	}
	public void setShopNumber(String _shopNumber) {
		shopNumber = _shopNumber;
	}
	public String  getBuildArea() {
		return buildArea;
	}
	public void setBuildArea(String _buildArea) {
		buildArea = _buildArea;
	}
	public String  getOperationArea() {
		return operationArea;
	}
	public void setOperationArea(String _operationArea) {
		operationArea = _operationArea;
	}
	public Long  getBuilding() {
		return building;
	}
	public void setBuilding(Long _building) {
		building = _building;
	}
	public Long  getFloor() {
		return floor;
	}
	public void setFloor(Long _floor) {
		floor = _floor;
	}
	public Integer  getStatus() {
		return status;
	}
	public void setStatus(Integer _status) {
		status = _status;
	}
	public BigDecimal  getX() {
		return x;
	}
	public void setX(BigDecimal _x) {
		x = _x;
	}
	public BigDecimal  getY() {
		return y;
	}
	public void setY(BigDecimal _y) {
		y = _y;
	}
	public String  getAddr() {
		return addr;
	}
	public void setAddr(String _addr) {
		addr = _addr;
	}
	public String  getBaiduPoi() {
		return baiduPoi;
	}
	public void setBaiduPoi(String _baiduPoi) {
		baiduPoi = _baiduPoi;
	}
	public BigDecimal  getLongitude() {
		return longitude;
	}
	public void setLongitude(BigDecimal _longitude) {
		longitude = _longitude;
	}
	public BigDecimal  getLatitude() {
		return latitude;
	}
	public void setLatitude(BigDecimal _latitude) {
		latitude = _latitude;
	}
	public Date  getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date _createDate) {
		createDate = _createDate;
	}
	public Date  getUpdateDate() {
		return updateDate;
	}
	public void setUpdateDate(Date _updateDate) {
		updateDate = _updateDate;
	}
	public Date getStartdate() {
		return startdate;
	}

	public void setStartdate(Date startdate) {
		this.startdate = startdate;
	}

	public Date getEnddate() {
		return enddate;
	}

	public void setEnddate(Date enddate) {
		this.enddate = enddate;
	}

	public String getImgUrl() {
		return imgUrl;
	}

	public void setImgUrl(String imgUrl) {
		this.imgUrl = imgUrl;
	}

	public Long getRentContractId() {
		return rentContractId;
	}

	public void setRentContractId(Long rentContractId) {
		this.rentContractId = rentContractId;
	}

	public String getLinkPerson() {
		return linkPerson;
	}

	public void setLinkPerson(String linkPerson) {
		this.linkPerson = linkPerson;
	}

	public String getLinkPhone() {
		return linkPhone;
	}

	public void setLinkPhone(String linkPhone) {
		this.linkPhone = linkPhone;
	}

	public String getManager() {
		return manager;
	}

	public void setManager(String manager) {
		this.manager = manager;
	}

	public String getManagerPhone() {
		return managerPhone;
	}

	public void setManagerPhone(String managerPhone) {
		this.managerPhone = managerPhone;
	}

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getPointType() {
        return pointType;
    }

    public void setPointType(Integer pointType) {
        this.pointType = pointType;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

	public static enum Field
	{
		Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
			,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC")
			,ShopNumber_ASC("`shopNumber` ASC"),ShopNumber_DESC("`shopNumber` DESC")
			,BuildArea_ASC("`buildArea` ASC"),BuildArea_DESC("`buildArea` DESC")
			,OperationArea_ASC("`operationArea` ASC"),OperationArea_DESC("`operationArea` DESC")
			,Building_ASC("`building` ASC"),Building_DESC("`building` DESC")
			,Floor_ASC("`floor` ASC"),Floor_DESC("`floor` DESC")
			,Status_ASC("`status` ASC"),Status_DESC("`status` DESC")
			,X_ASC("`x` ASC"),X_DESC("`x` DESC")
			,Y_ASC("`y` ASC"),Y_DESC("`y` DESC")
			,Addr_ASC("`addr` ASC"),Addr_DESC("`addr` DESC")
			,BaiduPoi_ASC("`baiduPoi` ASC"),BaiduPoi_DESC("`baiduPoi` DESC")
			,Longitude_ASC("`longitude` ASC"),Longitude_DESC("`longitude` DESC")
			,Latitude_ASC("`latitude` ASC"),Latitude_DESC("`latitude` DESC")
			,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC")
			,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC")
	;
		private String value;
		Field(String value){
			this.value = value;
		}
		public String getValue() {
			return value;
		}
		public void setCol(String value) {
			this.value = value;
		}
		@Override
		public String toString() {
			return this.getValue();
		}
	}
	
	public void setSortColumns(WxShop.Field... fields)
	{
		if (fields == null || fields.length == 0) {
			return;
		}
		for (int k = 0; k < fields.length; k++) {
			if (fields[k] == null) {
				return;
			}
		}
		StringBuilder sb = new StringBuilder(fields[0].toString());
		for (int k = 1; k < fields.length; k++) {
			sb.append(",");
			sb.append(fields[k].toString());
		}
		 this.sortColumns=sb.toString();
	}
	
	public void setSortColumns(String sortColumns)
	{
		if (sortColumns == null || "".equals(sortColumns.trim())) {
			return;
		}
		if (sortColumns.contains(",")) {
			String[] cols = sortColumns.split(",");
			java.util.List<Field> fList = new java.util.ArrayList();
			for (int k = 0; k < cols.length; k++) {
				fList.add(Field.valueOf(cols[k]));
			}
			this.setSortColumns(fList.toArray(new Field[fList.size()]));
		} else {
			this.setSortColumns(Field.valueOf(sortColumns));
		}
	}
}
