Преглед на файлове

学生处分查询调整

dzx преди 1 година
родител
ревизия
8dea6f8111
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      src/main/resources/mapper/student/BaseStudentPunishmentInfoMapper.xml

+ 3 - 1
src/main/resources/mapper/student/BaseStudentPunishmentInfoMapper.xml

@@ -18,7 +18,9 @@
         t5.credential_number,
         t6.name AS gender,
         t3.name AS teacher_name,
-        t.class_id,t.punishment_type_id,
+        t.class_id,ifnull((SELECT punishment_type_id FROM base_punishment_student_handle
+        WHERE base_student_punishment_info_id = t.id
+        ORDER BY adjust_date DESC,id desc LIMIT 1), t.punishment_type_id) as punishment_type_id,
         (SELECT IF(a1.adjust_type = 3, REPLACE(REPLACE(REPLACE(adjust_type,1,'升级'),2,'降级'),3,'撤销'),CONCAT(REPLACE(REPLACE(REPLACE(adjust_type,1,'升级'),2,'降级'),3,'撤销'),'(',a2.punishment_type,')')) FROM base_punishment_student_handle a1
         LEFT JOIN base_punishment_type a2 ON a1.punishment_type_id = a2.id
         WHERE base_student_punishment_info_id = t.id