AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
AND a.rec_status = 0
AND a.rec_status = 0
AND r1.rec_status = 0
AND r1.rec_status = 0
<iftest="param.startTime!=null and param.startTime!=0">
<iftest="param.startTime!=null and param.startTime!=0">
@ -185,6 +194,7 @@
#{id}
#{id}
</foreach>
</foreach>
AND r2.answer - r1.answer < 6 * 60 * 60 * 1000
AND r2.answer - r1.answer < 6 * 60 * 60 * 1000
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
AND a.rec_status = 0
AND a.rec_status = 0
AND r1.rec_status = 0
AND r1.rec_status = 0
AND r2.rec_status = 0
AND r2.rec_status = 0
@ -212,6 +222,7 @@
<foreachcollection="hospitalIds"item="id"separator=","open="AND a.hospital_id IN ("close=")">
<foreachcollection="hospitalIds"item="id"separator=","open="AND a.hospital_id IN ("close=")">
#{id}
#{id}
</foreach>
</foreach>
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
) d,
) d,
(select @rk := 0, @team := '') t
(select @rk := 0, @team := '') t
@ -232,6 +243,7 @@
<foreachcollection="hospitalIds"item="id"separator=","open="AND a.hospital_id IN ("close=")">
<foreachcollection="hospitalIds"item="id"separator=","open="AND a.hospital_id IN ("close=")">
#{id}
#{id}
</foreach>
</foreach>
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
group by
group by
<choose>
<choose>
@ -252,7 +264,7 @@
from (
from (
select city.id, city.short_name as shortName, aid.val from
select city.id, city.short_name as shortName, aid.val from
(select city.id, city.short_name from t_organization o, t_organization_parent p, t_organization city
(select city.id, city.short_name from t_organization o, t_organization_parent p, t_organization city
where o.id = p.parent_id and p.organization_id = city.id
where o.id = p.parent_id and p.organization_id = city.id AND city.organization_type = 2
and o.code = #{param.code} and o.rec_status = 0 and p.rec_status = 0 and city.rec_status = 0) city
and o.code = #{param.code} and o.rec_status = 0 and p.rec_status = 0 and city.rec_status = 0) city
left join
left join
(select o.id, o.name, p.parent_id from t_organization o, t_organization_parent p where o.id = p.organization_id and o.organization_type = 3 and o.rec_status = 0 and p.rec_status = 0) hospital on city.id = hospital.parent_id
(select o.id, o.name, p.parent_id from t_organization o, t_organization_parent p where o.id = p.organization_id and o.organization_type = 3 and o.rec_status = 0 and p.rec_status = 0) hospital on city.id = hospital.parent_id
@ -264,7 +276,8 @@
from t_qcp_first_aid a, t_qcp_first_aid_record r1 , t_qcp_first_aid_record r2
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 = #{param.minuendCode}
where a.id = r1.first_aid_id and r1.question_code = #{param.minuendCode}
and a.id = r2.first_aid_id and r2.question_code = #{param.subtractionCode}
and a.id = r2.first_aid_id and r2.question_code = #{param.subtractionCode}
and r1.answer + 0 >= #{startTime} and r1.answer + 0 <= #{endTime}
and r1.answer + 0 >= #{param.startTime} and r1.answer + 0 <= #{param.endTime}
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
) aid on hospital.id = aid.hospital_id
) aid on hospital.id = aid.hospital_id
) t1, (select @rk := 0, @team := '') a order by id,val) b
) t1, (select @rk := 0, @team := '') a order by id,val) b
@ -285,7 +298,8 @@
from t_qcp_first_aid a, t_qcp_first_aid_record r1 , t_qcp_first_aid_record r2
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 = #{param.minuendCode}
where a.id = r1.first_aid_id and r1.question_code = #{param.minuendCode}
and a.id = r2.first_aid_id and r2.question_code = #{param.subtractionCode}
and a.id = r2.first_aid_id and r2.question_code = #{param.subtractionCode}
and r1.answer + 0 >= #{startTime} and r1.answer + 0 <= #{endTime}
and r1.answer + 0 >= #{param.startTime} and r1.answer + 0 <= #{param.endTime}
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6)
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0
and a.rec_status = 0 and r1.rec_status = 0 and r2.rec_status = 0