Jelajahi Sumber

의료진 메모에 update_date 추가

maengje 4 tahun lalu
induk
melakukan
8d2740ccb7

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

@@ -14,6 +14,7 @@ public class PatientMemoDTO {
 	private String recordedByName;
 	private String recordedById;	
 	private String recordedDate;
+	private String updateDate;
 	private String createDate;
 	private int limit;
 	private int limitMax;
@@ -54,6 +55,12 @@ public class PatientMemoDTO {
 	public void setRecordedDate(String recordedDate) {
 		this.recordedDate = recordedDate;
 	}
+	public String getUpdateDate() {
+		return updateDate;
+	}
+	public void setUpdateDate(String updateDate) {
+		this.updateDate = updateDate;
+	}
 	public String getCreateDate() {
 		return createDate;
 	}

+ 7 - 5
src/main/resources/mybatis/mapper/patient/patientMemo.xml

@@ -4,18 +4,18 @@
 <mapper namespace="com.lemon.lifecenter.mapper.PatientMemoMapper">
 	<insert id="insertMemo" parameterType="PatientMemoDTO" useGeneratedKeys="true">
 	<![CDATA[
-	    INSERT INTO patient_memo (patient_idx, contents, recorded_by_name, recorded_by_id, recorded_date, create_date)
+	    INSERT INTO patient_memo (patient_idx, contents, recorded_by_name, recorded_by_id, recorded_date, update_date, create_date)
        	VALUE (#{patientIdx}, #{contents}, #{recordedByName}, #{recordedById}
     ]]>
        	<choose>
 			<when test='recordedDate != null and recordedDate != ""'>
 	            <![CDATA[
-		    	, #{recordedDate}, NOW())
+		    	, #{recordedDate}, NOW(), NOW())
 		    	]]>
 	        </when>
 	        <otherwise>
 	        	<![CDATA[
-       			, NOW(), NOW())
+       			, NOW(), NOW(), NOW())
        			]]>
       		</otherwise>
     	</choose>
@@ -30,6 +30,7 @@
     <select id="selectMemoList" parameterType="PatientMemoDTO" resultType="PatientMemoDTO">
     <![CDATA[
 	    SELECT	idx,
+	    		update_date			AS updateDate,
 	    		create_date			AS createDate,
 	    		contents			AS contents,
 	    		recorded_by_id		AS recordedById,
@@ -43,8 +44,9 @@
     </select>
     <update id="updateMemo" parameterType="PatientMemoDTO">
 	<![CDATA[
-	    UPDATE patient_memo
-	       SET contents = #{contents},  	   
+	    UPDATE	patient_memo
+	       SET	contents = #{contents},  
+	       		update_date = NOW(),	   
 	]]>
        	<choose>
 			<when test='recordedDate != null and recordedDate != ""'>