Browse Source

单个中位数

master
ccsens_wu 4 years ago
parent
commit
4da40f8194
  1. 8
      src/main/resources/mapper_dao/FirstAidRecordDao.xml

8
src/main/resources/mapper_dao/FirstAidRecordDao.xml

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

Loading…
Cancel
Save