select a.name as name ,a.start_time as startTime,a.end_time as endTime,a.id as id,
select a.name as name ,a.start_time as startTime,a.end_time as endTime,a.id as id,
a.training_project_id as trainingProjectId,a.description as description,
a.training_project_id as trainingProjectId,a.description as description,
(SELECT MAX(score) FROM tr_exam_answer b WHERE a.id=b.exam_id AND b.state=2) AS score,
(SELECT MAX(score) FROM tr_exam_answer b WHERE a.id=b.exam_id AND b.account_id=#{accountId} AND b.state=2) AS score,
CASE WHEN NOW() > a.end_time THEN 7 ELSE
CASE WHEN NOW() > a.end_time THEN 7 ELSE
(SELECT CASE WHEN IFNULL(MAX(score),-1)=-1 THEN 0 ELSE CASE WHEN MAX(score)>=a.qualified_score THEN 6 ELSE 5 END END AS score FROM tr_exam_answer b WHERE a.id=b.exam_id AND b.state=2)
(SELECT CASE WHEN IFNULL(MAX(score),-1)=-1 THEN 0 ELSE CASE WHEN MAX(score)>=a.qualified_score THEN 6 ELSE 5 END END AS score FROM tr_exam_answer b WHERE a.id=b.exam_id AND b.account_id=#{accountId} AND b.state=2)