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_user_visit")
public class WxUserVisit 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;
	/*日期字符串**/
	@io.swagger.annotations.ApiModelProperty(value="日期字符串",name="refDate")
	private String refDate;
	/*日期**/
	@io.swagger.annotations.ApiModelProperty(value="日期",name="dayDate")
	private Date dayDate;
	/*打开次数**/
	@io.swagger.annotations.ApiModelProperty(value="打开次数",name="sessionCnt")
	private Integer sessionCnt;
	/*访问次数**/
	@io.swagger.annotations.ApiModelProperty(value="访问次数",name="visitPv")
	private Integer visitPv;
	/*访问人数**/
	@io.swagger.annotations.ApiModelProperty(value="访问人数",name="visitUv")
	private Integer visitUv;
	/*新用户数**/
	@io.swagger.annotations.ApiModelProperty(value="新用户数",name="visitUvNew")
	private Integer visitUvNew;
	/*人均停留时长 (浮点型，单位：秒)**/
	@io.swagger.annotations.ApiModelProperty(value="人均停留时长 (浮点型，单位：秒)",name="stayTimeUv")
	private String stayTimeUv;
	/*次均停留时长 (浮点型，单位：秒)**/
	@io.swagger.annotations.ApiModelProperty(value="次均停留时长 (浮点型，单位：秒)",name="stayTimeSession")
	private String stayTimeSession;
	/*平均访问深度 (浮点型)**/
	@io.swagger.annotations.ApiModelProperty(value="平均访问深度 (浮点型)",name="visitDepth")
	private String visitDepth;
	/*appId**/
	@io.swagger.annotations.ApiModelProperty(value="appId",name="appId")
	private String appId;
	/*创建时间**/
	@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate")
	private Date createDate;
	public String  getTenantId() {
		return tenantId;
	}
	public void setTenantId(String _tenantId) {
		tenantId = _tenantId;
	}
	public String  getRefDate() {
		return refDate;
	}
	public void setRefDate(String _refDate) {
		refDate = _refDate;
	}
	public Date  getDayDate() {
		return dayDate;
	}
	public void setDayDate(Date _dayDate) {
		dayDate = _dayDate;
	}
	public Integer  getSessionCnt() {
		return sessionCnt;
	}
	public void setSessionCnt(Integer _sessionCnt) {
		sessionCnt = _sessionCnt;
	}
	public Integer  getVisitPv() {
		return visitPv;
	}
	public void setVisitPv(Integer _visitPv) {
		visitPv = _visitPv;
	}
	public Integer  getVisitUv() {
		return visitUv;
	}
	public void setVisitUv(Integer _visitUv) {
		visitUv = _visitUv;
	}
	public Integer  getVisitUvNew() {
		return visitUvNew;
	}
	public void setVisitUvNew(Integer _visitUvNew) {
		visitUvNew = _visitUvNew;
	}
	public String  getStayTimeUv() {
		return stayTimeUv;
	}
	public void setStayTimeUv(String _stayTimeUv) {
		stayTimeUv = _stayTimeUv;
	}
	public String  getStayTimeSession() {
		return stayTimeSession;
	}
	public void setStayTimeSession(String _stayTimeSession) {
		stayTimeSession = _stayTimeSession;
	}
	public String  getVisitDepth() {
		return visitDepth;
	}
	public void setVisitDepth(String _visitDepth) {
		visitDepth = _visitDepth;
	}
	public String  getAppId() {
		return appId;
	}
	public void setAppId(String _appId) {
		appId = _appId;
	}
	public Date  getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date _createDate) {
		createDate = _createDate;
	}



	public static enum Field
	{
		Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
			,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC")
			,RefDate_ASC("`refDate` ASC"),RefDate_DESC("`refDate` DESC")
			,DayDate_ASC("`dayDate` ASC"),DayDate_DESC("`dayDate` DESC")
			,SessionCnt_ASC("`sessionCnt` ASC"),SessionCnt_DESC("`sessionCnt` DESC")
			,VisitPv_ASC("`visitPv` ASC"),VisitPv_DESC("`visitPv` DESC")
			,VisitUv_ASC("`visitUv` ASC"),VisitUv_DESC("`visitUv` DESC")
			,VisitUvNew_ASC("`visitUvNew` ASC"),VisitUvNew_DESC("`visitUvNew` DESC")
			,StayTimeUv_ASC("`stayTimeUv` ASC"),StayTimeUv_DESC("`stayTimeUv` DESC")
			,StayTimeSession_ASC("`stayTimeSession` ASC"),StayTimeSession_DESC("`stayTimeSession` DESC")
			,VisitDepth_ASC("`visitDepth` ASC"),VisitDepth_DESC("`visitDepth` DESC")
			,AppId_ASC("`appId` ASC"),AppId_DESC("`appId` DESC")
			,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` 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(WxUserVisit.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));
		}
	}
}
