UserCoupon.java 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. package com.futu.course.user.domain;
  2. import com.baomidou.mybatisplus.annotation.IdType;
  3. import com.baomidou.mybatisplus.annotation.TableField;
  4. import com.baomidou.mybatisplus.annotation.TableId;
  5. import com.baomidou.mybatisplus.annotation.TableName;
  6. import java.io.Serializable;
  7. import java.util.Date;
  8. import lombok.Data;
  9. /**
  10. * 用户和优惠券关联表
  11. * @TableName user_coupon
  12. */
  13. @TableName(value ="user_coupon")
  14. @Data
  15. public class UserCoupon implements Serializable {
  16. /**
  17. *
  18. */
  19. @TableId
  20. private Long id;
  21. /**
  22. *
  23. */
  24. private Long userId;
  25. /**
  26. *
  27. */
  28. private Long couponId;
  29. /**
  30. * 0-未使用 1-已使用
  31. */
  32. private Integer status;
  33. /**
  34. *
  35. */
  36. private Date getTime;
  37. @TableField(exist = false)
  38. private static final long serialVersionUID = 1L;
  39. @Override
  40. public boolean equals(Object that) {
  41. if (this == that) {
  42. return true;
  43. }
  44. if (that == null) {
  45. return false;
  46. }
  47. if (getClass() != that.getClass()) {
  48. return false;
  49. }
  50. UserCoupon other = (UserCoupon) that;
  51. return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
  52. && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
  53. && (this.getCouponId() == null ? other.getCouponId() == null : this.getCouponId().equals(other.getCouponId()))
  54. && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
  55. && (this.getGetTime() == null ? other.getGetTime() == null : this.getGetTime().equals(other.getGetTime()));
  56. }
  57. @Override
  58. public int hashCode() {
  59. final int prime = 31;
  60. int result = 1;
  61. result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
  62. result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
  63. result = prime * result + ((getCouponId() == null) ? 0 : getCouponId().hashCode());
  64. result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
  65. result = prime * result + ((getGetTime() == null) ? 0 : getGetTime().hashCode());
  66. return result;
  67. }
  68. @Override
  69. public String toString() {
  70. StringBuilder sb = new StringBuilder();
  71. sb.append(getClass().getSimpleName());
  72. sb.append(" [");
  73. sb.append("Hash = ").append(hashCode());
  74. sb.append(", id=").append(id);
  75. sb.append(", userId=").append(userId);
  76. sb.append(", couponId=").append(couponId);
  77. sb.append(", status=").append(status);
  78. sb.append(", getTime=").append(getTime);
  79. sb.append(", serialVersionUID=").append(serialVersionUID);
  80. sb.append("]");
  81. return sb.toString();
  82. }
  83. }