Преглед изворни кода

PHR 데이터 입력 시 데이터 생성 일시를 입력받을 수 있도록 수정

maengje пре 4 година
родитељ
комит
2ea0bd55a1
1 измењених фајлова са 13 додато и 2 уклоњено
  1. 13 2
      src/main/resources/mybatis/mapper/patient/patientPHRHistory.xml

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

@@ -33,8 +33,19 @@
         </if>
 	<![CDATA[
 			, #{recordedByName}
-       		, NOW())
 	]]>
+		<choose>
+			<when test='createDate != null and createDate != ""'>
+	            <![CDATA[
+		    	, #{createDate}
+		    	]]>
+	        </when>
+	        <otherwise>
+	        	<![CDATA[
+       			, NOW())
+       			]]>
+      		</otherwise>
+    	</choose>	
 	</insert>
     <select id="selectPHRHistoryCount" parameterType="PatientPHRHistoryDTO" resultType="int">
 	<![CDATA[
@@ -64,7 +75,7 @@
 			patient_idx = #{patientIdx}
 		AND
 			phr_type = #{phrType}
-		ORDER BY create_date ASC
+		ORDER BY create_date, idx ASC
 	]]>
     </select>
 </mapper>