UserAddress.java 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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 lombok.Data;
  8. /**
  9. * 收货地址表
  10. * @TableName user_address
  11. */
  12. @TableName(value ="user_address")
  13. @Data
  14. public class UserAddress implements Serializable {
  15. /**
  16. *
  17. */
  18. @TableId
  19. private Long id;
  20. /**
  21. *
  22. */
  23. private Long userId;
  24. /**
  25. * 收货人
  26. */
  27. private String receiver;
  28. /**
  29. *
  30. */
  31. private String phone;
  32. /**
  33. *
  34. */
  35. private String province;
  36. /**
  37. *
  38. */
  39. private String city;
  40. /**
  41. *
  42. */
  43. private String district;
  44. /**
  45. * 详细地址
  46. */
  47. private String detail;
  48. /**
  49. * 是否默认地址
  50. */
  51. private Integer isDefault;
  52. @TableField(exist = false)
  53. private static final long serialVersionUID = 1L;
  54. @Override
  55. public boolean equals(Object that) {
  56. if (this == that) {
  57. return true;
  58. }
  59. if (that == null) {
  60. return false;
  61. }
  62. if (getClass() != that.getClass()) {
  63. return false;
  64. }
  65. UserAddress other = (UserAddress) that;
  66. return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
  67. && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
  68. && (this.getReceiver() == null ? other.getReceiver() == null : this.getReceiver().equals(other.getReceiver()))
  69. && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
  70. && (this.getProvince() == null ? other.getProvince() == null : this.getProvince().equals(other.getProvince()))
  71. && (this.getCity() == null ? other.getCity() == null : this.getCity().equals(other.getCity()))
  72. && (this.getDistrict() == null ? other.getDistrict() == null : this.getDistrict().equals(other.getDistrict()))
  73. && (this.getDetail() == null ? other.getDetail() == null : this.getDetail().equals(other.getDetail()))
  74. && (this.getIsDefault() == null ? other.getIsDefault() == null : this.getIsDefault().equals(other.getIsDefault()));
  75. }
  76. @Override
  77. public int hashCode() {
  78. final int prime = 31;
  79. int result = 1;
  80. result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
  81. result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
  82. result = prime * result + ((getReceiver() == null) ? 0 : getReceiver().hashCode());
  83. result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
  84. result = prime * result + ((getProvince() == null) ? 0 : getProvince().hashCode());
  85. result = prime * result + ((getCity() == null) ? 0 : getCity().hashCode());
  86. result = prime * result + ((getDistrict() == null) ? 0 : getDistrict().hashCode());
  87. result = prime * result + ((getDetail() == null) ? 0 : getDetail().hashCode());
  88. result = prime * result + ((getIsDefault() == null) ? 0 : getIsDefault().hashCode());
  89. return result;
  90. }
  91. @Override
  92. public String toString() {
  93. StringBuilder sb = new StringBuilder();
  94. sb.append(getClass().getSimpleName());
  95. sb.append(" [");
  96. sb.append("Hash = ").append(hashCode());
  97. sb.append(", id=").append(id);
  98. sb.append(", userId=").append(userId);
  99. sb.append(", receiver=").append(receiver);
  100. sb.append(", phone=").append(phone);
  101. sb.append(", province=").append(province);
  102. sb.append(", city=").append(city);
  103. sb.append(", district=").append(district);
  104. sb.append(", detail=").append(detail);
  105. sb.append(", isDefault=").append(isDefault);
  106. sb.append(", serialVersionUID=").append(serialVersionUID);
  107. sb.append("]");
  108. return sb.toString();
  109. }
  110. }