Browse Source

年龄修改

rgb 6 years ago
parent
commit
3b0c6594bc

+ 7 - 0
icss-service/src/main/java/com/diagbot/dto/GetTopPatientInfoDTO.java

@@ -131,6 +131,13 @@ public class GetTopPatientInfoDTO {
 	@ApiModelProperty(value="系统时间")
 	private Date systemTime;
 	
+	/**
+     * 出生日期
+     */
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+	@ApiModelProperty(value="出生日期")
+    private Date birthday;
+	
 	/**
      * 门诊号
      */

+ 1 - 0
icss-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java

@@ -49,6 +49,7 @@ public class PatientInfoFacade extends PatientInfoServiceImpl {
         GetTopPatientInfoDTO getTopPatientInfoDTO = baseMapper.getTopPatientInfo(getTopPatientInfoVO);
         getTopPatientInfoDTO.setSystemTime(DateUtil.now());
         getTopPatientInfoDTO.setRecordId(getTopPatientInfoVO.getRecordId());
+        getTopPatientInfoDTO.setPatientAge(DateUtil.yearCompare(getTopPatientInfoDTO.getBirthday(), DateUtil.now()));
 
         QueryWrapper<DeptInfo> deptInfoQ = new QueryWrapper<>();
         deptInfoQ.eq("is_deleted", IsDeleteEnum.N.getKey())

+ 1 - 1
icss-service/src/main/resources/mapper/PatientInfoMapper.xml

@@ -55,7 +55,7 @@
 		d.`name` as patientName,
 		case when d.sex=1 then '男' when d.sex=2 then '女' else '未知' end as patientSex,
 		d.id_no as patientIdNo,
-		ROUND(DATEDIFF(CURDATE(), d.birthday)/365.2422) as patientAge
+		d.birthday as birthday,
 		FROM tran_hospital_info a LEFT JOIN tran_hospital_dept b 
 		ON a.`code`=b.hospital_code and b.`status`=1 and b.is_deleted='N' and b.`code`=#{hospitalDeptCode} 	
 		LEFT JOIN tran_doctor_info c