소스 검색

学生处分查询调整

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