dzx 4 hónapja
szülő
commit
ec714003ed

+ 16 - 6
src/main/resources/mapper/banding/BandingTaskClassMapper.xml

@@ -31,11 +31,21 @@
 
     <select id="getClassSure" parameterType="com.xjrsoft.module.banding.dto.BandingTaskClassPageDto" resultType="com.xjrsoft.module.banding.vo.BandingTaskClassSureListVo">
         SELECT t1.id, t1.major_set_id,t2.name AS major_set_name, t1.name,t1.sort_code,
-        (SELECT COUNT(*) FROM base_new_student WHERE delete_mark = 0) as number,
-        (SELECT COUNT(*) FROM base_new_student WHERE delete_mark = 0 AND gender = 'SB10001') AS male_count,
-        (SELECT COUNT(*) FROM base_new_student WHERE delete_mark = 0 AND gender = 'SB10002') AS female_count,
-        (SELECT COUNT(*) FROM base_new_student WHERE delete_mark = 0 AND stduy_status = 'FB3001') AS not_stay_count,
-        (SELECT COUNT(*) FROM base_new_student WHERE delete_mark = 0 AND stduy_status = 'FB3002') AS stay_count,
+        (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) AS number,
+        (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.gender = 'SB10001') AS male_count,
+        (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.gender = 'SB10002') AS female_count,
+        (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 = 'FB3001') AS not_stay_count,
+        (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
         LEFT JOIN base_major_set t2 ON t1.major_set_id = t2.id
         LEFT JOIN xjr_user t3 ON t1.teacher_id = t3.id
@@ -63,7 +73,7 @@
             AND t1.name like concat('%', #{dto.name}, '%')
         </if>
         <if test="dto.graduateSchool != null and dto.graduateSchool != ''">
-            AND t1.graduate_school = #{dto.graduateSchool}
+            AND t1.graduate_school like concat('%', #{dto.graduateSchool}, '%')
         </if>
         <if test="dto.graduateClass != null and dto.graduateClass != ''">
             AND t1.graduate_class like concat('%', #{dto.graduateClass}, '%')

+ 1 - 1
src/main/resources/mapper/student/BaseNewStudentMapper.xml

@@ -12,7 +12,7 @@
         LEFT JOIN xjr_dictionary_detail t5 ON t1.source = t5.code AND t5.item_id = 2023000000000000028
         LEFT JOIN enrollment_plan t4 ON t1.enrollment_plan_id = t4.id
         LEFT JOIN base_major_set t7 ON t1.first_ambition = t7.id
-        LEFT JOIN enrollment_plan t8 ON t1.second_ambition = t8.id
+        LEFT JOIN base_major_set t8 ON t1.second_ambition = t8.id
         WHERE t1.delete_mark = 0
         <if test="dto.name != null and dto.name != ''">
             and t1.name like concat('%', #{dto.name}, '%')