package com.iformall.domain.po;

import javax.persistence.*;
import java.util.*;
import javax.persistence.Transient;
import java.util.List;
import javax.persistence.Id;
import java.io.Serializable;

@Table(name = "wx_car_cmd_log")
public class WxCarCmdLog 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;
	}
	
	
	
	/***/
	@io.swagger.annotations.ApiModelProperty(value="",name="tenantId")
	private String tenantId;
	/*停车厂家，1. ETCP，2.停简单**/
	@io.swagger.annotations.ApiModelProperty(value="停车厂家，1. ETCP，2.停简单",name="vendorType")
	private Integer vendorType;
	/*停车厂家命令**/
	@io.swagger.annotations.ApiModelProperty(value="停车厂家命令",name="cmdType")
	private Integer cmdType;
	/*创建时间**/
	@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="cmdJson")
	private String cmdJson;
	public String  getTenantId() {
		return tenantId;
	}
	public void setTenantId(String _tenantId) {
		tenantId = _tenantId;
	}
	public Integer  getVendorType() {
		return vendorType;
	}
	public void setVendorType(Integer _vendorType) {
		vendorType = _vendorType;
	}
	public Integer  getCmdType() {
		return cmdType;
	}
	public void setCmdType(Integer _cmdType) {
		cmdType = _cmdType;
	}
	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 String  getCmdJson() {
		return cmdJson;
	}
	public void setCmdJson(String _cmdJson) {
		cmdJson = _cmdJson;
	}



	public static enum Field
	{
		Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
			,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC")
			,VendorType_ASC("`vendorType` ASC"),VendorType_DESC("`vendorType` DESC")
			,CmdType_ASC("`cmdType` ASC"),CmdType_DESC("`cmdType` DESC")
			,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC")
			,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC")
			,CmdJson_ASC("`cmdJson` ASC"),CmdJson_DESC("`cmdJson` 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(WxCarCmdLog.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());
		}
		 
	}
	
	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));
		}
	}
}
