Browse Source

bug修复

dzx 4 months ago
parent
commit
44ad691d96

+ 4 - 3
src/main/resources/mapper/banding/BandingTaskClassMapper.xml

@@ -17,8 +17,9 @@
             LEFT JOIN banding_task a3 ON a2.grade_id = a3.grade_id AND a2.enroll_type = a3.enroll_type
             WHERE a1.delete_mark = 0 AND a3.id = t1.banding_task_id
             AND (a1.first_ambition_id = t1.major_set_id or a1.second_ambition_id = t1.major_set_id)
-            and a1.id not in (select new_student_id from banding_task_class_student
-            where delete_mark = 0 and banding_task_class_id = t1.id
+            and a1.id not in (SELECT new_student_id FROM banding_task_class_student c1
+            INNER JOIN banding_task_class c2 ON c1.banding_task_class_id = c2.id
+            WHERE c1.delete_mark = 0 AND c2.delete_mark = 0 AND c2.banding_task_id = t1.banding_task_id
             )
         ) as surplus_count, t3.name as teacher_name,t3.id as teacher_id, t4.name as classroom_name,t4.id as classroom_id FROM banding_task_class t1
         LEFT JOIN base_major_set t2 ON t1.major_set_id = t2.id
@@ -46,7 +47,7 @@
         (SELECT COUNT(*) FROM base_new_student a1
         INNER JOIN banding_task_class_student a2 ON a1.id = a2.new_student_id
         WHERE a1.delete_mark = 0 AND a2.delete_mark = 0 AND a2.banding_task_class_id = t1.id AND a1.stduy_status = 'FB3002') AS stay_count,
-        t3.name AS teacher_name FROM banding_task_class t1
+        t3.name AS teacher_name,t4.name as classroom_name, t1.is_order_class FROM banding_task_class t1
         LEFT JOIN base_major_set t2 ON t1.major_set_id = t2.id
         LEFT JOIN xjr_user t3 ON t1.teacher_id = t3.id
         LEFT JOIN base_classroom t4 ON t1.classroom_id = t4.id

+ 3 - 2
src/main/resources/mapper/banding/BandingTaskClassStudentMapper.xml

@@ -24,8 +24,9 @@
         LEFT JOIN banding_task t5 ON t4.grade_id = t5.grade_id AND t4.enroll_type = t5.enroll_type
         WHERE t1.delete_mark = 0 AND t5.id = #{taskClass.bandingTaskId}
         AND (t1.first_ambition_id = #{taskClass.majorSetId} or t1.second_ambition_id = #{taskClass.majorSetId})
-            and t1.id not in (select new_student_id from banding_task_class_student
-            where delete_mark = 0 and banding_task_class_id = #{taskClass.id}
+            and t1.id not in (SELECT new_student_id FROM banding_task_class_student c1
+            INNER JOIN banding_task_class c2 ON c1.banding_task_class_id = c2.id
+            WHERE c1.delete_mark = 0 AND c2.delete_mark = 0 AND c2.banding_task_id = #{taskClass.bandingTaskId}
         )
     </select>
 </mapper>