|
|
@@ -117,12 +117,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
COUNT(*) AS num,
|
|
|
SUM(IF(a.state = 1, 1, 0)) AS correct,
|
|
|
ROUND(SUM(IF(a.state = 1, 1, 0)) * 100 / COUNT(*), 1) AS rate,
|
|
|
- COUNT(DISTINCT le.paper_id) AS paperCount,
|
|
|
+ COUNT(DISTINCT IF(le.paper_type IN (20,30), le.paper_id, null)) paperCount,
|
|
|
ROUND(SUM(IF(a.`state` = 1 AND le.paper_type IN (20,30), 1, 0)) * 100 / SUM(IF(le.paper_type IN (20,30), 1, 0)), 1) paperRate
|
|
|
FROM `sys_user` u
|
|
|
JOIN `dz_cards` dc ON u.card_id = dc.card_id
|
|
|
JOIN `learn_examinee` le ON le.student_id = u.user_id AND le.state >= 4
|
|
|
- JOIN `learn_answer` a ON u.user_id = a.student_id AND a.state > 0
|
|
|
+ JOIN `learn_answer` a ON a.`examinee_id` = le.`examinee_id` AND a.`state` > 0
|
|
|
WHERE 1=1
|
|
|
GROUP BY a.student_id
|
|
|
),
|