Quellcode durchsuchen

Merge remote-tracking branch 'origin/simplatform'

junekeunsong vor 4 Jahren
Ursprung
Commit
8136963f48

+ 15 - 3
src/main/resources/mybatis/mapper/patient/patientMemo.xml

@@ -5,8 +5,20 @@
 	<insert id="insertMemo" parameterType="PatientMemoDTO" useGeneratedKeys="true">
 	<![CDATA[
 	    INSERT INTO patient_memo (patient_idx, contents, recorded_by_name, recorded_by_id, create_date)
-       	VALUE (#{patientIdx}, #{contents}, #{recordedByName}, #{recordedById}, NOW())
-	]]>
+       	VALUE (#{patientIdx}, #{contents}, #{recordedByName}, #{recordedById}
+    ]]>
+       	<choose>
+			<when test='createDate != null and createDate != ""'>
+	            <![CDATA[
+		    	, #{createDate})
+		    	]]>
+	        </when>
+	        <otherwise>
+	        	<![CDATA[
+       			, NOW())
+       			]]>
+      		</otherwise>
+    	</choose>
 	</insert>
 	 <select id="selectMemoCount" parameterType="PatientMemoDTO" resultType="int">
 	<![CDATA[
@@ -23,7 +35,7 @@
 		FROM patient_memo
 		WHERE 
 			patient_idx = #{patientIdx}
-		ORDER BY create_date DESC
+		ORDER BY create_date, idx DESC
 	]]>
     </select>
 </mapper>

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

@@ -37,7 +37,7 @@
 		<choose>
 			<when test='createDate != null and createDate != ""'>
 	            <![CDATA[
-		    	, #{createDate}
+		    	, #{createDate})
 		    	]]>
 	        </when>
 	        <otherwise>

+ 13 - 4
src/main/resources/mybatis/mapper/patient/patientSymptomSim.xml

@@ -24,9 +24,18 @@
 	    	, #{recordedById}
 	    	]]>
         </if>
-	<![CDATA[    	        	
-        	, NOW())
-	]]>
+       	<choose>
+			<when test='createDate != null and createDate != ""'>
+	            <![CDATA[
+		    	, #{createDate})
+		    	]]>
+	        </when>
+	        <otherwise>
+	        	<![CDATA[
+       			, NOW())
+       			]]>
+      		</otherwise>
+    	</choose>
 	</insert>
     <select id="selectSymptomCount" parameterType="PatientSymptomSimDTO" resultType="int">
 	<![CDATA[
@@ -60,7 +69,7 @@
 		FROM patient_symptom_sim
 		WHERE 
 			patient_idx = #{patientIdx}		
-		ORDER BY create_date DESC
+		ORDER BY create_date, idx DESC
 	]]>
     </select>
 </mapper>