Jelajahi Sumber

新生报到数据查询

dzx 1 tahun lalu
induk
melakukan
126466f518

+ 24 - 0
src/main/java/com/xjrsoft/module/student/controller/StudentReportRecordController.java

@@ -287,6 +287,30 @@ public class StudentReportRecordController {
         }
         statisticsVo.setClassList(classList);
 
+        Map<String, List<StudentReportRecordStatisticsListVo>> classTypeMap = dataList.stream().filter(x -> x.getReportTime() != null).collect(Collectors.groupingBy(StudentReportRecordStatisticsListVo::getClassType));
+        List<ItemCountVo> classTypeList = new ArrayList<>();
+        for (String classType : classTypeMap.keySet()) {
+            classTypeList.add(
+                    new ItemCountVo(){{
+                        setItem(classType);
+                        setCount(classTypeMap.get(classType).size());
+                    }}
+            );
+        }
+        statisticsVo.setClassTypeList(classTypeList);
+
+        Map<String, List<StudentReportRecordStatisticsListVo>> majorMap = dataList.stream().filter(x -> x.getReportTime() != null && x.getMajorName() != null).collect(Collectors.groupingBy(StudentReportRecordStatisticsListVo::getMajorName));
+        List<ItemCountVo> majorList = new ArrayList<>();
+        for (String majorName : majorMap.keySet()) {
+            majorList.add(
+                    new ItemCountVo(){{
+                        setItem(majorName);
+                        setCount(majorMap.get(majorName).size());
+                    }}
+            );
+        }
+        statisticsVo.setMajorList(majorList);
+
         BigDecimal divide = BigDecimal.ZERO;
         if( statisticsVo.getAllCount() != 0){
             divide = BigDecimal.valueOf(statisticsVo.getArrivedCount()).divide(BigDecimal.valueOf(statisticsVo.getAllCount()), 4, RoundingMode.HALF_UP);

+ 6 - 0
src/main/java/com/xjrsoft/module/student/vo/StudentReportRecordStatisticsListVo.java

@@ -37,4 +37,10 @@ public class StudentReportRecordStatisticsListVo {
     @ApiModelProperty("所属班级")
     private String className;
 
+    @ApiModelProperty("班级类型")
+    private String classType;
+
+    @ApiModelProperty("专业方向")
+    private String majorName;
+
 }

+ 6 - 0
src/main/java/com/xjrsoft/module/student/vo/StudentReportRecordStatisticsVo.java

@@ -67,4 +67,10 @@ public class StudentReportRecordStatisticsVo {
     @ApiModelProperty("班级报到情况")
     private List<ItemCountVo> classList;
 
+    @ApiModelProperty("班级类型报到情况")
+    private List<ItemCountVo> classTypeList;
+
+    @ApiModelProperty("专业报到情况")
+    private List<ItemCountVo> majorList;
+
 }

+ 11 - 8
src/main/resources/mapper/student/StudentReportRecordMapper.xml

@@ -53,13 +53,16 @@
     </select>
     <select id="getStatisticsDataList" parameterType="com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto"
             resultType="com.xjrsoft.module.student.vo.StudentReportRecordStatisticsListVo">
-            SELECT t1.name,t1.credential_number,t2.gender,t4.graduated_university,t4.stduy_status,t5.report_time ,t6.name as class_name FROM base_new_student t1
-            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 and t5.delete_mark = 0
-            INNER JOIN base_class t6 ON t6.id = t4.class_id
-            WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
-            AND t3.grade_id = #{dto.gradeId} AND t3.enroll_type = #{dto.enrollType}
+        SELECT t1.name,t1.credential_number,t2.gender,t4.graduated_university,t4.stduy_status,t5.report_time ,
+        t6.name AS class_name,t8.name as class_type,t7.name AS major_name FROM base_new_student t1
+        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 AND t5.delete_mark = 0
+        INNER JOIN base_class t6 ON t6.id = t4.class_id
+        INNER JOIN base_major_set t7 ON t7.id = t6.major_set_id
+        left join xjr_dictionary_detail t8 on t6.class_type = t8.code and t8.item_id = 2023000000000000039
+        WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
+        AND t3.grade_id = #{dto.gradeId} AND t3.enroll_type = #{dto.enrollType}
     </select>
 </mapper>