dzx преди 2 месеца
родител
ревизия
ec6e68c499
променени са 2 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 2 2
      src/main/resources/mapper/student/BaseNewStudentMapper.xml
  2. 1 1
      src/main/resources/mapper/student/StudentReportRecordMapper.xml

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

@@ -78,7 +78,7 @@
         SELECT t1.id,t1.graduate_school,t1.name,t1.gender,t2.name AS gender_cn,t1.credential_number,t1.height,t1.weight,
         t1.score,t1.graduate_class,t1.source,t5.name as source_cn,t1.stduy_status,t3.name AS stduy_status_cn,t1.mobile,t7.name as first_ambition,
         t8.name as second_ambition,t1.is_adjust,t1.status,ifnull(t11.name,t1.delete_reason) AS class_name,t12.name AS teacher_name ,t13.report_time,
-        t9.id as user_id,(select count(*) from student_report_record where user_id = t1.id and base_semester_id = #{dto.baseSemesterId} and delete_mark = 0) as is_report FROM base_new_student t1
+        t9.id as user_id,(select count(*) from student_report_record where user_id = t9.id and base_semester_id = #{dto.baseSemesterId} and delete_mark = 0) as is_report FROM base_new_student t1
         LEFT JOIN xjr_dictionary_detail t2 ON t1.gender = t2.code AND t2.item_id = 2023000000000000004
         LEFT JOIN xjr_dictionary_detail t3 ON t1.stduy_status = t3.code AND t3.item_id = 2023000000000000030
         LEFT JOIN xjr_dictionary_detail t5 ON t1.source = t5.code AND t5.item_id = 2023000000000000028
@@ -135,7 +135,7 @@
             AND t11.id = #{dto.classId}
         </if>
         <if test="dto.isReport != null">
-            AND (select count(*) from student_report_record where user_id = t1.id and base_semester_id = #{dto.baseSemesterId} and delete_mark = 0) = #{dto.isReport}
+            AND (select count(*) from student_report_record where user_id = t9.id and base_semester_id = #{dto.baseSemesterId} and delete_mark = 0) = #{dto.isReport}
         </if>
         <if test="dto.stduyStatus != null and dto.stduyStatus != ''">
             AND t10.stduy_status = #{dto.stduyStatus}

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

@@ -57,7 +57,7 @@
             INNER JOIN xjr_user t2 ON t1.credential_number = t2.credential_number
             INNER JOIN enrollment_plan t3 ON t3.id = t1.enrollment_plan_id
             INNER JOIN base_student_school_roll t4 ON t4.user_id = t2.id
-            LEFT JOIN student_report_record t5 ON t2.id = t5.user_id
+            LEFT JOIN student_report_record t5 ON t2.id = t5.user_id and t5.delete_mark = 0
             WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
             AND t3.grade_id = #{dto.gradeId} AND t3.enroll_type = #{dto.enrollType}
     </select>