package com.iformall.domain.vo;

import com.iformall.domain.po.WxOrder;

import java.util.List;

public class WxOrderPayVo extends WxOrder {

	/**发券商户信息*/
	/**商户名**/
	@io.swagger.annotations.ApiModelProperty(value="商户名",name="merchantName")
	private String merchantName;
	/**b端用户姓名**/
	@io.swagger.annotations.ApiModelProperty(value="b端用户姓名",name="bUserName")
	private String bUserName;
	/**b端用户手机号**/
	@io.swagger.annotations.ApiModelProperty(value="b端用户手机号",name="bUserPhone")
	private String bUserPhone;

	/**c用户绑定的手机号**/
	@io.swagger.annotations.ApiModelProperty(value="用户绑定的手机号",name="cUserPhone")
	private String cUserPhone;

	/**c用户昵称**/
	@io.swagger.annotations.ApiModelProperty(value="c用户昵称",name="nickName")
	private String nickName;

	/**c用户名**/
	@io.swagger.annotations.ApiModelProperty(value="c用户名",name="cUserName")
	private String cUserName;

	public String getMerchantName() {
		return merchantName;
	}

	public void setMerchantName(String merchantName) {
		this.merchantName = merchantName;
	}

	public String getbUserName() {
		return bUserName;
	}

	public void setbUserName(String bUserName) {
		this.bUserName = bUserName;
	}

	public String getbUserPhone() {
		return bUserPhone;
	}

	public void setbUserPhone(String bUserPhone) {
		this.bUserPhone = bUserPhone;
	}

	public String getcUserPhone() {
		return cUserPhone;
	}

	public void setcUserPhone(String cUserPhone) {
		this.cUserPhone = cUserPhone;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	@Override
	public String getcUserName() {
		return cUserName;
	}

	@Override
	public void setcUserName(String cUserName) {
		this.cUserName = cUserName;
	}

	public static enum Field
	{
		Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
		,OrderNumber_ASC("`order_number` ASC"),OrderNumber_DESC("`order_number` DESC")
		,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC")
		,CUserId_ASC("`c_user_id` ASC"),CUserId_DESC("`c_user_id` DESC")
		,CouponId_ASC("`product_id` ASC"),CouponId_DESC("`product_id` DESC")
		,PaymentType_ASC("`payment_type` ASC"),PaymentType_DESC("`payment_type` DESC")
		,Payment_ASC("`payment` ASC"),Payment_DESC("`payment` DESC")
		,PaymentTime_ASC("`payment_time` ASC"),PaymentTime_DESC("`payment_time` DESC")
		,OrderStatus_ASC("`order_status` ASC"),OrderStatus_DESC("`order_status` DESC")
		,CreateDate_ASC("`create_date` ASC"),CreateDate_DESC("`create_date` DESC")
		,UpdateDate_ASC("`update_date` ASC"),UpdateDate_DESC("`update_date` DESC")
		,Detail_ASC("`detail` ASC"),Detail_DESC("`detail` 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(WxOrder.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(",");
			List<WxOrder.Field> fList = new java.util.ArrayList();
			for (int k = 0; k < cols.length; k++) {
				fList.add(WxOrder.Field.valueOf(cols[k]));
			}
			this.setSortColumns(fList.toArray(new WxOrder.Field[fList.size()]));
		} else {
			this.setSortColumns(WxOrder.Field.valueOf(sortColumns));
		}
	}

}
