package cn.ysk.cashier.mybatis.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.Data;

/**
 * 商户储值会员
 * @TableName tb_shop_user
 */
@Table(name="tb_shop_user")
@Data
public class TbShopUser implements Serializable {
    /**
     * (随机)
     */
    @Id
    private Integer id;

    /**
     * 钱包余额
     */
    private BigDecimal amount;

    /**
     * 授权金额
     */
    private BigDecimal credit_amount;

    /**
     * 消费累计
     */
    private BigDecimal consume_amount;

    /**
     * 消费数量累计
     */
    private Integer consume_number;

    /**
     * 等级积分
     */
    private BigDecimal level_consume;

    /**
     * 0-不可使用 1可使用
     */
    private Integer status;

    /**
     * 代理Id
     */
    private String merchant_id;

    /**
     * 店铺Id
     */
    private String shop_id;

    /**
     * 用户Id
     */
    private String user_id;

    /**
     * 上级Id
     */
    private String parent_id;

    /**
     * 上级的层级
     */
    private String parent_level;

    /**
     * 真实名字
     */
    private String name;

    /**
     *
     */
    private String head_img;

    /**
     * 性别
     */
    private Integer sex;

    /**
     * 生日
     */
    private String birth_day;

    /**
     * 联系电话
     */
    private String telephone;

    /**
     * 是否会员，
     */
    private Integer is_vip;

    /**
     * 会员编号
     */
    private String code;

    /**
     * 是否通过关注而成为会员的，此字段固定后不改
     */
    private Integer is_attention;

    /**
     * 关注时间
     */
    private Integer attention_at;

    /**
     * 是否股东（分销商）
     */
    private Integer is_shareholder;

    /**
     * 层级1-顶级 2-次级 3最低
     */
    private Integer level;

    /**
     * 分销类型 auto-自动获取 set手动设置 charge充值
     */
    private String distribute_type;

    /**
     * 排序
     */
    private Integer sort;

    /**
     *
     */
    private Long created_at;

    /**
     *
     */
    private Long updated_at;

    /**
     * 小程序openId
     */
    private String mini_open_id;

