Browse Source

保健记录添加记录来源

YE-YI 8 years ago
parent
commit
88b8852190

+ 9 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/PatientHealthRecordDiet.java

@ -39,6 +39,8 @@ public class PatientHealthRecordDiet extends IdEntity {
	private Date czrq;
	// 是否作废,1正常,0作废
	private String del;
	//记录来源 0手动 1设备同步
	private String source;
	public String getCode() {
		return code;
@ -109,4 +111,11 @@ public class PatientHealthRecordDiet extends IdEntity {
		this.del = del;
	}
	public String getSource() {
		return source;
	}
	public void setSource(String source) {
		this.source = source;
	}
}

+ 9 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/PatientHealthRecordMedication.java

@ -39,6 +39,8 @@ public class PatientHealthRecordMedication extends IdEntity {
	private Date czrq;
	// 是否作废,1正常,0作废
	private String del;
	//记录来源 0 手动 1记录同步
	private String source;
	public String getCode() {
		return code;
@ -110,4 +112,11 @@ public class PatientHealthRecordMedication extends IdEntity {
		this.del = del;
	}
	public String getSource() {
		return source;
	}
	public void setSource(String source) {
		this.source = source;
	}
}

+ 9 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/PatientHealthRecordSports.java

@ -45,6 +45,8 @@ public class PatientHealthRecordSports extends IdEntity {
	private Date czrq;
	// 是否作废,1正常,0作废
	private String del;
	//记录来源 0 手动  1 设备同步
	private String source;
	public String getCode() {
		return code;
@ -143,4 +145,11 @@ public class PatientHealthRecordSports extends IdEntity {
		this.del = del;
	}
	public String getSource() {
		return source;
	}
	public void setSource(String source) {
		this.source = source;
	}
}

+ 3 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/health/repository/DevicePatientHealthIndexDao.java

@ -80,10 +80,10 @@ public interface DevicePatientHealthIndexDao
	/**
	 * 上次血糖值
     */
	@Query(value = "select a.value1 from device.wlyy_patient_health_index a where a.type=1 and a.user = ?1 and a.id<?2 and a.value2 = ?3 order by a.record_date desc limit 0,1",nativeQuery = true)
	@Query(value = "select a.value1 from device.wlyy_patient_health_index a where a.type=1 and a.user = ?1 and a.id<?2 and a.value2 = ?3 order by a.sort_date desc ,record_date desc limit 0,1",nativeQuery = true)
	String getPreValue(String user,Long id,String value2);
	@Query(value = "select a.* from device.wlyy_patient_health_index a where a.user = ?1 and a.type = ?2 and a.value2 =?3 and a.record_date >= ?4 and a.record_date <= ?5 and a.del = '1' order by a.record_date desc limit ?6 ,?7",nativeQuery = true)
	@Query(value = "select a.* from device.wlyy_patient_health_index a where a.user = ?1 and a.type = ?2 and a.value2 =?3 and a.record_date >= ?4 and a.record_date <= ?5 and a.del = '1' order by a.sort_date desc ,record_date desc limit ?6 ,?7",nativeQuery = true)
	List<DevicePatientHealthIndex> findIndexByPatientNative(String patient, int type,String gi_type, Date start, Date end,int currentSize,int pageSize);
	/**
@ -95,7 +95,7 @@ public interface DevicePatientHealthIndexDao
	@Query(value = "select a.* from device.wlyy_patient_health_index a where a.type=1 and a.user = ?1 and DATE_FORMAT(a.record_date,'%Y-%m-%d') = ?2 order by a.record_date,a.id",nativeQuery = true)
	List<DevicePatientHealthIndex> findByDateNative(String patient, String date );
	@Query(value = "select a.* from device.wlyy_patient_health_index a where a.user = ?1 and a.type = ?2 and a.record_date >= ?3 and a.record_date <= ?4 and a.del = '1' order by a.record_date desc limit ?5 ,?6",nativeQuery = true)
	@Query(value = "select a.* from device.wlyy_patient_health_index a where a.user = ?1 and a.type = ?2 and a.record_date >= ?3 and a.record_date <= ?4 and a.del = '1' order by a.sort_date desc ,record_date desc limit ?5 ,?6",nativeQuery = true)
	List<DevicePatientHealthIndex> findIndexByPatientNative(String patient, int type, Date start, Date end,int currentSize,int pageSize);
	@Query(value = "select DATE_FORMAT(a.record_date,'%Y-%m-%d') from device.wlyy_patient_health_index a where a.user = ?1 and a.record_date >= ?2 and a.record_date <= ?3 and a.del = '1' group by DATE_FORMAT(a.record_date,'%Y-%m-%d') order by DATE_FORMAT(a.record_date,'%Y-%m-%d') desc limit ?4,5?",nativeQuery = true)

+ 4 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthRecordService.java

@ -257,6 +257,7 @@ public class PatientHealthRecordService extends BaseService {
				sportObject.put("sports_typeName", temp.getSportsTypeName());
				sportObject.put("czrq", DateUtil.dateToStr(temp.getCzrq(), DateUtil.YYYY_MM_DD));
				sportObject.put("sortDate", DateUtil.dateToStr(temp.getSortDate(), DateUtil.YYYY_MM_DD));
				sportObject.put("source","1".equals(temp.getSource())?1:0);
			}
			jsonObject.put("sprot",sportObject);
		}
@ -265,6 +266,7 @@ public class PatientHealthRecordService extends BaseService {
			for (PatientHealthRecordMedication temp : medication) {
				medicationObject.put("medication", temp.getMedicinesName());
				medicationObject.put("recordDate",DateUtil.dateToStr(temp.getRecordDate(), DateUtil.YYYY_MM_DD));
				medicationObject.put("source","1".equals(temp.getSource())?1:0);
			}
			jsonObject.put("medication",medicationObject);
@ -276,6 +278,8 @@ public class PatientHealthRecordService extends BaseService {
				dietObject.put("diet", temp.getContent());
				dietObject.put("recordDate",DateUtil.dateToStr(temp.getRecordDate(), DateUtil.YYYY_MM_DD));
				dietObject.put("images",temp.getImages());
				dietObject.put("source","1".equals(temp.getSource())?1:0);
			}
			jsonObject.put("diet",dietObject);