Prechádzať zdrojové kódy

phr 데이터 혈압 수축기/이완기 같이 처리하도록 수정

maengje 4 rokov pred
rodič
commit
33b345e0d0

+ 7 - 0
src/main/java/com/lemon/lifecenter/dto/PatientPHRHistoryDTO.java

@@ -8,6 +8,7 @@ public class PatientPHRHistoryDTO {
 	private int patientIdx;
 	private String phrType;
 	private float phrValue;
+	private float phrValue2;
 	private String recordedByName;
 	private String recordedById;
 	private String createDate;
@@ -32,6 +33,12 @@ public class PatientPHRHistoryDTO {
 	public void setPhrValue(float phrValue) {
 		this.phrValue = phrValue;
 	}
+	public float getPhrValue2() {
+		return phrValue2;
+	}
+	public void setPhrValue2(float phrValue2) {
+		this.phrValue2 = phrValue2;
+	}
 	public String getRecordedByName() {
 		return recordedByName;
 	}

+ 2 - 4
src/main/java/com/lemon/lifecenter/service/PHRService.java

@@ -40,11 +40,9 @@ public class PHRService {
 			case "pulseRate":
 				phrLatestDTO.setPulseRate((int) dto.getPhrValue());
 				break;
-			case "systolicBloodPressure":
+			case "bloodPressure":
 				phrLatestDTO.setSystolicBloodPressure((int) dto.getPhrValue());
-				break;
-			case "diastolicBloodPressure":
-				phrLatestDTO.setDiastolicBloodPressure((int) dto.getPhrValue());
+				phrLatestDTO.setDiastolicBloodPressure((int) dto.getPhrValue2());
 				break;
 			case "bloodSugar":
 				phrLatestDTO.setBloodSugar((int) dto.getPhrValue());

+ 21 - 2
src/main/resources/mybatis/mapper/patient/patientPHRHistory.xml

@@ -4,23 +4,35 @@
 <mapper namespace="com.lemon.lifecenter.mapper.PatientPHRHistoryMapper">
 	<insert id="insertPHRHistory" parameterType="PatientPHRHistoryDTO" useGeneratedKeys="true">
 	<![CDATA[
-	    INSERT INTO patient_phr_history (patient_idx, phr_type, phr_value, recorded_by_name
+	    INSERT INTO patient_phr_history (patient_idx, phr_type, phr_value
 	]]>
+		<if test='phrValue2 != null and phrValue2 != ""'>
+            <![CDATA[
+	    	, phr_value_2
+	    	]]>
+        </if>
    		<if test='recordedById != null and recordedById != ""'>
             <![CDATA[
 	    	, recorded_by_id
 	    	]]>
         </if>
 	<![CDATA[    	
+			, recorded_by_name
 	    	, create_date)
-       	VALUE (#{patientIdx}, #{phrType}, #{phrValue}, #{recordedByName}
+       	VALUE (#{patientIdx}, #{phrType}, #{phrValue}
     ]]>
+    	<if test='phrValue2 != null and phrValue2 != ""'>
+            <![CDATA[
+	    	, #{phrValue2}
+	    	]]>
+        </if>
    		<if test='recordedById != null and recordedById != ""'>
             <![CDATA[
 	    	, #{recordedById}
 	    	]]>
         </if>
 	<![CDATA[
+			, #{recordedByName}
        		, NOW())
 	]]>
 	</insert>
@@ -38,6 +50,13 @@
     <![CDATA[
 	    SELECT	create_date			AS createDate,
 	    		phr_value			AS phrValue,
+	]]>
+    	<if test='phrType == "bloodPressure"'>
+    	 <![CDATA[
+    	 		phr_value_2			AS phrValue2,
+    	 ]]>
+        </if>
+	<![CDATA[
 	    		recorded_by_name	AS recordedByName
 		FROM patient_phr_history
 		WHERE