mingfu 1 месяц назад
Родитель
Сommit
9f80bbaa12

+ 1 - 1
ie-admin/src/main/java/com/ruoyi/web/service/ExamService.java

@@ -230,7 +230,7 @@ public class ExamService {
             upExaminee.setWrongCount(wrongCount);
             learnExamineeMapper.updateLearnExaminee(upExaminee);
             if(PaperType.Simulated.getVal().equals(exitExaminee.getPaperType()) || PaperType.Test.getVal().equals(exitExaminee.getPaperType())) {
-                List<JSONObject> paperStatList = learnExamineeMapper.selectExamRankingStats(upExaminee.getScore(), Lists.newArrayList(exitExaminee.getPaperId()));
+                List<JSONObject> paperStatList = learnExamineeMapper.selectExamRankingStats(exitExaminee.getPaperType(), upExaminee.getScore(), Lists.newArrayList(exitExaminee.getPaperId()));
                 JSONObject o = paperStatList.get(0);
                 Integer totalCount = o.getInteger("totalCount");
                 Integer maxScore = o.getInteger("maxScore");

+ 1 - 1
ie-system/src/main/java/com/ruoyi/learn/mapper/LearnExamineeMapper.java

@@ -23,7 +23,7 @@ public interface LearnExamineeMapper
     public List<JSONObject> selectSimulatedStudentStats(@Param("classId") Long classId);
     public List<JSONObject> selectSimulatedStuSubjectStats(@Param("studentId") Long studentId);
 
-    public List<JSONObject> selectExamRankingStats(@Param("stuScore") Integer stuScore, @Param("paperIds") Collection<Long> paperIds);
+    public List<JSONObject> selectExamRankingStats(@Param("paperType") Integer paperType, @Param("stuScore") Integer stuScore, @Param("paperIds") Collection<Long> paperIds);
     public List<JSONObject> selectStudentPractices(@Param("studentId") Long studentId, @Param("paperType") Integer paperType);
 
     /**

+ 1 - 1
ie-system/src/main/resources/mapper/learn/LearnExamineeMapper.xml

@@ -110,7 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectExamRankingStats" parameterType="Map" resultType="com.alibaba.fastjson2.JSONObject">
         SELECT e2.`paper_id`, COUNT(*) totalCount, AVG(e2.`score`) maxScore, AVG(e2.`score`) avgScore, COUNT(IF(e2.`score` &lt; #{stuScore}, 1, 0)) lowCount  FROM `learn_examinee` e2
-        WHERE e2.`paper_type` = 20 and e2.paper_id in <foreach item="id" collection="paperIds" open="(" separator="," close=")">#{id}</foreach>
+        WHERE e2.`paper_type` = #{paperType} and e2.paper_id in <foreach item="id" collection="paperIds" open="(" separator="," close=")">#{id}</foreach>
         GROUP BY e2.`paper_id`
     </select>