|
|
@ -5,7 +5,7 @@ |
|
|
|
|
|
|
|
<select id="countTimeWindowPatient" resultType="java.lang.Long"> |
|
|
|
select count(*) from t_qcp_first_aid a, t_qcp_first_aid_record r1 , t_qcp_first_aid_record r2 |
|
|
|
where a.id = r1.first_aid_id and r1.question_code = 'JBXX-FBSJ' |
|
|
|
where a.id = r1.first_aid_id and r1.question_code = 'JBXX-FBTime' |
|
|
|
and a.id = r2.first_aid_id and r2.question_code = 'JBXX-DYSJ' |
|
|
|
and r2.answer + 0 >= #{startTime} and r2.answer + 0 <= #{endTime} |
|
|
|
<foreach collection="hospitalIds" item="id" separator="," open="and a.hospital_id in (" close=")"> |
|
|
@ -101,7 +101,7 @@ |
|
|
|
<otherwise>FROM_UNIXTIME(r2.answer/1000,'%Y-%m-%d') as date,</otherwise> |
|
|
|
</choose> |
|
|
|
count(*) as total from t_qcp_first_aid a, t_qcp_first_aid_record r1 , t_qcp_first_aid_record r2 |
|
|
|
where a.id = r1.first_aid_id and r1.question_code = 'JBXX-FBSJ' |
|
|
|
where a.id = r1.first_aid_id and r1.question_code = 'JBXX-FBTime' |
|
|
|
and a.id = r2.first_aid_id and r2.question_code = 'JBXX-DYSJ' |
|
|
|
and r2.answer + 0 >= #{startTime} and r2.answer + 0 <= #{endTime} |
|
|
|
<foreach collection="hospitalIds" item="id" separator="," open="and a.hospital_id in (" close=")"> |
|
|
@ -184,7 +184,7 @@ |
|
|
|
t_qcp_first_aid_record r2 |
|
|
|
WHERE |
|
|
|
a.id = r1.first_aid_id |
|
|
|
AND r1.question_code = 'JBXX-FBSJ' |
|
|
|
AND r1.question_code = 'JBXX-FBTime' |
|
|
|
AND a.id = r2.first_aid_id |
|
|
|
AND r2.question_code = 'JBXX-DYSJ' |
|
|
|
AND r2.answer + 0 >= #{startTime} |
|
|
@ -393,7 +393,7 @@ |
|
|
|
WHERE |
|
|
|
a.id = r1.first_aid_id |
|
|
|
AND a.id = r2.first_aid_id |
|
|
|
AND r1.question_code = 'JBXX-FBSJ' |
|
|
|
AND r1.question_code = 'JBXX-FBTime' |
|
|
|
AND a.id = r2.first_aid_id |
|
|
|
AND r2.question_code = 'JBXX-DYSJ' |
|
|
|
AND r2.answer + 0 >= #{startTime} |
|
|
@ -540,7 +540,7 @@ |
|
|
|
t_qcp_first_aid_record r2 |
|
|
|
WHERE |
|
|
|
a.id = r1.first_aid_id |
|
|
|
AND r1.question_code = 'JBXX-FBSJ' |
|
|
|
AND r1.question_code = 'JBXX-FBTime' |
|
|
|
AND a.id = r2.first_aid_id |
|
|
|
AND r1.question_code = 'JBXX-DYSJ' |
|
|
|
AND r2.answer + 0 >= #{startTime} |
|
|
|