|
|
@@ -1,160 +0,0 @@
|
|
|
-package com.zhentao.modules.domain;
|
|
|
-
|
|
|
-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 java.util.Date;
|
|
|
-
|
|
|
-import com.zhentao.common.enums.CouponType;
|
|
|
-import lombok.Data;
|
|
|
-
|
|
|
-/**
|
|
|
- * 优惠券表(优惠券模板)
|
|
|
- * @TableName coupon
|
|
|
- */
|
|
|
-@TableName(value ="coupon")
|
|
|
-@Data
|
|
|
-public class Coupon implements Serializable {
|
|
|
- /**
|
|
|
- * 优惠券ID(雪花ID)
|
|
|
- */
|
|
|
- @TableId
|
|
|
- private Long id;
|
|
|
-
|
|
|
- /**
|
|
|
- * 优惠券名称(如“新用户满50减20”“老用户满100减30”)
|
|
|
- */
|
|
|
- private String couponName;
|
|
|
-
|
|
|
- /**
|
|
|
- * 优惠券类型(1:满减券,2:折扣券,3:无门槛券)
|
|
|
- */
|
|
|
- private CouponType couponType;
|
|
|
-
|
|
|
- /**
|
|
|
- * 面值(满减券:减多少元,折扣券:折扣率,如0.8代表8折)
|
|
|
- */
|
|
|
- private BigDecimal faceValue;
|
|
|
-
|
|
|
- /**
|
|
|
- * 使用门槛(满多少元可用,无门槛券填0)
|
|
|
- */
|
|
|
- private BigDecimal minAmount;
|
|
|
-
|
|
|
- /**
|
|
|
- * 发放对象(1:新用户,2:老用户,3:所有用户)
|
|
|
- */
|
|
|
- private Integer sendObject;
|
|
|
-
|
|
|
- /**
|
|
|
- * 总数量(发放总数)
|
|
|
- */
|
|
|
- private Integer totalCount;
|
|
|
-
|
|
|
- /**
|
|
|
- * 已使用数量
|
|
|
- */
|
|
|
- private Integer usedCount;
|
|
|
-
|
|
|
- /**
|
|
|
- * 生效时间
|
|
|
- */
|
|
|
- private Date startTime;
|
|
|
-
|
|
|
- /**
|
|
|
- * 失效时间
|
|
|
- */
|
|
|
- private Date endTime;
|
|
|
-
|
|
|
- /**
|
|
|
- * 状态(1:可领取,0:已下架)
|
|
|
- */
|
|
|
- private Integer status;
|
|
|
-
|
|
|
- /**
|
|
|
- * 创建时间
|
|
|
- */
|
|
|
- private Date createTime;
|
|
|
-
|
|
|
- /**
|
|
|
- * 更新时间
|
|
|
- */
|
|
|
- private Date updateTime;
|
|
|
-
|
|
|
- @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;
|
|
|
- }
|
|
|
- Coupon other = (Coupon) that;
|
|
|
- return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
|
|
- && (this.getCouponName() == null ? other.getCouponName() == null : this.getCouponName().equals(other.getCouponName()))
|
|
|
- && (this.getCouponType() == null ? other.getCouponType() == null : this.getCouponType().equals(other.getCouponType()))
|
|
|
- && (this.getFaceValue() == null ? other.getFaceValue() == null : this.getFaceValue().equals(other.getFaceValue()))
|
|
|
- && (this.getMinAmount() == null ? other.getMinAmount() == null : this.getMinAmount().equals(other.getMinAmount()))
|
|
|
- && (this.getSendObject() == null ? other.getSendObject() == null : this.getSendObject().equals(other.getSendObject()))
|
|
|
- && (this.getTotalCount() == null ? other.getTotalCount() == null : this.getTotalCount().equals(other.getTotalCount()))
|
|
|
- && (this.getUsedCount() == null ? other.getUsedCount() == null : this.getUsedCount().equals(other.getUsedCount()))
|
|
|
- && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
|
|
|
- && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
|
|
|
- && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
|
|
|
- && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
|
|
|
- && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public int hashCode() {
|
|
|
- final int prime = 31;
|
|
|
- int result = 1;
|
|
|
- result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
|
|
- result = prime * result + ((getCouponName() == null) ? 0 : getCouponName().hashCode());
|
|
|
- result = prime * result + ((getCouponType() == null) ? 0 : getCouponType().hashCode());
|
|
|
- result = prime * result + ((getFaceValue() == null) ? 0 : getFaceValue().hashCode());
|
|
|
- result = prime * result + ((getMinAmount() == null) ? 0 : getMinAmount().hashCode());
|
|
|
- result = prime * result + ((getSendObject() == null) ? 0 : getSendObject().hashCode());
|
|
|
- result = prime * result + ((getTotalCount() == null) ? 0 : getTotalCount().hashCode());
|
|
|
- result = prime * result + ((getUsedCount() == null) ? 0 : getUsedCount().hashCode());
|
|
|
- result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
|
|
|
- result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
|
|
|
- result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
|
|
|
- result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
|
|
|
- result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().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(", couponName=").append(couponName);
|
|
|
- sb.append(", couponType=").append(couponType);
|
|
|
- sb.append(", faceValue=").append(faceValue);
|
|
|
- sb.append(", minAmount=").append(minAmount);
|
|
|
- sb.append(", sendObject=").append(sendObject);
|
|
|
- sb.append(", totalCount=").append(totalCount);
|
|
|
- sb.append(", usedCount=").append(usedCount);
|
|
|
- sb.append(", startTime=").append(startTime);
|
|
|
- sb.append(", endTime=").append(endTime);
|
|
|
- sb.append(", status=").append(status);
|
|
|
- sb.append(", createTime=").append(createTime);
|
|
|
- sb.append(", updateTime=").append(updateTime);
|
|
|
- sb.append(", serialVersionUID=").append(serialVersionUID);
|
|
|
- sb.append("]");
|
|
|
- return sb.toString();
|
|
|
- }
|
|
|
-}
|