package com.ssm.manage.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;

@Table(name = "promotion_project")
@JsonIgnoreProperties(ignoreUnknown = true)
public class PromotionProject implements Serializable {
    /**
     * 主键ID
     */
    @Id
    private Long id;

    /**
     * 门店ID
     */
    @Column(name = "store_id")
    private Long storeId;

    /**
     * 门店名称
     */
    @Column(name = "store_name")
    private String storeName;

    /**
     * 促销项目ID
     */
    @Column(name = "project_id")
    private Long projectId;

    /**
     * 项目编码
     */
    @Column(name = "project_num")
    private String projectNum;

    /**
     * 促销项目名称
     */
    @Column(name = "project_name")
    private String projectName;

    /**
     * 会员价
     */
    @Column(name = "price_member")
    private BigDecimal priceMember;

    /**
     * 销售次数
     */
    private Integer times;

    /**
     * 项目总金额
     */
    @Column(name = "project_total_money")
    private BigDecimal projectTotalMoney;

    /**
     * 项目标准次数
     */
    @Column(name = "standard_times")
    private Integer standardTimes;

    /**
     * 项目标准金额
     */
    @Column(name = "standard_money")
    private BigDecimal standardMoney;

    /**
     * 促销活动ID
     */
    @Column(name = "promotion_id")
    private Long promotionId;

    /**
     * 促销方案编码
     */
    @Column(name = "promotion_num")
    private String promotionNum;

    /**
     * 促销方案名称
     */
    @Column(name = "promotion_name")
    private String promotionName;

    /**
     * 0:购买/1:赠送
     */
    private Integer type;


    /**
     * 是否必选：0=必选，1=非必选，用于促销的选择性项目方案
     */
    @Column(name = "required")
    private Integer required;

    @Column(name = "valid_time")
    private Integer validTime;

    @Column(name = "use_end_date")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date useEndDate;

    @Column(name = "type_info")
    private Integer typeInfo;

    public Integer getTypeInfo() {
        return typeInfo;
    }

    public void setTypeInfo(Integer typeInfo) {
        this.typeInfo = typeInfo;
    }

    public Integer getValidTime() {
        return validTime;
    }

    public void setValidTime(Integer validTime) {
        this.validTime = validTime;
    }

    public Date getUseEndDate() {
        return useEndDate;
    }

    public void setUseEndDate(Date useEndDate) {
        this.useEndDate = useEndDate;
    }

    public Integer getRequired() {
        return required;
    }

    public void setRequired(Integer required) {
        this.required = required;
    }

    private static final long serialVersionUID = 1L;

    /**
     * 获取主键ID
     *
     * @return id - 主键ID
     */
    public Long getId() {
        return id;
    }

    /**
     * 设置主键ID
     *
     * @param id 主键ID
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 获取门店ID
     *
     * @return store_id - 门店ID
     */
    public Long getStoreId() {
        return storeId;
    }

    /**
     * 设置门店ID
     *
     * @param storeId 门店ID
     */
    public void setStoreId(Long storeId) {
        this.storeId = storeId;
    }

    /**
     * 获取门店名称
     *
     * @return store_name - 门店名称
     */
    public String getStoreName() {
        return storeName;
    }

    /**
     * 设置门店名称
     *
     * @param storeName 门店名称
     */
    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    /**
     * 获取促销项目ID
     *
     * @return project_id - 促销项目ID
     */
    public Long getProjectId() {
        return projectId;
    }

    /**
     * 设置促销项目ID
     *
     * @param projectId 促销项目ID
     */
    public void setProjectId(Long projectId) {
        this.projectId = projectId;
    }

    /**
     * 获取项目编码
     *
     * @return project_num - 项目编码
     */
    public String getProjectNum() {
        return projectNum;
    }

    /**
     * 设置项目编码
     *
     * @param projectNum 项目编码
     */
    public void setProjectNum(String projectNum) {
        this.projectNum = projectNum;
    }

    /**
     * 获取促销项目名称
     *
     * @return project_name - 促销项目名称
     */
    public String getProjectName() {
        return projectName;
    }

    /**
     * 设置促销项目名称
     *
     * @param projectName 促销项目名称
     */
    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    /**
     * 获取会员价
     *
     * @return price_member - 会员价
     */
    public BigDecimal getPriceMember() {
        return priceMember;
    }

    /**
     * 设置会员价
     *
     * @param priceMember 会员价
     */
    public void setPriceMember(BigDecimal priceMember) {
        this.priceMember = priceMember;
    }

    /**
     * 获取销售次数
     *
     * @return times - 销售次数
     */
    public Integer getTimes() {
        return times;
    }

    /**
     * 设置销售次数
     *
     * @param times 销售次数
     */
    public void setTimes(Integer times) {
        this.times = times;
    }

    /**
     * 获取项目总金额
     *
     * @return project_total_money - 项目总金额
     */
    public BigDecimal getProjectTotalMoney() {
        return projectTotalMoney;
    }

    /**
     * 设置项目总金额
     *
     * @param projectTotalMoney 项目总金额
     */
    public void setProjectTotalMoney(BigDecimal projectTotalMoney) {
        this.projectTotalMoney = projectTotalMoney;
    }

    /**
     * 获取项目标准次数
     *
     * @return standard_times - 项目标准次数
     */
    public Integer getStandardTimes() {
        return standardTimes;
    }

