package com.iformall.domain.po;

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

@Table(name = "wx_msg_validationcode")
public class WxMsgValidationcode 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;
	}
	
	
	
	/***/
	@io.swagger.annotations.ApiModelProperty(value="",name="phone")
	private String phone;
	/***/
	@io.swagger.annotations.ApiModelProperty(value="",name="expiretime")
	private Date expiretime;
	/***/
	@io.swagger.annotations.ApiModelProperty(value="",name="createtime")
	private Date createtime;
	/*场景 1 登录 2买券 3停车 4审批流通知**/
	@io.swagger.annotations.ApiModelProperty(value="场景 1 登录 2买券 3停车 4审批流通知",name="type")
	private Integer type;
	/***/
	@io.swagger.annotations.ApiModelProperty(value="",name="tenantId")
	private String tenantId;
	/*内容**/
	@io.swagger.annotations.ApiModelProperty(value="内容",name="msg")
	private String msg;
	/*签名**/
	@io.swagger.annotations.ApiModelProperty(value="签名",name="signature")
	private String signature;
	/***/
	@io.swagger.annotations.ApiModelProperty(value="",name="code")
	private String code;

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

	public String  getPhone() {
		return phone;
	}
	public void setPhone(String _phone) {
		phone = _phone;
	}
	public Date  getExpiretime() {
		return expiretime;
	}
	public void setExpiretime(Date _expiretime) {
		expiretime = _expiretime;
	}
	public Date  getCreatetime() {
		return createtime;
	}
	public void setCreatetime(Date _createtime) {
		createtime = _createtime;
	}
	public Integer  getType() {
		return type;
	}
	public void setType(Integer _type) {
		type = _type;
	}
	public String  getTenantId() {
		return tenantId;
	}
	public void setTenantId(String _tenantId) {
		tenantId = _tenantId;
	}
	public String  getMsg() {
		return msg;
	}
	public void setMsg(String _msg) {
		msg = _msg;
	}
	public String  getSignature() {
		return signature;
	}
	public void setSignature(String _signature) {
		signature = _signature;
	}
	public String  getCode() {
		return code;
	}
	public void setCode(String _code) {
		code = _code;
	}

	public String getAppid() {
		return appid;
	}

	public void setAppid(String appid) {
		this.appid = appid;
	}

	public static enum Field
	{
		Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
			,Phone_ASC("`phone` ASC"),Phone_DESC("`phone` DESC")
			,Expiretime_ASC("`expiretime` ASC"),Expiretime_DESC("`expiretime` DESC")
			,Createtime_ASC("`createtime` ASC"),Createtime_DESC("`createtime` DESC")
			,Type_ASC("`type` ASC"),Type_DESC("`type` DESC")
			,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC")
			,Msg_ASC("`msg` ASC"),Msg_DESC("`msg` DESC")
			,Signature_ASC("`signature` ASC"),Signature_DESC("`signature` DESC")
			,Code_ASC("`code` ASC"),Code_DESC("`code` 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(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(",");
			List<Field> fList = new 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));
		}
	}
}
