|
|
@@ -299,7 +299,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<select id="statByKnowledge" parameterType="map" resultMap="LearnQuestionsResult">
|
|
|
SELECT kq.knowledge_id `knowledgeId`, COUNT(DISTINCT kq.`question_id`) number, COUNT(DISTINCT IF(e.`examinee_id` IS NOT NULL, kq.`question_id`, NULL)) id, COUNT(DISTINCT IF(e.`examinee_id` IS NOT NULL AND a.`state` = 1, kq.`question_id`, NULL)) year
|
|
|
FROM `learn_knowledge_question` kq
|
|
|
- LEFT JOIN `learn_answer` a ON kq.`question_id` = a.`question_id` AND a.`student_id` = #{studentId}
|
|
|
+ LEFT JOIN `learn_answer` a ON kq.`question_id` = a.`question_id` AND a.state > 0 AND a.`student_id` = #{studentId}
|
|
|
LEFT JOIN `learn_examinee` e ON a.`examinee_id` = e.`examinee_id` AND e.`state` >= 4
|
|
|
JOIN `learn_questions` q ON q.`id` = kq.`question_id`
|
|
|
<where>
|
|
|
@@ -313,7 +313,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
SELECT kq.knowledge_id `knowledgeId`, q.`qtpye`, COUNT(*) number
|
|
|
FROM `learn_knowledge_question` kq
|
|
|
<if test="studentId != null">
|
|
|
- LEFT JOIN `learn_answer` a ON kq.`question_id` = a.`question_id` AND a.`student_id` = #{studentId}
|
|
|
+ LEFT JOIN `learn_answer` a ON kq.`question_id` = a.`question_id` AND a.state > 0 AND a.`student_id` = #{studentId}
|
|
|
LEFT JOIN `learn_examinee` e ON a.`examinee_id` = e.`examinee_id` AND e.`state` >= 4
|
|
|
</if>
|
|
|
<if test="filterType != null">
|
|
|
@@ -336,7 +336,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
SELECT q.`id`, kq.knowledge_id `knowledgeId`, q.title, q.isSubType
|
|
|
FROM `learn_knowledge_question` kq
|
|
|
<if test="id != null">
|
|
|
- LEFT JOIN `learn_answer` a ON kq.`question_id` = a.`question_id` AND a.`student_id` = #{id}
|
|
|
+ LEFT JOIN `learn_answer` a ON kq.`question_id` = a.`question_id` AND a.state > 0 AND a.`student_id` = #{id}
|
|
|
LEFT JOIN `learn_examinee` e ON a.`examinee_id` = e.`examinee_id` AND e.`state` >= 4
|
|
|
</if>
|
|
|
<if test="area != null">
|