package com.iformall.domain.po;

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_wiwide_info")
public class WxWiWideInfo implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
    protected Long id;

    @Transient
    protected List<Long> 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<Long> getIds() {
		return ids;
	}

	public void setIds(List<Long> ids) {
		this.ids = ids;
	}

	/**租户ID**/
	@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
	private String tenantId;
	/**迈外迪id**/
	@io.swagger.annotations.ApiModelProperty(value="迈外迪id",name="wiwideId")
	private String wiwideId;

	@io.swagger.annotations.ApiModelProperty(value="迈外迪key",name="wiwideKey")
	private String wiwideKey;

	@io.swagger.annotations.ApiModelProperty(value="迈外迪url",name="wiwideUrl")
	private String wiwideUrl;

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

	@io.swagger.annotations.ApiModelProperty(value="expiredTime",name="expiredTime")
	private Date expiredTime;

	/*卖外迪信息类型列表,1,支持客流 2,支持wifi*/
	@io.swagger.annotations.ApiModelProperty(value="capability",name="capability")
	private String capability;

	public String  getTenantId() {
		return tenantId;
	}
	public void setTenantId(String _tenantId) {
		tenantId = _tenantId;
	}
	public String  getWiwideId() {
		return wiwideId;
	}
	public void setWiwideId(String _wiwideId) {
		wiwideId = _wiwideId;
	}

	public String getWiwideKey() {
		return wiwideKey;
	}

	public void setWiwideKey(String wiwideKey) {
		this.wiwideKey = wiwideKey;
	}

	public String getWiwideUrl() {
		return wiwideUrl;
	}

	public void setWiwideUrl(String wiwideUrl) {
		this.wiwideUrl = wiwideUrl;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public Date getExpiredTime() {
		return expiredTime;
	}

	public void setExpiredTime(Date expiredTime) {
		this.expiredTime = expiredTime;
	}

	public String getCapability() {
		return capability;
	}

	public void setCapability(String capability) {
		this.capability = capability;
	}

	public static enum Field
	{
		Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
			,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC")
			,WiwideId_ASC("`wiwide_id` ASC"),WiwideId_DESC("`wiwide_id` 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(WxWiWideInfo.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(",");
			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));
		}
	}
}