    /**
     * 会员码
     */
    private String dynamic_code;

    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;
        }
        TbShopUser other = (TbShopUser) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
            && (this.getCredit_amount() == null ? other.getCredit_amount() == null : this.getCredit_amount().equals(other.getCredit_amount()))
            && (this.getConsume_amount() == null ? other.getConsume_amount() == null : this.getConsume_amount().equals(other.getConsume_amount()))
            && (this.getConsume_number() == null ? other.getConsume_number() == null : this.getConsume_number().equals(other.getConsume_number()))
            && (this.getLevel_consume() == null ? other.getLevel_consume() == null : this.getLevel_consume().equals(other.getLevel_consume()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getMerchant_id() == null ? other.getMerchant_id() == null : this.getMerchant_id().equals(other.getMerchant_id()))
            && (this.getShop_id() == null ? other.getShop_id() == null : this.getShop_id().equals(other.getShop_id()))
            && (this.getUser_id() == null ? other.getUser_id() == null : this.getUser_id().equals(other.getUser_id()))
            && (this.getParent_id() == null ? other.getParent_id() == null : this.getParent_id().equals(other.getParent_id()))
            && (this.getParent_level() == null ? other.getParent_level() == null : this.getParent_level().equals(other.getParent_level()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getHead_img() == null ? other.getHead_img() == null : this.getHead_img().equals(other.getHead_img()))
            && (this.getSex() == null ? other.getSex() == null : this.getSex().equals(other.getSex()))
            && (this.getBirth_day() == null ? other.getBirth_day() == null : this.getBirth_day().equals(other.getBirth_day()))
            && (this.getTelephone() == null ? other.getTelephone() == null : this.getTelephone().equals(other.getTelephone()))
            && (this.getIs_vip() == null ? other.getIs_vip() == null : this.getIs_vip().equals(other.getIs_vip()))
            && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
            && (this.getIs_attention() == null ? other.getIs_attention() == null : this.getIs_attention().equals(other.getIs_attention()))
            && (this.getAttention_at() == null ? other.getAttention_at() == null : this.getAttention_at().equals(other.getAttention_at()))
            && (this.getIs_shareholder() == null ? other.getIs_shareholder() == null : this.getIs_shareholder().equals(other.getIs_shareholder()))
            && (this.getLevel() == null ? other.getLevel() == null : this.getLevel().equals(other.getLevel()))
            && (this.getDistribute_type() == null ? other.getDistribute_type() == null : this.getDistribute_type().equals(other.getDistribute_type()))
            && (this.getSort() == null ? other.getSort() == null : this.getSort().equals(other.getSort()))
            && (this.getCreated_at() == null ? other.getCreated_at() == null : this.getCreated_at().equals(other.getCreated_at()))
            && (this.getUpdated_at() == null ? other.getUpdated_at() == null : this.getUpdated_at().equals(other.getUpdated_at()))
            && (this.getMini_open_id() == null ? other.getMini_open_id() == null : this.getMini_open_id().equals(other.getMini_open_id()))
            && (this.getDynamic_code() == null ? other.getDynamic_code() == null : this.getDynamic_code().equals(other.getDynamic_code()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
        result = prime * result + ((getCredit_amount() == null) ? 0 : getCredit_amount().hashCode());
        result = prime * result + ((getConsume_amount() == null) ? 0 : getConsume_amount().hashCode());
        result = prime * result + ((getConsume_number() == null) ? 0 : getConsume_number().hashCode());
        result = prime * result + ((getLevel_consume() == null) ? 0 : getLevel_consume().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getMerchant_id() == null) ? 0 : getMerchant_id().hashCode());
        result = prime * result + ((getShop_id() == null) ? 0 : getShop_id().hashCode());
        result = prime * result + ((getUser_id() == null) ? 0 : getUser_id().hashCode());
        result = prime * result + ((getParent_id() == null) ? 0 : getParent_id().hashCode());
        result = prime * result + ((getParent_level() == null) ? 0 : getParent_level().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getHead_img() == null) ? 0 : getHead_img().hashCode());
        result = prime * result + ((getSex() == null) ? 0 : getSex().hashCode());
        result = prime * result + ((getBirth_day() == null) ? 0 : getBirth_day().hashCode());
        result = prime * result + ((getTelephone() == null) ? 0 : getTelephone().hashCode());
        result = prime * result + ((getIs_vip() == null) ? 0 : getIs_vip().hashCode());
        result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
        result = prime * result + ((getIs_attention() == null) ? 0 : getIs_attention().hashCode());
        result = prime * result + ((getAttention_at() == null) ? 0 : getAttention_at().hashCode());
        result = prime * result + ((getIs_shareholder() == null) ? 0 : getIs_shareholder().hashCode());
        result = prime * result + ((getLevel() == null) ? 0 : getLevel().hashCode());
        result = prime * result + ((getDistribute_type() == null) ? 0 : getDistribute_type().hashCode());
        result = prime * result + ((getSort() == null) ? 0 : getSort().hashCode());
        result = prime * result + ((getCreated_at() == null) ? 0 : getCreated_at().hashCode());
        result = prime * result + ((getUpdated_at() == null) ? 0 : getUpdated_at().hashCode());
        result = prime * result + ((getMini_open_id() == null) ? 0 : getMini_open_id().hashCode());
        result = prime * result + ((getDynamic_code() == null) ? 0 : getDynamic_code().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(", amount=").append(amount);
        sb.append(", credit_amount=").append(credit_amount);
        sb.append(", consume_amount=").append(consume_amount);
        sb.append(", consume_number=").append(consume_number);
        sb.append(", level_consume=").append(level_consume);
        sb.append(", status=").append(status);
        sb.append(", merchant_id=").append(merchant_id);
        sb.append(", shop_id=").append(shop_id);
        sb.append(", user_id=").append(user_id);
        sb.append(", parent_id=").append(parent_id);
        sb.append(", parent_level=").append(parent_level);
        sb.append(", name=").append(name);
        sb.append(", head_img=").append(head_img);
        sb.append(", sex=").append(sex);
        sb.append(", birth_day=").append(birth_day);
        sb.append(", telephone=").append(telephone);
        sb.append(", is_vip=").append(is_vip);
        sb.append(", code=").append(code);
        sb.append(", is_attention=").append(is_attention);
        sb.append(", attention_at=").append(attention_at);
        sb.append(", is_shareholder=").append(is_shareholder);
        sb.append(", level=").append(level);
        sb.append(", distribute_type=").append(distribute_type);
        sb.append(", sort=").append(sort);
        sb.append(", created_at=").append(created_at);
        sb.append(", updated_at=").append(updated_at);
        sb.append(", mini_open_id=").append(mini_open_id);
        sb.append(", dynamic_code=").append(dynamic_code);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
