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_c_user_from_b")
public class WxCUserFromB 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;
	/*商户ID**/
	@io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId")
	private Long merchantId;
	/*b_user_id**/
	@io.swagger.annotations.ApiModelProperty(value="b_user_id",name="bUserId")
	private Long bUserId;
	/*c_user_id**/
	@io.swagger.annotations.ApiModelProperty(value="c_user_id",name="cUserId")
	private Long cUserId;
	/*会员信息**/
	@io.swagger.annotations.ApiModelProperty(value="会员信息",name="info")
	private String info;
	/***/
	@io.swagger.annotations.ApiModelProperty(value="",name="createTime")
	private Date createTime;
	/***/
	@io.swagger.annotations.ApiModelProperty(value="",name="updateTime")
	private Date updateTime;
	/*openid**/
	@io.swagger.annotations.ApiModelProperty(value="openid",name="openid")
	private String openid;
	/***/
	@io.swagger.annotations.ApiModelProperty(value="",name="appId")
	private String appId;

	public String getAppId() {
		return appId;
	}

	public void setAppId(String appId) {
		this.appId = appId;
	}

	public String  getTenantId() {
		return tenantId;
	}
	public void setTenantId(String _tenantId) {
		tenantId = _tenantId;
	}
	public Long  getMerchantId() {
		return merchantId;
	}
	public void setMerchantId(Long _merchantId) {
		merchantId = _merchantId;
	}

	public Long getbUserId() {
		return bUserId;
	}

	public void setbUserId(Long bUserId) {
		this.bUserId = bUserId;
	}

	public Long getcUserId() {
		return cUserId;
	}

	public void setcUserId(Long cUserId) {
		this.cUserId = cUserId;
	}

	public String  getInfo() {
		return info;
	}
	public void setInfo(String _info) {
		info = _info;
	}
	public Date  getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date _createTime) {
		createTime = _createTime;
	}
	public Date  getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Date _updateTime) {
		updateTime = _updateTime;
	}
	public String  getOpenid() {
		return openid;
	}
	public void setOpenid(String _openid) {
		openid = _openid;
	}



	public static enum Field
	{
		Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
			,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC")
			,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC")
			,BUserId_ASC("`bUserId` ASC"),BUserId_DESC("`bUserId` DESC")
			,CUserId_ASC("`cUserId` ASC"),CUserId_DESC("`cUserId` DESC")
			,Info_ASC("`info` ASC"),Info_DESC("`info` DESC")
			,CreateTime_ASC("`createTime` ASC"),CreateTime_DESC("`createTime` DESC")
			,UpdateTime_ASC("`updateTime` ASC"),UpdateTime_DESC("`updateTime` DESC")
			,Openid_ASC("`openid` ASC"),Openid_DESC("`openid` 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));
		}
	}
}
