package cn.van333.mt2ql.wxMessage.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;

/**
 *
 * @TableName wx_message_data_for_transfer
 */
@TableName(value ="wx_message_data_for_transfer")
@Data
public class WxMessageDataForTransfer implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 对方wxid
     */
    private String fromwxid;

    /**
     * 1|收到转账 2|对方接收转账 3|发出转账 4|自己接收转账 5|对方退还 6|自己退还
     */
    private Integer msgsource;

    /**
     * 1|即时到账 2|延时到账
     */
    private Integer transtype;

    /**
     * 金额，单位元
     */
    private BigDecimal money;

    /**
     * 转账备注
     */
    private String memo;

    /**
     * 	转账ID
     */
    private String transferid;

    /**
     * 	10位时间戳
     */
    private Integer invalidtime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WxMessageDataForTransfer other = (WxMessageDataForTransfer) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getFromwxid() == null ? other.getFromwxid() == null : this.getFromwxid().equals(other.getFromwxid()))
            && (this.getMsgsource() == null ? other.getMsgsource() == null : this.getMsgsource().equals(other.getMsgsource()))
            && (this.getTranstype() == null ? other.getTranstype() == null : this.getTranstype().equals(other.getTranstype()))
            && (this.getMoney() == null ? other.getMoney() == null : this.getMoney().equals(other.getMoney()))
            && (this.getMemo() == null ? other.getMemo() == null : this.getMemo().equals(other.getMemo()))
            && (this.getTransferid() == null ? other.getTransferid() == null : this.getTransferid().equals(other.getTransferid()))
            && (this.getInvalidtime() == null ? other.getInvalidtime() == null : this.getInvalidtime().equals(other.getInvalidtime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getFromwxid() == null) ? 0 : getFromwxid().hashCode());
        result = prime * result + ((getMsgsource() == null) ? 0 : getMsgsource().hashCode());
        result = prime * result + ((getTranstype() == null) ? 0 : getTranstype().hashCode());
        result = prime * result + ((getMoney() == null) ? 0 : getMoney().hashCode());
        result = prime * result + ((getMemo() == null) ? 0 : getMemo().hashCode());
        result = prime * result + ((getTransferid() == null) ? 0 : getTransferid().hashCode());
        result = prime * result + ((getInvalidtime() == null) ? 0 : getInvalidtime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", fromwxid=").append(fromwxid);
        sb.append(", msgsource=").append(msgsource);
        sb.append(", transtype=").append(transtype);
        sb.append(", money=").append(money);
        sb.append(", memo=").append(memo);
        sb.append(", transferid=").append(transferid);
        sb.append(", invalidtime=").append(invalidtime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
