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_callback")
public class WxMsgCallback 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="回调ID",name="callbackId")
	private Long callbackId;

	/*租户id**/
	@io.swagger.annotations.ApiModelProperty(value="租户id",name="tenantId")
	private String tenantId;
	/*批次号**/
	@io.swagger.annotations.ApiModelProperty(value="批次号",name="batchNo")
	private String batchNo;
	/*手机号**/
	@io.swagger.annotations.ApiModelProperty(value="手机号",name="phone")
	private String phone;
	/*发送时间**/
	@io.swagger.annotations.ApiModelProperty(value="发送时间",name="begintime")
	private Integer begintime;
	/*结束时间**/
	@io.swagger.annotations.ApiModelProperty(value="结束时间",name="endtime")
	private Integer endtime;
	/*发送状态**/
	@io.swagger.annotations.ApiModelProperty(value="发送状态",name="status")
	private Integer status;
	/*发送状态信息**/
	@io.swagger.annotations.ApiModelProperty(value="发送状态信息",name="statusMsg")
	private String statusMsg;
	/*签名**/
	@io.swagger.annotations.ApiModelProperty(value="签名",name="sign")
	private String sign;
	/*创建时间**/
	@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createtime")
	private Date createtime;

	/*更新时间**/
	@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime")
	private Date updatetime;

	/*msgId**/
	@io.swagger.annotations.ApiModelProperty(value="msgId",name="msgId")
	private Long msgId;

	public Long getCallbackId() {
		return callbackId;
	}

	public void setCallbackId(Long callbackId) {
		this.callbackId = callbackId;
	}

	public String  getTenantId() {
		return tenantId;
	}
	public void setTenantId(String _tenantId) {
		tenantId = _tenantId;
	}
	public String  getBatchNo() {
		return batchNo;
	}
	public void setBatchNo(String _batchNo) {
		batchNo = _batchNo;
	}
	public String  getPhone() {
		return phone;
	}
	public void setPhone(String _phone) {
		phone = _phone;
	}
	public Integer  getBegintime() {
		return begintime;
	}
	public void setBegintime(Integer _begintime) {
		begintime = _begintime;
	}
	public Integer  getEndtime() {
		return endtime;
	}
	public void setEndtime(Integer _endtime) {
		endtime = _endtime;
	}
	public Integer  getStatus() {
		return status;
	}
	public void setStatus(Integer _status) {
		status = _status;
	}
	public String  getStatusMsg() {
		return statusMsg;
	}
	public void setStatusMsg(String _statusMsg) {
		statusMsg = _statusMsg;
	}
	public String  getSign() {
		return sign;
	}
	public void setSign(String _sign) {
		sign = _sign;
	}
	public Date  getCreatetime() {
		return createtime;
	}
	public void setCreatetime(Date _createtime) {
		createtime = _createtime;
	}


	public Date getUpdatetime() {
		return updatetime;
	}

	public void setUpdatetime(Date updatetime) {
		this.updatetime = updatetime;
	}

	public Long getMsgId() {
		return msgId;
	}

	public void setMsgId(Long msgId) {
		this.msgId = msgId;
	}

	public static enum Field
	{
		Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
			,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC")
			,BatchNo_ASC("`batch_no` ASC"),BatchNo_DESC("`batch_no` DESC")
			,Phone_ASC("`phone` ASC"),Phone_DESC("`phone` DESC")
			,Begintime_ASC("`begintime` ASC"),Begintime_DESC("`begintime` DESC")
			,Endtime_ASC("`endtime` ASC"),Endtime_DESC("`endtime` DESC")
			,Status_ASC("`status` ASC"),Status_DESC("`status` DESC")
			,StatusMsg_ASC("`status_msg` ASC"),StatusMsg_DESC("`status_msg` DESC")
			,Sign_ASC("`sign` ASC"),Sign_DESC("`sign` DESC")
			,Createtime_ASC("`createtime` ASC"),Createtime_DESC("`createtime` 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(WxMsgCallback.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));
		}
	}
}
