DoctorAttachment.java 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. package com.kcim.dao.model;
  2. import com.baomidou.mybatisplus.annotation.TableField;
  3. import com.baomidou.mybatisplus.annotation.TableId;
  4. import com.baomidou.mybatisplus.annotation.TableLogic;
  5. import com.baomidou.mybatisplus.annotation.TableName;
  6. import java.io.Serializable;
  7. import java.util.Date;
  8. import com.fasterxml.jackson.annotation.JsonFormat;
  9. import com.fasterxml.jackson.annotation.JsonGetter;
  10. import com.fasterxml.jackson.annotation.JsonIgnore;
  11. import com.kcim.constants.NumberConstant;
  12. import lombok.AllArgsConstructor;
  13. import lombok.Data;
  14. import lombok.NoArgsConstructor;
  15. import lombok.experimental.Accessors;
  16. /**
  17. *
  18. *
  19. * @author Wang.YS
  20. * @date 2024-11-18 22:20:15
  21. */
  22. @Data
  23. @Accessors(chain = true)
  24. @AllArgsConstructor
  25. @NoArgsConstructor
  26. @TableName("med_doctor_attachment")
  27. public class DoctorAttachment implements Serializable {
  28. private static final long serialVersionUID = 1L;
  29. /**
  30. * 主键
  31. */
  32. @TableId
  33. private Integer id;
  34. /**
  35. *
  36. */
  37. private Long userId;
  38. /**
  39. * 附件名称
  40. */
  41. private String fileName;
  42. /**
  43. * 附件链接
  44. */
  45. private String url;
  46. /**
  47. * 附件说明
  48. */
  49. private String description;
  50. /**
  51. * 启用日期
  52. */
  53. @JsonFormat(pattern = "yyyy-MM-dd")
  54. private Date activeDate;
  55. /**
  56. * 到期日期
  57. */
  58. @JsonFormat(pattern = "yyyy-MM-dd")
  59. private Date expireDate;
  60. @TableField(exist = false)
  61. private Integer validFlag;
  62. @JsonGetter("validFlag")
  63. public Integer getValidFlag() {
  64. if(activeDate == null || expireDate == null) {
  65. return 0;
  66. }
  67. if(activeDate.before(new Date()) && expireDate.after(new Date())) {
  68. return 1;
  69. }
  70. return 0;
  71. }
  72. /**
  73. * 医院id
  74. */
  75. @JsonIgnore
  76. private Long hospId;
  77. /**
  78. * 创建人
  79. */
  80. @JsonIgnore
  81. private String createUser;
  82. /**
  83. * 创建时间
  84. */
  85. @JsonIgnore
  86. private Date createTime;
  87. /**
  88. * 更新人
  89. */
  90. @JsonIgnore
  91. private String updateUser;
  92. /**
  93. * 更新时间
  94. */
  95. @JsonIgnore
  96. private Date updateTime;
  97. /**
  98. * 删除人
  99. */
  100. @JsonIgnore
  101. private String deleteUser;
  102. /**
  103. * 删除时间
  104. */
  105. @JsonIgnore
  106. private Date deleteTime;
  107. /**
  108. * 删除标志 0正常 1作废
  109. */
  110. @JsonIgnore
  111. @TableLogic(value = "0",delval = "1")
  112. private Integer delFlag;
  113. }