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