package com.iformall.domain.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.iformall.domain.po.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;


import java.util.Date;

@TableName(value = "wx_merchant_trade_daily")
@Data
@EqualsAndHashCode(callSuper = true)
public class WxMerchantTradeDaily extends BaseEntity {
    private static final long serialVersionUID = 1L;

    protected Long id;

    @io.swagger.annotations.ApiModelProperty(value = "租户ID", name = "tenantId")
    private String tenantId;
    @io.swagger.annotations.ApiModelProperty(value = "商户id", name = "merchantId")
    private Long merchantId;

    public Long getbUserId() {
        return bUserId;
    }

    public void setbUserId(Long bUserId) {
        this.bUserId = bUserId;
    }

    public Long getBUserId() {
        return bUserId;
    }

    public void setBUserId(Long bUserId) {
        this.bUserId = bUserId;
    }

    @io.swagger.annotations.ApiModelProperty(value = "b用户id", name = "bUserId")
    private Long bUserId;
    @io.swagger.annotations.ApiModelProperty(value = "交易额", name = "tradeAmt")
    private String tradeAmt;
    @io.swagger.annotations.ApiModelProperty(value = "解单提交日期", name = "createDate")
    private Date createDate;
    @io.swagger.annotations.ApiModelProperty(value = "解单更新日期", name = "updateDate")
    private Date updateDate;
    @io.swagger.annotations.ApiModelProperty(value = "解单日期", name = "reportDate")
    private String reportDate;
    @io.swagger.annotations.ApiModelProperty(value = "交易笔数", name = "tradeCount")
    private Integer tradeCount;
    @io.swagger.annotations.ApiModelProperty(value = "凭证", name = "proof")
    private String proof;
    @io.swagger.annotations.ApiModelProperty(value = "月份如2019-05", name = "month")

    @TableField(exist = false)
    private String month;

    @TableField(exist = false)
    private String startTime;

    @TableField(exist = false)
    private String endTime;

    @TableField(exist = false)
    private String merchantName;

    public Integer getTradeAmtInteger(){
        if (StringUtils.isBlank(tradeAmt)){
            return 0;
        }
        return Integer.parseInt(tradeAmt);
    }

    @io.swagger.annotations.ApiModelProperty(value = "是否是当天 1是", name = "isToday")
    @TableField(exist = false)
    private Integer isToday;

}
