123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- package com.futu.course.orders.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 lombok.Data;
- /**
- * 订单和优惠券关联表
- * @TableName order_coupon
- */
- @TableName(value ="order_coupon")
- @Data
- public class OrderCoupon implements Serializable {
- /**
- * 订单id
- */
- @TableId
- private Long orderId;
- /**
- * 课程id
- */
- private Long couponId;
- /**
- * 优惠券
- */
- private BigDecimal discountAmount;
- @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;
- }
- OrderCoupon other = (OrderCoupon) that;
- return (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
- && (this.getCouponId() == null ? other.getCouponId() == null : this.getCouponId().equals(other.getCouponId()))
- && (this.getDiscountAmount() == null ? other.getDiscountAmount() == null : this.getDiscountAmount().equals(other.getDiscountAmount()));
- }
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
- result = prime * result + ((getCouponId() == null) ? 0 : getCouponId().hashCode());
- result = prime * result + ((getDiscountAmount() == null) ? 0 : getDiscountAmount().hashCode());
- return result;
- }
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(getClass().getSimpleName());
- sb.append(" [");
- sb.append("Hash = ").append(hashCode());
- sb.append(", orderId=").append(orderId);
- sb.append(", couponId=").append(couponId);
- sb.append(", discountAmount=").append(discountAmount);
- sb.append(", serialVersionUID=").append(serialVersionUID);
- sb.append("]");
- return sb.toString();
- }
- }
|