CaregiverGroup.java 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. package com.dt.common.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.util.Date;
  7. import lombok.Data;
  8. /**
  9. * 护理人员与班级关联表
  10. * @TableName caregiver_group
  11. */
  12. @TableName(value ="caregiver_group")
  13. @Data
  14. public class CaregiverGroup {
  15. /**
  16. * ID
  17. */
  18. @TableId(type = IdType.AUTO)
  19. private Long id;
  20. /**
  21. * 护理人员ID
  22. */
  23. private Long caregiverId;
  24. /**
  25. * 班级/分组ID
  26. */
  27. private Long groupId;
  28. /**
  29. * 创建时间
  30. */
  31. private Date createTime;
  32. @Override
  33. public boolean equals(Object that) {
  34. if (this == that) {
  35. return true;
  36. }
  37. if (that == null) {
  38. return false;
  39. }
  40. if (getClass() != that.getClass()) {
  41. return false;
  42. }
  43. CaregiverGroup other = (CaregiverGroup) that;
  44. return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
  45. && (this.getCaregiverId() == null ? other.getCaregiverId() == null : this.getCaregiverId().equals(other.getCaregiverId()))
  46. && (this.getGroupId() == null ? other.getGroupId() == null : this.getGroupId().equals(other.getGroupId()))
  47. && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
  48. }
  49. @Override
  50. public int hashCode() {
  51. final int prime = 31;
  52. int result = 1;
  53. result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
  54. result = prime * result + ((getCaregiverId() == null) ? 0 : getCaregiverId().hashCode());
  55. result = prime * result + ((getGroupId() == null) ? 0 : getGroupId().hashCode());
  56. result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
  57. return result;
  58. }
  59. @Override
  60. public String toString() {
  61. StringBuilder sb = new StringBuilder();
  62. sb.append(getClass().getSimpleName());
  63. sb.append(" [");
  64. sb.append("Hash = ").append(hashCode());
  65. sb.append(", id=").append(id);
  66. sb.append(", caregiverId=").append(caregiverId);
  67. sb.append(", groupId=").append(groupId);
  68. sb.append(", createTime=").append(createTime);
  69. sb.append("]");
  70. return sb.toString();
  71. }
  72. }