dzx 1 rok pred
rodič
commit
0a7c2515a7

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

@@ -160,6 +160,16 @@ public class StudentReportRecordController {
         if(dto.getTeacherId() == null){
             dto.setTeacherId(StpUtil.getLoginIdAsLong());
         }
+        if(dto.getGradeId() == null){
+            LambdaQueryWrapper<BaseGrade> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper
+                    .orderByDesc(BaseGrade::getTitle)
+                    .select(BaseGrade.class,x -> VoToColumnUtil.fieldsToColumns(BaseGrade.class).contains(x.getProperty()));
+            List<BaseGrade> gradeList = gradeService.list(queryWrapper);
+            if(!gradeList.isEmpty()){
+                dto.setGradeId(gradeList.get(0).getId());
+            }
+        }
         Page<StudentReportRecordPageVo> page = studentReportRecordService.getMobilePage(new Page<>(dto.getLimit(), dto.getSize()), dto);
         PageOutput<StudentReportRecordPageVo> pageOutput = ConventPage.getPageOutput(page, StudentReportRecordPageVo.class);
         return RT.ok(pageOutput);

+ 4 - 0
src/main/java/com/xjrsoft/module/student/dto/StudentReportRecordPageDto.java

@@ -20,4 +20,8 @@ public class StudentReportRecordPageDto extends PageInput {
 
     @ApiModelProperty("教师id")
     private Long teacherId;
+
+
+    @ApiModelProperty("年级id")
+    private Long gradeId;
 }

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

@@ -45,7 +45,7 @@
         LEFT JOIN xjr_dictionary_detail t4 ON t2.stduy_status = t4.code
         LEFT JOIN base_student_family t5 ON t5.user_id = t1.id
         WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
-        AND t3.teacher_id = #{dto.teacherId}
+        AND t3.teacher_id = #{dto.teacherId} and t2.grade_id = #{dto.gradeId}
         <if test="dto.keyword != null and dto.keyword != ''">
             and t1.name like concat('%', #{dto.keyword},'%')
         </if>