(select count(1) from tr_exam_authorize where exam_id = ex.id and state =1) as shouldExamNum,
(SELECT COUNT(DISTINCT account_id) FROM tr_exam_answer WHERE exam_id = ex.id AND state in(1,2)) as commitExamNum,
(select COUNT(distinct account_id) from tr_exam_answer where state=2 AND exam_id = ex.id AND score >= ex.qualified_score group by account_id having count(1)>1) as qualifidNum,
(select COUNT(distinct account_id) from tr_exam_answer where state=2 AND exam_id = ex.id AND score >= ex.qualified_score group by account_id having count(1)=1) as qualifiedNumFrist
(select COUNT(distinct account_id) from tr_exam_answer where state=2 AND exam_id = ex.id AND score >= ex.qualified_score) as qualifidNum,
(select COUNT(distinct account_id) from tr_exam_answer where state=2 AND exam_id = ex.id AND score >= ex.qualified_score ) as qualifiedNumFrist
FROM exam ex
WHERE ex.state>1 and ex.company_id = #{companyId} and ex.site_id = #{siteId}