|
@ -68,7 +68,8 @@ |
|
|
( |
|
|
( |
|
|
select |
|
|
select |
|
|
ROUND((r1.answer - r2.answer)/60000, 2) as val |
|
|
ROUND((r1.answer - r2.answer)/60000, 2) as val |
|
|
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, |
|
|
|
|
|
(SELECT @rownum:=0) r |
|
|
where a.id = r1.first_aid_id and r1.question_code = #{minuendCode} |
|
|
where a.id = r1.first_aid_id and r1.question_code = #{minuendCode} |
|
|
and a.id = r2.first_aid_id and r2.question_code = #{subtractionCode} |
|
|
and a.id = r2.first_aid_id and r2.question_code = #{subtractionCode} |
|
|
and r1.answer + 0 >= #{startTime} and r1.answer + 0 <= #{endTime} |
|
|
and r1.answer + 0 >= #{startTime} and r1.answer + 0 <= #{endTime} |
|
@ -77,9 +78,8 @@ |
|
|
</foreach> |
|
|
</foreach> |
|
|
AND a.value_type = 0 and a.data_status in (1, 3, 5, 6) |
|
|
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, |
|
|
order by r1.answer - r2.answer asc |
|
|
(SELECT @rownum:=0) r |
|
|
)d |
|
|
ORDER BY d.val |
|
|
|
|
|
) as dd |
|
|
) as dd |
|
|
WHERE dd.row_number IN ( FLOOR((@total_rows+1)/2), FLOOR((@total_rows+2)/2) ) |
|
|
WHERE dd.row_number IN ( FLOOR((@total_rows+1)/2), FLOOR((@total_rows+2)/2) ) |
|
|
</select> |
|
|
</select> |
|
|