Browse Source

新生报到调整

dzx 6 months ago
parent
commit
d34a4d512a

+ 2 - 6
src/main/java/com/xjrsoft/module/student/controller/StudentReportRecordController.java

@@ -6,6 +6,7 @@ import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xjrsoft.common.enums.EnrollTypeEnum;
 import com.xjrsoft.common.enums.GenderDictionaryEnum;
 import com.xjrsoft.common.enums.StudyStatusEnum;
@@ -146,12 +147,7 @@ public class StudentReportRecordController {
     @ApiOperation(value="班主任查询(分页)")
     @SaCheckPermission("studentreportrecord:detail")
     public RT<PageOutput<StudentReportRecordPageVo>> mobilePage(@Valid StudentReportRecordPageDto dto){
-
-        LambdaQueryWrapper<StudentReportRecord> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper
-                .orderByDesc(StudentReportRecord::getId)
-                .select(StudentReportRecord.class,x -> VoToColumnUtil.fieldsToColumns(StudentReportRecordPageVo.class).contains(x.getProperty()));
-        IPage<StudentReportRecord> page = studentReportRecordService.page(ConventPage.getPage(dto), queryWrapper);
+        Page<StudentReportRecordPageVo> page = studentReportRecordService.getMobilePage(new Page<>(dto.getLimit(), dto.getSize()), dto);
         PageOutput<StudentReportRecordPageVo> pageOutput = ConventPage.getPageOutput(page, StudentReportRecordPageVo.class);
         return RT.ok(pageOutput);
     }

+ 7 - 0
src/main/java/com/xjrsoft/module/student/mapper/StudentReportRecordMapper.java

@@ -1,8 +1,13 @@
 package com.xjrsoft.module.student.mapper;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.room.dto.RoomPageDto;
+import com.xjrsoft.module.room.vo.RoomPageVo;
+import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
 import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
 import com.xjrsoft.module.student.entity.StudentReportRecord;
+import com.xjrsoft.module.student.vo.StudentReportRecordPageVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsListVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo;
 import org.apache.ibatis.annotations.Mapper;
@@ -23,4 +28,6 @@ public interface StudentReportRecordMapper extends MPJBaseMapper<StudentReportRe
 
     List<StudentReportRecordStatisticsListVo> getStatisticsDataList(@Param("dto") StudentReportRecordStatisticsDto dto);
 
+    Page<StudentReportRecordPageVo> getMobilePage(Page<StudentReportRecordPageVo> page, @Param("dto") StudentReportRecordPageDto dto);
+
 }

+ 5 - 0
src/main/java/com/xjrsoft/module/student/service/IStudentReportRecordService.java

@@ -1,8 +1,11 @@
 package com.xjrsoft.module.student.service;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
 import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
 import com.xjrsoft.module.student.entity.StudentReportRecord;
+import com.xjrsoft.module.student.vo.StudentReportRecordPageVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsListVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo;
 import org.apache.ibatis.annotations.Param;
@@ -25,4 +28,6 @@ public interface IStudentReportRecordService extends MPJBaseService<StudentRepor
 
 
     Boolean removeByUserId(List<Long> ids);
+
+    Page<StudentReportRecordPageVo> getMobilePage(Page<StudentReportRecordPageVo> page, StudentReportRecordPageDto dto);
 }

+ 9 - 1
src/main/java/com/xjrsoft/module/student/service/impl/StudentReportRecordServiceImpl.java

@@ -1,11 +1,14 @@
 package com.xjrsoft.module.student.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
 import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
 import com.xjrsoft.module.student.entity.StudentReportRecord;
 import com.xjrsoft.module.student.mapper.StudentReportRecordMapper;
 import com.xjrsoft.module.student.service.IStudentReportRecordService;
+import com.xjrsoft.module.student.vo.StudentReportRecordPageVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsListVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo;
 import lombok.AllArgsConstructor;
@@ -35,8 +38,13 @@ public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentRe
     @Override
     public Boolean removeByUserId(List<Long> ids) {
         this.baseMapper.delete(
-                new QueryWrapper<StudentReportRecord>().lambda().in(StudentReportRecord::getUserId, ids)
+            new QueryWrapper<StudentReportRecord>().lambda().in(StudentReportRecord::getUserId, ids)
         );
         return true;
     }
+
+    @Override
+    public Page<StudentReportRecordPageVo> getMobilePage(Page<StudentReportRecordPageVo> page, StudentReportRecordPageDto dto) {
+        return this.baseMapper.getMobilePage(page, dto);
+    }
 }

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

@@ -36,7 +36,7 @@
         WHERE t1.delete_mark = 0
         AND t1.teacher_id = #{dto.teacherId}
     </select>
-    <select id="getClassStatistics" parameterType="com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto"
+    <select id="getMobilePage" parameterType="com.xjrsoft.module.student.dto.StudentReportRecordPageDto"
             resultType="com.xjrsoft.module.student.vo.StudentReportRecordPageVo">
         SELECT t1.id as user_id,t1.name,t1.credential_number,t1.mobile,t4.name AS stduy_status_cn,t5.telephone AS parent_mobile,
         (select count(*) from student_report_record where user_id = t1.id and base_semester_id = #{dto.baseSemesterId}) as is_report FROM xjr_user t1
@@ -46,6 +46,9 @@
         LEFT JOIN base_student_family t5 ON t5.user_id = t1.id
         WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
         AND t2.class_id = #{dto.teacherId}
+        <if test="dto.name != null and dto.name != ''">
+            t1.name like concat('%', #{dto.name},'%')
+        </if>
         ORDER BY t1.create_date DESC, t2.create_date DESC,t3.create_date DESC
     </select>
     <select id="getStatisticsDataList" parameterType="com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto"