jinxia.mo 3 недель назад
Родитель
Сommit
b48c207051

+ 1 - 0
back-ui/src/views/dz/papers/components/plugs/student-list-dialog.vue

@@ -265,6 +265,7 @@ const open = (row, statType, buildType, batchId, queryParams = {}) => {
     
     // 添加额外的查询条件
     if (queryParams.examType) params.examType = queryParams.examType
+    if (queryParams.subjectId) params.subjectId = queryParams.subjectId
     if (queryParams.universityId) params.universityId = queryParams.universityId
     if (queryParams.majorGroup) params.majorGroup = queryParams.majorGroup
     if (queryParams.majorPlanId) params.majorPlanId = queryParams.majorPlanId

+ 2 - 0
ie-admin/src/main/java/com/ruoyi/web/controller/learn/LearnTeacherController.java

@@ -124,6 +124,7 @@ public class LearnTeacherController extends BaseController {
             @ApiParam("班级ID") @RequestParam(required = false) Long classId,
             @ApiParam("统计类型:send/total/unexact/unfinish/unsend") @RequestParam String statType,
             @ApiParam("考生类型") @RequestParam(required = false) String examType,
+            @ApiParam("科目ID") @RequestParam(required = false) Long subjectId,
             @ApiParam("院校ID") @RequestParam(required = false) Long universityId,
             @ApiParam("专业组") @RequestParam(required = false) String majorGroup,
             @ApiParam("专业计划ID") @RequestParam(required = false) Long majorPlanId)
@@ -133,6 +134,7 @@ public class LearnTeacherController extends BaseController {
         req.setBatchId(batchId);
         req.setClassId(classId);
         req.setExamType(examType);
+        req.setSubjectId(subjectId);
         req.setUniversityId(universityId);
         req.setMajorGroup(majorGroup);
         req.setMajorPlanId(majorPlanId);

+ 14 - 6
ie-system/src/main/resources/mapper/dz/DzClassesMapper.xml

@@ -127,7 +127,8 @@
         LEFT JOIN `dz_school` train_school ON ls.`school_id` = train_school.`id`
         LEFT JOIN `dz_classes` train_class ON ls.`class_id` = train_class.`class_id`
         LEFT JOIN `dz_agent` agent ON (card.`agent_id` = agent.`agent_id` OR card.`leaf_agent_id` = agent.`agent_id` OR (u.`invite_code` IS NOT NULL AND u.`invite_code` != '' AND CAST(u.`invite_code` AS UNSIGNED) = agent.`agent_id`))
-        LEFT JOIN `learn_test_student` ts ON ts.`student_id` = ls.`student_id` AND ts.`batch_id` = lt.`batch_id` AND ts.`class_id` = tc.`class_id`
+        LEFT JOIN `learn_test_student` ts ON ts.`student_id` = ls.`student_id` AND ts.`class_id` = tc.`class_id`
+            <if test="batchId != null"> AND ts.`batch_id` = #{batchId} </if>
             <if test="buildType != null"> AND ts.`build_type` = #{buildType} </if>
             <if test="subjectId != null"> AND ts.`subject_id` = #{subjectId} </if>
         <where>
@@ -135,13 +136,16 @@
             <if test="classId != null"> AND ls.`class_id` = #{classId}</if>
             <if test="batchId != null"> AND lt.`batch_id` = #{batchId}</if>
             <if test="universityId != null"> AND ls.`university_id` = #{universityId}</if>
+            <if test="majorGroup != null"> AND ls.`major_group` = #{majorGroup}</if>
             <if test="majorPlanId != null"> AND ls.`major_plan_id` = #{majorPlanId}</if>
             <if test="examType != null and examType != ''"> AND u.`exam_type` = #{examType}</if>
             <!-- 根据统计类型过滤 -->
             <choose>
                 <!-- send: 组卷已完成 -->
                 <when test="statType == 'send'">
-                    AND ls.`major_plan_id` IS NOT NULL
+                    <if test="buildType != null and (buildType == 'ExactIntelligent' or buildType == 'ExactHand')">
+                        AND ls.`major_plan_id` IS NOT NULL
+                    </if>
                     AND ts.`student_id` IS NOT NULL
                     AND ts.`status` = 4
                 </when>
@@ -149,19 +153,23 @@
                 <when test="statType == 'total'">
                     <!-- 不添加额外条件,返回所有学生 -->
                 </when>
-                <!-- unexact: 未定向未组卷 -->
+                <!-- unexact: 未定向未组卷(仅定向模式) -->
                 <when test="statType == 'unexact'">
                     AND ls.`major_plan_id` IS NULL
                 </when>
                 <!-- unfinish: 组卷未完成 -->
                 <when test="statType == 'unfinish'">
-                    AND ls.`major_plan_id` IS NOT NULL
+                    <if test="buildType != null and (buildType == 'ExactIntelligent' or buildType == 'ExactHand')">
+                        AND ls.`major_plan_id` IS NOT NULL
+                    </if>
                     AND ts.`student_id` IS NOT NULL
                     AND ts.`status` != 4
                 </when>
-                <!-- unsend: 定向未组卷 -->
+                <!-- unsend: 定向未组卷(定向模式)或未组卷(全量模式) -->
                 <when test="statType == 'unsend'">
-                    AND ls.`major_plan_id` IS NOT NULL
+                    <if test="buildType != null and (buildType == 'ExactIntelligent' or buildType == 'ExactHand')">
+                        AND ls.`major_plan_id` IS NOT NULL
+                    </if>
                     AND ts.`student_id` IS NULL
                 </when>
             </choose>