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_refund_order")
public class WxRefundOrder 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;
	}
	
	
	
	/*租户ID**/
	@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
	private String tenantId;
	/*创建时间**/
	@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createTime")
	private Date createTime;
	/*更新时间**/
	@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateTime")
	private Date updateTime;
	/*微信生成的订单号**/
	@io.swagger.annotations.ApiModelProperty(value="微信生成的订单号",name="transactionId")
	private String transactionId;
	/*订单ID-out_trade_no**/
	@io.swagger.annotations.ApiModelProperty(value="订单ID-out_trade_no",name="orderId")
	private Long orderId;
	/*支付订单号**/
	@io.swagger.annotations.ApiModelProperty(value="支付订单号",name="payOrderNo")
	private String payOrderNo;
	/*用户ID**/
	@io.swagger.annotations.ApiModelProperty(value="用户ID",name="cUserId")
	private Long cUserId;
	/*订单总金额(分)**/
	@io.swagger.annotations.ApiModelProperty(value="订单总金额(分)",name="totalFee")
	private Integer totalFee;
	/*退款总金额**/
	@io.swagger.annotations.ApiModelProperty(value="退款总金额",name="refundFee")
	private Integer refundFee;
	/*退款发起时间(秒)**/
	@io.swagger.annotations.ApiModelProperty(value="退款发起时间(秒)",name="refundTimeStart")
	private Date refundTimeStart;
	/*退款结束时间(秒)**/
	@io.swagger.annotations.ApiModelProperty(value="退款结束时间(秒)",name="refundTimeEnd")
	private Date refundTimeEnd;
	/*支付渠道: 0-微信 1-支付宝 2-银联 **/
	@io.swagger.annotations.ApiModelProperty(value="支付渠道: 0-微信 1-支付宝 2-银联 ",name="refundVendor")
	private Integer refundVendor;
	/*支付状态: 0-退款中;1-退款成功;2-退款失败**/
	@io.swagger.annotations.ApiModelProperty(value="支付状态: 0-退款中;1-退款成功;2-退款失败",name="refundOrderStatus")
	private Integer refundOrderStatus;
	/*微信退款单号**/
	@io.swagger.annotations.ApiModelProperty(value="微信退款单号",name="refundId")
	private String refundId;
	/*支付失败原因**/
	@io.swagger.annotations.ApiModelProperty(value="支付失败原因",name="failReason")
	private String failReason;
	public String  getTenantId() {
		return tenantId;
	}
	public void setTenantId(String _tenantId) {
		tenantId = _tenantId;
	}
	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  getTransactionId() {
		return transactionId;
	}
	public void setTransactionId(String _transactionId) {
		transactionId = _transactionId;
	}
	public Long  getOrderId() {
		return orderId;
	}
	public void setOrderId(Long _orderId) {
		orderId = _orderId;
	}
	public String  getPayOrderNo() {
		return payOrderNo;
	}
	public void setPayOrderNo(String _payOrderNo) {
		payOrderNo = _payOrderNo;
	}
	public Long  getCUserId() {
		return cUserId;
	}
	public void setCUserId(Long _cUserId) {
		cUserId = _cUserId;
	}
	public Integer  getTotalFee() {
		return totalFee;
	}
	public void setTotalFee(Integer _totalFee) {
		totalFee = _totalFee;
	}
	public Integer  getRefundFee() {
		return refundFee;
	}
	public void setRefundFee(Integer _refundFee) {
		refundFee = _refundFee;
	}
	public Date  getRefundTimeStart() {
		return refundTimeStart;
	}
	public void setRefundTimeStart(Date _refundTimeStart) {
		refundTimeStart = _refundTimeStart;
	}
	public Date  getRefundTimeEnd() {
		return refundTimeEnd;
	}
	public void setRefundTimeEnd(Date _refundTimeEnd) {
		refundTimeEnd = _refundTimeEnd;
	}
	public Integer  getRefundVendor() {
		return refundVendor;
	}
	public void setRefundVendor(Integer _refundVendor) {
		refundVendor = _refundVendor;
	}
	public Integer  getRefundOrderStatus() {
		return refundOrderStatus;
	}
	public void setRefundOrderStatus(Integer _refundOrderStatus) {
		refundOrderStatus = _refundOrderStatus;
	}
	public String  getRefundId() {
		return refundId;
	}
	public void setRefundId(String _refundId) {
		refundId = _refundId;
	}
	public String  getFailReason() {
		return failReason;
	}
	public void setFailReason(String _failReason) {
		failReason = _failReason;
	}



	public static enum Field
	{
		Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
			,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC")
			,CreateTime_ASC("`createTime` ASC"),CreateTime_DESC("`createTime` DESC")
			,UpdateTime_ASC("`updateTime` ASC"),UpdateTime_DESC("`updateTime` DESC")
			,TransactionId_ASC("`transactionId` ASC"),TransactionId_DESC("`transactionId` DESC")
			,OrderId_ASC("`orderId` ASC"),OrderId_DESC("`orderId` DESC")
			,PayOrderNo_ASC("`payOrderNo` ASC"),PayOrderNo_DESC("`payOrderNo` DESC")
			,CUserId_ASC("`cUserId` ASC"),CUserId_DESC("`cUserId` DESC")
			,TotalFee_ASC("`totalFee` ASC"),TotalFee_DESC("`totalFee` DESC")
			,RefundFee_ASC("`refundFee` ASC"),RefundFee_DESC("`refundFee` DESC")
			,RefundTimeStart_ASC("`refundTimeStart` ASC"),RefundTimeStart_DESC("`refundTimeStart` DESC")
			,RefundTimeEnd_ASC("`refundTimeEnd` ASC"),RefundTimeEnd_DESC("`refundTimeEnd` DESC")
			,RefundVendor_ASC("`refundVendor` ASC"),RefundVendor_DESC("`refundVendor` DESC")
			,RefundOrderStatus_ASC("`refundOrderStatus` ASC"),RefundOrderStatus_DESC("`refundOrderStatus` DESC")
			,RefundId_ASC("`refundId` ASC"),RefundId_DESC("`refundId` DESC")
			,FailReason_ASC("`failReason` ASC"),FailReason_DESC("`failReason` 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(WxRefundOrder.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));
		}
	}
}
