BusPatientEntity.java 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package com.coffee.bus.entity;
  2. import com.baomidou.mybatisplus.annotation.FieldFill;
  3. import com.baomidou.mybatisplus.annotation.TableField;
  4. import com.baomidou.mybatisplus.annotation.TableLogic;
  5. import com.baomidou.mybatisplus.annotation.TableName;
  6. import com.coffee.bus.bean.HisInfo;
  7. import com.coffee.common.entity.TenantGenericEntity;
  8. import com.coffee.common.enums.SexEnum;
  9. import io.swagger.annotations.ApiModel;
  10. import io.swagger.annotations.ApiModelProperty;
  11. import lombok.Data;
  12. import lombok.EqualsAndHashCode;
  13. import lombok.ToString;
  14. import org.apache.ibatis.type.EnumOrdinalTypeHandler;
  15. import org.hibernate.validator.constraints.Length;
  16. /**
  17. * @author lifang
  18. * @version 1.0.0
  19. * @ClassName BusDoctorEntity.java
  20. * @Description TODO
  21. * @createTime 2022年03月21日 11:17:00
  22. */
  23. @EqualsAndHashCode(callSuper = true)
  24. @Data
  25. @TableName(value = "bus_patient",autoResultMap = true)
  26. @ApiModel(value="住院病人基本信息", description="住院病人基本信息实体类")
  27. @ToString
  28. public class BusPatientEntity extends TenantGenericEntity<String,String> {
  29. @ApiModelProperty(value = "病号")
  30. @Length(max = 255,message = "病号长度不得超过255个字节")
  31. private String code;
  32. @ApiModelProperty(value = "病人名称")
  33. @Length(max = 255,message = "医生岗位长度不得超过255个字节")
  34. private String name;
  35. @TableField(typeHandler = EnumOrdinalTypeHandler.class)
  36. @ApiModelProperty(value = "性别")
  37. private SexEnum gender;
  38. @TableField(fill = FieldFill.INSERT)
  39. @TableLogic(value = "0",delval = "1")
  40. private Integer isDelete;
  41. public static BusPatientEntity of(HisInfo hisInfo){
  42. BusPatientEntity patient = new BusPatientEntity();
  43. patient.setCode(hisInfo.getPatientCode());
  44. patient.setGender(hisInfo.getGender());
  45. patient.setName(hisInfo.getPatientName());
  46. patient.setTenantId(hisInfo.getHospitalId());
  47. return patient;
  48. }
  49. }