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_park")
public class WxPark 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;
	/**停车场图片**/
	@io.swagger.annotations.ApiModelProperty(value="停车场图片",name="imgUrl")
	private String imgUrl;
	/**停车场地址**/
	@io.swagger.annotations.ApiModelProperty(value="停车场地址",name="addr")
	private String addr;
	/**车位数**/
	@io.swagger.annotations.ApiModelProperty(value="车位数",name="number")
	private Integer number;
	/**出入口数量**/
	@io.swagger.annotations.ApiModelProperty(value="出入口数量",name="entryExit")
	private Integer entryExit;
	/**停车费**/
	@io.swagger.annotations.ApiModelProperty(value="停车费",name="stopFee")
	private String stopFee;
	/**创建时间**/
	@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate")
	private Date createDate;
	/**更新时间**/
	@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate")
	private Date updateDate;
	/**第三方停车场ID(密文)**/
	@io.swagger.annotations.ApiModelProperty(value="第三方停车场ID(密文)",name="parkId")
	private String parkId;
	/**第三方停车场ID(明文)**/
	@io.swagger.annotations.ApiModelProperty(value="第三方停车场ID(明文)",name="parkingId")
	private String parkingId;
	/**厂商类型(1:ETCP,2:停简单)**/
	@io.swagger.annotations.ApiModelProperty(value="厂商类型(1:ETCP,2:停简单)",name="vendorType")
	private Integer vendorType;
	/**厂商参数etcp{"url":"http://mapi.test.etcp.cn","appId":"FMLK","merchantNo":"C7AEAF80BA8C44ADB42F3DB3CBC7D18A","merchantKey":"C292FFC7DCFB46AFB02792CD43F6DCC7","version": "1.0.0","parkId":"Wj7YdvqyiYM="},TJD{"url":"http://prep.tingjiandan.com/openapi/gateway","partner":"7dbc8ec9037d403b822cb60addfdc681","key":"f356cb1bf5a74fb7a564e86128d2c49f","version":"1.0"}**/
	@io.swagger.annotations.ApiModelProperty(value="厂商参数etcp{\"url\":\"http://mapi.test.etcp.cn\",\"appId\":\"FMLK\",\"merchantNo\":\"C7AEAF80BA8C44ADB42F3DB3CBC7D18A\",\"merchantKey\":\"C292FFC7DCFB46AFB02792CD43F6DCC7\",\"version\": \"1.0.0\",\"parkId\":\"Wj7YdvqyiYM=\"},TJD{\"url\":\"http://prep.tingjiandan.com/openapi/gateway\",\"partner\":\"7dbc8ec9037d403b822cb60addfdc681\",\"key\":\"f356cb1bf5a74fb7a564e86128d2c49f\",\"version\":\"1.0\"}",name="vendorParams")
	private String vendorParams;
	public String  getTenantId() {
		return tenantId;
	}
	public void setTenantId(String _tenantId) {
		tenantId = _tenantId;
	}

	public String getImgUrl() {
		return imgUrl;
	}

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

	public String  getAddr() {
		return addr;
	}
	public void setAddr(String _addr) {
		addr = _addr;
	}
	public Integer  getNumber() {
		return number;
	}
	public void setNumber(Integer _number) {
		number = _number;
	}
	public Integer  getEntryExit() {
		return entryExit;
	}
	public void setEntryExit(Integer _entryExit) {
		entryExit = _entryExit;
	}

	public String getStopFee() {
		return stopFee;
	}

	public void setStopFee(String _stopFee) {
		this.stopFee = _stopFee;
	}

	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  getParkId() {
		return parkId;
	}
	public void setParkId(String _parkId) {
		parkId = _parkId;
	}

	public String getParkingId() {
		return parkingId;
	}

	public void setParkingId(String parkingId) {
		this.parkingId = parkingId;
	}

	public Integer  getVendorType() {
		return vendorType;
	}
	public void setVendorType(Integer _vendorType) {
		vendorType = _vendorType;
	}
	public String  getVendorParams() {
		return vendorParams;
	}
	public void setVendorParams(String _vendorParams) {
		vendorParams = _vendorParams;
	}

	public static enum Field
	{
		Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
			,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC")
			,ImgUrl_ASC("`img_url` ASC"),ImgUrl_DESC("`img_url` DESC")
			,Addr_ASC("`addr` ASC"),Addr_DESC("`addr` DESC")
			,Number_ASC("`number` ASC"),Number_DESC("`number` DESC")
			,EntryExit_ASC("`entry_exit` ASC"),EntryExit_DESC("`entry_exit` DESC")
			,StopFee_ASC("`stop_fee` ASC"),StopFee_DESC("`stop_fee` DESC")
			,CreateDate_ASC("`create_date` ASC"),CreateDate_DESC("`create_date` DESC")
			,UpdateDate_ASC("`update_date` ASC"),UpdateDate_DESC("`update_date` DESC")
			,ParkId_ASC("`park_id` ASC"),ParkId_DESC("`park_id` DESC")
			,ParkingId_ASC("`parking_id` ASC"),ParkingId_DESC("`parking_id` DESC")
			,VendorType_ASC("`vendor_type` ASC"),VendorType_DESC("`vendor_type` DESC")
			,VendorParams_ASC("`vendor_params` ASC"),VendorParams_DESC("`vendor_params` 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(WxPark.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));
		}
	}
}
