AdminRolePermission.java 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 java.util.Date;
  7. import lombok.Data;
  8. /**
  9. * 角色权限关联表
  10. * @TableName admin_role_permission
  11. */
  12. @TableName(value ="admin_role_permission")
  13. @Data
  14. public class AdminRolePermission {
  15. /**
  16. * 主键ID
  17. */
  18. @TableId(type = IdType.AUTO)
  19. private Integer id;
  20. /**
  21. * 角色ID
  22. */
  23. private Integer roleId;
  24. /**
  25. * 权限ID
  26. */
  27. private Integer permissionId;
  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. AdminRolePermission other = (AdminRolePermission) that;
  44. return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
  45. && (this.getRoleId() == null ? other.getRoleId() == null : this.getRoleId().equals(other.getRoleId()))
  46. && (this.getPermissionId() == null ? other.getPermissionId() == null : this.getPermissionId().equals(other.getPermissionId()))
  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 + ((getRoleId() == null) ? 0 : getRoleId().hashCode());
  55. result = prime * result + ((getPermissionId() == null) ? 0 : getPermissionId().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(", roleId=").append(roleId);
  67. sb.append(", permissionId=").append(permissionId);
  68. sb.append(", createTime=").append(createTime);
  69. sb.append("]");
  70. return sb.toString();
  71. }
  72. }