Просмотр исходного кода

组卷作业统计时状态无值时忽略状态条件

mingfu 4 недель назад
Родитель
Сommit
5c5730da54
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      ie-system/src/main/resources/mapper/learn/LearnExamineeMapper.xml

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

@@ -76,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          LEFT JOIN `learn_test_student` ts ON ts.`batch_id` = #{batchId} AND ts.`student_id` = ls.`student_id` AND ts.`build_type` = #{buildType} AND ts.`subject_id` = #{subjectId}
          LEFT JOIN `sys_user` u ON u.`user_id` = ls.`student_id`
         WHERE tc.`teacher_id` = #{teacherId} and tc.`class_id` = #{classId}
-         AND #{buildStatus} = case when ls.`major_plan_id` is null then 10 when ls.`major_plan_id` IS NOT NULL AND ts.`id` IS NULL then 20 when ts.`status` IN (1,2,3) then 30 else 40 end
+          <if test="buildStatus != null"> AND #{buildStatus} = case when ls.`major_plan_id` is null then 10 when ls.`major_plan_id` IS NOT NULL AND ts.`id` IS NULL then 20 when ts.`status` IN (1,2,3) then 30 else 40 end</if>
     </select>
 
     <select id="selectSimulatedStats" parameterType="Map" resultType="com.alibaba.fastjson2.JSONObject">