ActivityRegistration.java 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. package com.zhentao.entity;
  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 com.fasterxml.jackson.annotation.JsonFormat;
  7. import lombok.Data;
  8. import java.io.Serializable;
  9. import java.time.LocalDateTime;
  10. import java.util.Date;
  11. /**
  12. * 活动报名记录表
  13. * @TableName activity_registration
  14. */
  15. @TableName(value ="activity_registration")
  16. @Data
  17. public class ActivityRegistration implements Serializable {
  18. private static final long serialVersionUID = 1L;
  19. /**
  20. * 报名记录ID
  21. */
  22. @TableId(type = IdType.AUTO)
  23. private Long id;
  24. /**
  25. * 活动ID
  26. */
  27. private Integer activityId;
  28. /**
  29. * 用户ID
  30. */
  31. private Integer userId;
  32. /**
  33. * 报名时间
  34. */
  35. @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  36. private LocalDateTime registrationTime;
  37. /**
  38. * 报名状态(1:已报名,2:已取消,3:已签到)
  39. */
  40. private Integer status;
  41. /**
  42. * 支付状态(0:未支付,1:已支付)- 如果数据库中没有此字段,查询时使用默认值1(已支付)
  43. */
  44. @TableField(value = "payment_status", exist = false)
  45. private Integer paymentStatus;
  46. /**
  47. * 创建时间
  48. */
  49. @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  50. private LocalDateTime createdTime;
  51. /**
  52. * 更新时间
  53. */
  54. @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  55. private LocalDateTime updatedTime;
  56. // ========== 关联查询字段(非数据库字段) ==========
  57. /**
  58. * 活动名称
  59. */
  60. @TableField(exist = false)
  61. private String activityName;
  62. /**
  63. * 用户名(昵称)
  64. */
  65. @TableField(exist = false)
  66. private String userName;
  67. /**
  68. * 用户手机号
  69. */
  70. @TableField(exist = false)
  71. private String userPhone;
  72. /**
  73. * 用户性别
  74. */
  75. @TableField(exist = false)
  76. private Integer userGender;
  77. @Override
  78. public boolean equals(Object that) {
  79. if (this == that) {
  80. return true;
  81. }
  82. if (that == null) {
  83. return false;
  84. }
  85. if (getClass() != that.getClass()) {
  86. return false;
  87. }
  88. ActivityRegistration other = (ActivityRegistration) that;
  89. return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
  90. && (this.getActivityId() == null ? other.getActivityId() == null : this.getActivityId().equals(other.getActivityId()))
  91. && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
  92. && (this.getRegistrationTime() == null ? other.getRegistrationTime() == null : this.getRegistrationTime().equals(other.getRegistrationTime()))
  93. && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
  94. && (this.getCreatedTime() == null ? other.getCreatedTime() == null : this.getCreatedTime().equals(other.getCreatedTime()))
  95. && (this.getUpdatedTime() == null ? other.getUpdatedTime() == null : this.getUpdatedTime().equals(other.getUpdatedTime()));
  96. }
  97. @Override
  98. public int hashCode() {
  99. final int prime = 31;
  100. int result = 1;
  101. result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
  102. result = prime * result + ((getActivityId() == null) ? 0 : getActivityId().hashCode());
  103. result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
  104. result = prime * result + ((getRegistrationTime() == null) ? 0 : getRegistrationTime().hashCode());
  105. result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
  106. result = prime * result + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode());
  107. result = prime * result + ((getUpdatedTime() == null) ? 0 : getUpdatedTime().hashCode());
  108. return result;
  109. }
  110. @Override
  111. public String toString() {
  112. StringBuilder sb = new StringBuilder();
  113. sb.append(getClass().getSimpleName());
  114. sb.append(" [");
  115. sb.append("Hash = ").append(hashCode());
  116. sb.append(", id=").append(id);
  117. sb.append(", activityId=").append(activityId);
  118. sb.append(", userId=").append(userId);
  119. sb.append(", registrationTime=").append(registrationTime);
  120. sb.append(", status=").append(status);
  121. sb.append(", createdTime=").append(createdTime);
  122. sb.append(", updatedTime=").append(updatedTime);
  123. sb.append("]");
  124. return sb.toString();
  125. }
  126. }