|
|
|
@ -346,4 +346,102 @@ |
|
|
|
|
AND paper_status = #{status} |
|
|
|
|
</if> |
|
|
|
|
</select> |
|
|
|
|
<select id="getExamPaperAnalysisPageList" resultType="java.util.Map"> |
|
|
|
|
SELECT |
|
|
|
|
paper.id as paperId, |
|
|
|
|
paper.paper_name as paperName, |
|
|
|
|
ind.industry_name as industry, |
|
|
|
|
count(info.id) as useCount, |
|
|
|
|
count(score."id") as participantCount, |
|
|
|
|
round(sum(score.total_score)/sum(paper.total_score)*100,2) as accuracyRate |
|
|
|
|
FROM |
|
|
|
|
ex_exam_papers paper |
|
|
|
|
left join tbl_industry ind |
|
|
|
|
on ind.industry_id = paper.industry_id |
|
|
|
|
and ind.status = 1 |
|
|
|
|
left join ex_exam_info info |
|
|
|
|
on info.paper_id = paper."id" |
|
|
|
|
and info.is_deleted = 0 |
|
|
|
|
left join ex_exam_scores score |
|
|
|
|
on score.paper_id = info.paper_id |
|
|
|
|
and score.exam_id = info."id" |
|
|
|
|
and score.is_deleted = 0 |
|
|
|
|
WHERE |
|
|
|
|
paper.is_deleted = 0 |
|
|
|
|
<if test="paperName != null and paperName != ''"> |
|
|
|
|
AND paper.paper_name LIKE '%' + #{paperName} + '%' |
|
|
|
|
</if> |
|
|
|
|
<if test="industry != null and industry != ''"> |
|
|
|
|
AND ind.industry_id = #{industry} |
|
|
|
|
</if> |
|
|
|
|
group by |
|
|
|
|
paper.id , |
|
|
|
|
paper.paper_name , |
|
|
|
|
ind.industry_name |
|
|
|
|
order by paper.id |
|
|
|
|
</select> |
|
|
|
|
<select id="getPaperName" resultType="java.lang.String"> |
|
|
|
|
SELECT |
|
|
|
|
paper.paper_name |
|
|
|
|
from |
|
|
|
|
ex_exam_papers paper |
|
|
|
|
where |
|
|
|
|
paper.is_deleted=0 |
|
|
|
|
AND paper.id = #{paperId} |
|
|
|
|
</select> |
|
|
|
|
<select id="getQuestionAccuracyData" resultType="java.util.Map"> |
|
|
|
|
SELECT |
|
|
|
|
1 as "count", |
|
|
|
|
COALESCE(sum(ans.is_correct)/count(ans.id),0) as accuracy |
|
|
|
|
FROM |
|
|
|
|
ex_exam_papers paper |
|
|
|
|
left join ex_paper_questions question |
|
|
|
|
on question.paper_id = paper."id" |
|
|
|
|
and question.is_deleted = 0 |
|
|
|
|
left join ex_question_categories cate |
|
|
|
|
on cate.id = question.question_id |
|
|
|
|
and cate.is_deleted = 0 |
|
|
|
|
left join ex_answers ans |
|
|
|
|
on ans.paper_id = paper."id" |
|
|
|
|
and ans.question_id = question.question_id |
|
|
|
|
and ans.is_deleted = 0 |
|
|
|
|
WHERE |
|
|
|
|
paper.is_deleted=0 |
|
|
|
|
AND paper.id = #{paperId} |
|
|
|
|
group by |
|
|
|
|
paper.id, |
|
|
|
|
cate.id |
|
|
|
|
</select> |
|
|
|
|
<select id="getQuestions" resultType="java.util.Map"> |
|
|
|
|
SELECT |
|
|
|
|
cate.question_types as question_types, |
|
|
|
|
cate.question_content as question_content, |
|
|
|
|
cate.answer as answer, |
|
|
|
|
cate.options as options, |
|
|
|
|
question.question_number as question_number, |
|
|
|
|
sum(ans.is_correct)/count(ans.id) as accuracyRate |
|
|
|
|
FROM |
|
|
|
|
ex_exam_papers paper |
|
|
|
|
left join ex_paper_questions question |
|
|
|
|
on question.paper_id = paper."id" |
|
|
|
|
and question.is_deleted = 0 |
|
|
|
|
left join ex_question_categories cate |
|
|
|
|
on cate.id = question.question_id |
|
|
|
|
and cate.is_deleted = 0 |
|
|
|
|
left join ex_answers ans |
|
|
|
|
on ans.paper_id = paper."id" |
|
|
|
|
and ans.question_id = question.question_id |
|
|
|
|
and ans.is_deleted = 0 |
|
|
|
|
WHERE |
|
|
|
|
paper.is_deleted=0 |
|
|
|
|
AND paper.id = #{paperId} |
|
|
|
|
group by |
|
|
|
|
paper.id, |
|
|
|
|
cate.id, |
|
|
|
|
cate.question_types, |
|
|
|
|
cate.question_content, |
|
|
|
|
cate.answer, |
|
|
|
|
cate.options, |
|
|
|
|
question.question_number |
|
|
|
|
</select> |
|
|
|
|
</mapper> |