OrderInfo.java 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. package com.futu.course.orders.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.math.BigDecimal;
  8. import java.util.Date;
  9. import lombok.Data;
  10. /**
  11. *
  12. * @TableName order_info
  13. */
  14. @TableName(value ="order_info")
  15. @Data
  16. public class OrderInfo implements Serializable {
  17. /**
  18. *
  19. */
  20. @TableId
  21. private Long id;
  22. /**
  23. *
  24. */
  25. private Long userId;
  26. /**
  27. * 总金额
  28. */
  29. private BigDecimal totalAount;
  30. /**
  31. * 优惠金额
  32. */
  33. private BigDecimal desAount;
  34. /**
  35. * 实付金额
  36. */
  37. private BigDecimal queAount;
  38. /**
  39. *
  40. */
  41. private Date createTime;
  42. private Long couponId;
  43. private Integer status;
  44. @TableField(exist = false)
  45. private static final long serialVersionUID = 1L;
  46. @Override
  47. public boolean equals(Object that) {
  48. if (this == that) {
  49. return true;
  50. }
  51. if (that == null) {
  52. return false;
  53. }
  54. if (getClass() != that.getClass()) {
  55. return false;
  56. }
  57. OrderInfo other = (OrderInfo) that;
  58. return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
  59. && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
  60. && (this.getTotalAount() == null ? other.getTotalAount() == null : this.getTotalAount().equals(other.getTotalAount()))
  61. && (this.getDesAount() == null ? other.getDesAount() == null : this.getDesAount().equals(other.getDesAount()))
  62. && (this.getQueAount() == null ? other.getQueAount() == null : this.getQueAount().equals(other.getQueAount()))
  63. && (this.getCouponId() == null ? other.getCouponId() == null : this.getCouponId().equals(other.getCouponId()))
  64. && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
  65. && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
  66. }
  67. @Override
  68. public int hashCode() {
  69. final int prime = 31;
  70. int result = 1;
  71. result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
  72. result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
  73. result = prime * result + ((getTotalAount() == null) ? 0 : getTotalAount().hashCode());
  74. result = prime * result + ((getDesAount() == null) ? 0 : getDesAount().hashCode());
  75. result = prime * result + ((getQueAount() == null) ? 0 : getQueAount().hashCode());
  76. result = prime * result + ((getCouponId() == null) ? 0 : getCouponId().hashCode());
  77. result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
  78. result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
  79. return result;
  80. }
  81. @Override
  82. public String toString() {
  83. StringBuilder sb = new StringBuilder();
  84. sb.append(getClass().getSimpleName());
  85. sb.append(" [");
  86. sb.append("Hash = ").append(hashCode());
  87. sb.append(", id=").append(id);
  88. sb.append(", userId=").append(userId);
  89. sb.append(", totalAount=").append(totalAount);
  90. sb.append(", desAount=").append(desAount);
  91. sb.append(", queAount=").append(queAount);
  92. sb.append(", couponId=").append(couponId);
  93. sb.append(", status=").append(status);
  94. sb.append(", createTime=").append(createTime);
  95. sb.append(", serialVersionUID=").append(serialVersionUID);
  96. sb.append("]");
  97. return sb.toString();
  98. }
  99. }