Selaa lähdekoodia

Merge remote-tracking branch 'origin/simplatform'

junekeunsong 4 vuotta sitten
vanhempi
commit
97b80a6da8

+ 10 - 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;
 	}
@@ -86,6 +93,9 @@ public class PatientMemoDTO {
   public String getRecordedDateFormatted() {
 		return getDateFormatted(this.recordedDate);
   }
+  public String getUpdateDateFormatted() {
+		return getDateFormatted(this.updateDate);
+  }
   private String getDateFormatted(String dateString) {
 		SimpleDateFormat originalFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
 		SimpleDateFormat targetFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");

+ 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 != ""'>

+ 2 - 2
src/main/webapp/WEB-INF/jsp/clinic/info.jsp

@@ -732,7 +732,7 @@ function retrieveMemoData() {
             html += "<td><pre>" + d.contents + "</pre></td>";
           }
           html += "<td>" + d.recordedByName + "</td>";
-          html += "<td>" + gridDateFormatter(d.createDate) + "</td>";
+          html += "<td>" + gridDateFormatter(d.updateDate) + "</td>";
 					html += "</tr>";
 				});
 			};
@@ -1831,7 +1831,7 @@ $(document).ready(function() {
                                             </c:otherwise>
                                           </c:choose>
                                           <td><c:out value="${d.recordedByName}" /></td>
-                                          <td><c:out value="${d.createDateFormatted}" /></td>
+                                          <td><c:out value="${d.updateDateFormatted}" /></td>
                                         </tr>
                                       </c:forEach>
                                     </c:when>