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