Explorar el Código

学生处分查询调整

dzx hace 1 año
padre
commit
4cf97d19eb

+ 1 - 1
src/main/java/com/xjrsoft/module/student/controller/BaseStudentPunishmentInfoController.java

@@ -143,7 +143,7 @@ public class BaseStudentPunishmentInfoController {
             }else if(el.getAdjustType() == 2){
                 adjustType = "降级(" + punishmentTypeMap.get(el.getPunishmentTypeId()) + ")";
             }else if(el.getAdjustType() == 3){
-                adjustType = "撤销(" + punishmentTypeMap.get(el.getPunishmentTypeId()) + ")";
+                adjustType = "撤销";
             }
             bean.setAdjustType(adjustType);
             resultList.add(bean);

+ 7 - 7
src/main/resources/mapper/student/BaseStudentPunishmentInfoMapper.xml

@@ -19,10 +19,10 @@
         t6.name AS gender,
         t3.name AS teacher_name,
         t.class_id,t.punishment_type_id,
-        (SELECT CONCAT(REPLACE(REPLACE(REPLACE(adjust_type,1,'升级'),2,'降级'),3,'撤销'),'(',a2.punishment_type,')') as adjust_type FROM base_punishment_student_handle a1
-        INNER JOIN base_punishment_type a2 ON a1.punishment_type_id = a2.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
-        ORDER BY adjust_date DESC,a1.id DESC LIMIT 1) as adjust_type,
+        ORDER BY adjust_date DESC,a1.id DESC LIMIT 1) AS adjust_type,
         (SELECT adjust_date FROM base_punishment_student_handle
         WHERE base_student_punishment_info_id = t.id
         ORDER BY adjust_date DESC,id desc LIMIT 1) as adjust_date,
@@ -104,10 +104,10 @@
         t3.name AS teacher_name,
         t.class_id,
         t8.name as major,
-        (SELECT CONCAT(REPLACE(REPLACE(REPLACE(adjust_type,1,'升级'),2,'降级'),3,'撤销'),'(',a2.punishment_type,')') as adjust_type FROM base_punishment_student_handle a1
-        INNER JOIN base_punishment_type a2 ON a1.punishment_type_id = a2.id
-         WHERE base_student_punishment_info_id = t.id
-         ORDER BY adjust_date DESC,a1.id DESC LIMIT 1) as adjust_type,
+        (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
+        ORDER BY adjust_date DESC,a1.id DESC LIMIT 1) AS adjust_type,
         (SELECT adjust_date FROM base_punishment_student_handle
         WHERE base_student_punishment_info_id = t.id
         ORDER BY adjust_date DESC,id desc LIMIT 1) as adjust_date,