|
|
@@ -32,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
, COUNT(*) total, SUM(IF(a.`state` = 1, 1, 0)) `value`, round(SUM(IF(a.`state` = 1, 1, 0)) * 100 / COUNT(*)) rate
|
|
|
FROM `learn_answer` a
|
|
|
JOIN `learn_knowledge_tree` kt ON a.`knowledge_id` = kt.`id`
|
|
|
- WHERE a.`student_id` = #{studentId}
|
|
|
+ WHERE a.`student_id` = #{studentId} and a.`state` > 0
|
|
|
GROUP BY a.`knowledge_id`, directed
|
|
|
order by directed desc, rate desc, a.`knowledge_id`
|
|
|
</select>
|
|
|
@@ -40,13 +40,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<select id="selectQuestionStatsHeader" parameterType="Map" resultType="com.alibaba.fastjson2.JSONObject">
|
|
|
SELECT COUNT(*) total, SUM(IF(a.`state` = 1, 1, 0)) `value`, round(SUM(IF(a.`state` = 1, 1, 0)) * 100 / COUNT(*)) rate, COUNT(DISTINCT DATE(a.create_time)) `time`
|
|
|
FROM `learn_answer` a
|
|
|
- WHERE a.`student_id` = #{studentId} and a.`create_time` between #{beginDate} and #{endDate}
|
|
|
+ WHERE a.`student_id` = #{studentId} and a.`state` > 0 and a.`create_time` between #{beginDate} and #{endDate}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectQuestionStatsDetail" parameterType="Map" resultType="com.alibaba.fastjson2.JSONObject">
|
|
|
SELECT DATE(a.create_time) `time`, COUNT(*) total, SUM(IF(a.`state` = 1, 1, 0)) `value`, round(SUM(IF(a.`state` = 1, 1, 0)) * 100 / COUNT(*)) rate
|
|
|
FROM `learn_answer` a
|
|
|
- WHERE a.`student_id` = #{studentId} and a.`create_time` between #{beginDate} and #{endDate}
|
|
|
+ WHERE a.`student_id` = #{studentId} and a.`state` > 0 and a.`create_time` between #{beginDate} and #{endDate}
|
|
|
GROUP BY DATE(a.create_time)
|
|
|
order by DATE(a.create_time) desc
|
|
|
</select>
|