    /**
     * 设置项目标准次数
     *
     * @param standardTimes 项目标准次数
     */
    public void setStandardTimes(Integer standardTimes) {
        this.standardTimes = standardTimes;
    }

    /**
     * 获取项目标准金额
     *
     * @return standard_money - 项目标准金额
     */
    public BigDecimal getStandardMoney() {
        return standardMoney;
    }

    /**
     * 设置项目标准金额
     *
     * @param standardMoney 项目标准金额
     */
    public void setStandardMoney(BigDecimal standardMoney) {
        this.standardMoney = standardMoney;
    }

    /**
     * 获取促销活动ID
     *
     * @return promotion_id - 促销活动ID
     */
    public Long getPromotionId() {
        return promotionId;
    }

    /**
     * 设置促销活动ID
     *
     * @param promotionId 促销活动ID
     */
    public void setPromotionId(Long promotionId) {
        this.promotionId = promotionId;
    }

    /**
     * 获取促销方案编码
     *
     * @return promotion_num - 促销方案编码
     */
    public String getPromotionNum() {
        return promotionNum;
    }

    /**
     * 设置促销方案编码
     *
     * @param promotionNum 促销方案编码
     */
    public void setPromotionNum(String promotionNum) {
        this.promotionNum = promotionNum;
    }

    /**
     * 获取促销方案名称
     *
     * @return promotion_name - 促销方案名称
     */
    public String getPromotionName() {
        return promotionName;
    }

    /**
     * 设置促销方案名称
     *
     * @param promotionName 促销方案名称
     */
    public void setPromotionName(String promotionName) {
        this.promotionName = promotionName;
    }

    /**
     * 获取0:购买/1:赠送
     *
     * @return type - 0:购买/1:赠送
     */
    public Integer getType() {
        return type;
    }

    /**
     * 设置0:购买/1:赠送
     *
     * @param type 0:购买/1:赠送
     */
    public void setType(Integer type) {
        this.type = type;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PromotionProject other = (PromotionProject) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId()))
            && (this.getStoreName() == null ? other.getStoreName() == null : this.getStoreName().equals(other.getStoreName()))
            && (this.getProjectId() == null ? other.getProjectId() == null : this.getProjectId().equals(other.getProjectId()))
            && (this.getProjectNum() == null ? other.getProjectNum() == null : this.getProjectNum().equals(other.getProjectNum()))
            && (this.getProjectName() == null ? other.getProjectName() == null : this.getProjectName().equals(other.getProjectName()))
            && (this.getPriceMember() == null ? other.getPriceMember() == null : this.getPriceMember().equals(other.getPriceMember()))
            && (this.getTimes() == null ? other.getTimes() == null : this.getTimes().equals(other.getTimes()))
            && (this.getProjectTotalMoney() == null ? other.getProjectTotalMoney() == null : this.getProjectTotalMoney().equals(other.getProjectTotalMoney()))
            && (this.getStandardTimes() == null ? other.getStandardTimes() == null : this.getStandardTimes().equals(other.getStandardTimes()))
            && (this.getStandardMoney() == null ? other.getStandardMoney() == null : this.getStandardMoney().equals(other.getStandardMoney()))
            && (this.getPromotionId() == null ? other.getPromotionId() == null : this.getPromotionId().equals(other.getPromotionId()))
            && (this.getPromotionNum() == null ? other.getPromotionNum() == null : this.getPromotionNum().equals(other.getPromotionNum()))
            && (this.getPromotionName() == null ? other.getPromotionName() == null : this.getPromotionName().equals(other.getPromotionName()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode());
        result = prime * result + ((getStoreName() == null) ? 0 : getStoreName().hashCode());
        result = prime * result + ((getProjectId() == null) ? 0 : getProjectId().hashCode());
        result = prime * result + ((getProjectNum() == null) ? 0 : getProjectNum().hashCode());
        result = prime * result + ((getProjectName() == null) ? 0 : getProjectName().hashCode());
        result = prime * result + ((getPriceMember() == null) ? 0 : getPriceMember().hashCode());
        result = prime * result + ((getTimes() == null) ? 0 : getTimes().hashCode());
        result = prime * result + ((getProjectTotalMoney() == null) ? 0 : getProjectTotalMoney().hashCode());
        result = prime * result + ((getStandardTimes() == null) ? 0 : getStandardTimes().hashCode());
        result = prime * result + ((getStandardMoney() == null) ? 0 : getStandardMoney().hashCode());
        result = prime * result + ((getPromotionId() == null) ? 0 : getPromotionId().hashCode());
        result = prime * result + ((getPromotionNum() == null) ? 0 : getPromotionNum().hashCode());
        result = prime * result + ((getPromotionName() == null) ? 0 : getPromotionName().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().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(", storeId=").append(storeId);
        sb.append(", storeName=").append(storeName);
        sb.append(", projectId=").append(projectId);
        sb.append(", projectNum=").append(projectNum);
        sb.append(", projectName=").append(projectName);
        sb.append(", priceMember=").append(priceMember);
        sb.append(", times=").append(times);
        sb.append(", projectTotalMoney=").append(projectTotalMoney);
        sb.append(", standardTimes=").append(standardTimes);
        sb.append(", standardMoney=").append(standardMoney);
        sb.append(", promotionId=").append(promotionId);
        sb.append(", promotionNum=").append(promotionNum);
        sb.append(", promotionName=").append(promotionName);
        sb.append(", type=").append(type);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}