|
@@ -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
|