Ver Fonte

최신 현황에서 현재 입소 중인 환자리스트만 보이도록 조건 추가, 마지막 증상 날짜 처리 관련 버그 수정

maengje há 5 anos atrás
pai
commit
ebf86e86a1

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

@@ -112,7 +112,7 @@
 	<![CDATA[
 	    SELECT count(*) AS total
 		FROM patient_care c LEFT JOIN patient_phr_latest p ON p.patient_idx = c.patient_idx
-		WHERE c.center_code = #{centerCode}
+		WHERE c.center_code = #{centerCode} AND c.status = 'H'
 	]]>
 		<if test='searchText != null and searchText != ""'>
             <![CDATA[
@@ -140,9 +140,9 @@
     			p.blood_sugar							AS bloodSugar,
 	    		p.blood_sugar_create_date				AS bloodSugarCreateDate,
 	    		(SELECT count(*) FROM patient_memo m WHERE m.patient_idx = c.patient_idx) AS memoCount,
-	    		(SELECT s.create_date FROM patient_symptom_sim s WHERE s.patient_idx = c.patient_idx AND DATEDIFF(DATE(s.create_date), CURDATE()) = 0) AS symptomLastDate
+	    		(SELECT s.create_date FROM patient_symptom_sim s WHERE s.patient_idx = c.patient_idx AND DATEDIFF(DATE(s.create_date), CURDATE()) = 0 ORDER BY s.create_date DESC LIMIT 1) AS symptomLastDate
 		FROM patient_care c LEFT JOIN patient_phr_latest p ON p.patient_idx = c.patient_idx
-		WHERE c.center_code = #{centerCode}
+		WHERE c.center_code = #{centerCode} AND c.status = 'H'
 	]]>
 		<if test='searchText != null and searchText != ""'>
             <![CDATA[