LEFT JOIN course_content t2 ON t.course_id = t2.course_id
<!-- LEFT JOIN course_content t2 ON t.course_id = t2.course_id-->
LEFT JOIN vod_dict t3 ON t2.id = t3.content_id
<!-- LEFT JOIN vod_dict t3 ON t2.id = t3.content_id-->
WHERE
<!-- WHERE-->
t.delete_date IS NULL
<!-- t.delete_date IS NULL-->
AND t2.delete_date IS NULL
<!-- AND t2.delete_date IS NULL-->
AND t3.delete_date IS NULL
<!-- AND t3.delete_date IS NULL-->
AND t.id = #{classId}
<!-- AND t.id = #{classId}-->
) t3 ON t.class_id = t3.id
<!-- ) t3 ON t.class_id = t3.id-->
LEFT JOIN (
<!-- LEFT JOIN (-->
SELECT
<!-- SELECT-->
t2.class_id,
<!-- t2.class_id,-->
sum(
<!-- sum(-->
IF
<!-- IF-->
( t2.cnt >= t4.paper_cnt, 1, 0 )) AS pass_cnt
<!-- ( t2.cnt >= t4.paper_cnt, 1, 0 )) AS pass_cnt-->
FROM
<!-- FROM-->
(
<!-- (-->
SELECT
<!-- SELECT-->
t2.class_id,
<!-- t2.class_id,-->
t2.member_id,
<!-- t2.member_id,-->
sum( t2.cnt ) AS cnt
<!-- sum( t2.cnt ) AS cnt-->
FROM
<!-- FROM-->
(
<!-- (-->
SELECT
<!-- SELECT-->
t.paper_id,
<!-- t.paper_id,-->
t.class_id,
<!-- t.class_id,-->
t.member_id,
<!-- t.member_id,-->
IF
<!-- IF-->
( max( t.score )>= 60, 1, 0 ) AS cnt
<!-- ( max( t.score )>= 60, 1, 0 ) AS cnt-->
FROM
<!-- FROM-->
exercise_done_result t
<!-- exercise_done_result t-->
WHERE
<!-- WHERE-->
t.class_id = #{classId}
<!-- t.class_id = #{classId}-->
AND t.delete_date IS NULL
<!-- AND t.delete_date IS NULL-->
GROUP BY
<!-- GROUP BY-->
t.paper_id,
<!-- t.paper_id,-->
t.class_id,
<!-- t.class_id,-->
t.member_id
<!-- t.member_id-->
) t2
<!-- ) t2-->
GROUP BY
<!-- GROUP BY-->
t2.class_id,
<!-- t2.class_id,-->
t2.member_id
<!-- t2.member_id-->
) t2
<!-- ) t2-->
LEFT JOIN class_dict t3 ON t2.class_id = t3.id
<!-- LEFT JOIN class_dict t3 ON t2.class_id = t3.id-->
LEFT JOIN ( SELECT t.course_id, count( 1 ) AS paper_cnt FROM paper_dict t WHERE t.delete_date IS NULL GROUP BY t.course_id ) t4 ON t3.course_id = t4.course_id
<!-- LEFT JOIN ( SELECT t.course_id, count( 1 ) AS paper_cnt FROM paper_dict t WHERE t.delete_date IS NULL GROUP BY t.course_id ) t4 ON t3.course_id = t4.course_id-->
) t4 ON t.class_id = t4.class_id
<!-- ) t4 ON t.class_id = t4.class_id-->
LEFT JOIN ( SELECT t.class_id, sum( 1 ) AS ask_cnt FROM answering_question t WHERE t.class_id = #{classId} AND t.delete_date IS NULL ) t5 ON t.class_id = t5.class_id
<!-- LEFT JOIN ( SELECT t.class_id, sum( 1 ) AS ask_cnt FROM answering_question t WHERE t.class_id = #{classId} AND t.delete_date IS NULL ) t5 ON t.class_id = t5.class_id-->