package com.iformall.domain.po;

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

@Table(name = "wx_msg_model")
public class WxMsgModel 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;
	}
	
	
	
	/*租户ID**/
	@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
	private String tenantId;
	/*名称**/
	@io.swagger.annotations.ApiModelProperty(value="名称",name="name")
	private String name;
	/*签名**/
	@io.swagger.annotations.ApiModelProperty(value="签名",name="signature")
	private String signature;
	/***/
	@io.swagger.annotations.ApiModelProperty(value="",name="content")
	private String content;
	/***/
	@io.swagger.annotations.ApiModelProperty(value="",name="createtime")
	private Date createtime;
	/*审核状态 0未通过 1 通过 2审核中**/
	@io.swagger.annotations.ApiModelProperty(value="审核状态 0未通过 1 通过 2审核中",name="status")
	private Integer status;

	@io.swagger.annotations.ApiModelProperty(value="modelid",name="modelId")
	private Integer modelId;


	public String  getTenantId() {
		return tenantId;
	}
	public void setTenantId(String _tenantId) {
		tenantId = _tenantId;
	}
	public String  getName() {
		return name;
	}
	public void setName(String _name) {
		name = _name;
	}
	public String  getSignature() {
		return signature;
	}
	public void setSignature(String _signature) {
		signature = _signature;
	}
	public String  getContent() {
		return content;
	}
	public void setContent(String _content) {
		content = _content;
	}
	public Date  getCreatetime() {
		return createtime;
	}
	public void setCreatetime(Date _createtime) {
		createtime = _createtime;
	}
	public Integer  getStatus() {
		return status;
	}
	public void setStatus(Integer _status) {
		status = _status;
	}

	public Integer getModelId() {
		return modelId;
	}

	public void setModelId(Integer modelId) {
		this.modelId = modelId;
	}

	public static enum Field
	{
		Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
			,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC")
			,Name_ASC("`name` ASC"),Name_DESC("`name` DESC")
			,Signature_ASC("`signature` ASC"),Signature_DESC("`signature` DESC")
			,Content_ASC("`content` ASC"),Content_DESC("`content` DESC")
			,Createtime_ASC("`createtime` ASC"),Createtime_DESC("`createtime` DESC")
			,Status_ASC("`status` ASC"),Status_DESC("`status` DESC")
		,ModelId_ASC("`model_id` ASC"),ModelId_DESC("`model_id` 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(WxMsgModel.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());
		}

		this.sortColumns = sb.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));
		}
	}
}
