Forráskód Böngészése

Merge remote-tracking branch 'origin/dev' into dev

大数据与最优化研究所 10 hónapja
szülő
commit
178be9d5e6

+ 35 - 26
src/main/java/com/xjrsoft/module/student/controller/StudentReportRecordController.java

@@ -3,6 +3,8 @@ package com.xjrsoft.module.student.controller;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.bean.BeanUtil;
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.support.ExcelTypeEnum;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -24,15 +26,20 @@ import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
 import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
 import com.xjrsoft.module.student.dto.StudentReportSignDto;
 import com.xjrsoft.module.student.dto.UpdateStudentReportRecordDto;
+import com.xjrsoft.module.student.entity.StudentReportPlan;
 import com.xjrsoft.module.student.entity.StudentReportRecord;
+import com.xjrsoft.module.student.service.IStudentReportPlanService;
 import com.xjrsoft.module.student.service.IStudentReportRecordService;
+import com.xjrsoft.module.student.vo.BaseMajorCategorPageVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordPageVo;
+import com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsListVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
+import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -43,8 +50,10 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
+import java.io.ByteArrayOutputStream;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
+import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -67,6 +76,7 @@ public class StudentReportRecordController {
     private final IStudentReportRecordService studentReportRecordService;
     private final IBaseSemesterService semesterService;
     private final IBaseGradeService gradeService;
+    private final IStudentReportPlanService studentReportPlanService;
 
     @GetMapping(value = "/page")
     @ApiOperation(value="学生报到记录表列表(分页)")
@@ -324,35 +334,36 @@ public class StudentReportRecordController {
     @GetMapping(value = "/plan-page")
     @ApiOperation(value="学生报到记录表列表(分页)")
     @SaCheckPermission("studentreportrecord:detail")
-    public RT<PageOutput<StudentReportRecordPageVo>> planPage(@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);
-        PageOutput<StudentReportRecordPageVo> pageOutput = ConventPage.getPageOutput(page, StudentReportRecordPageVo.class);
+    public RT<PageOutput<StudentReportRecordPlanPageVo>> planPage(@Valid StudentReportRecordPageDto dto){
+        Page<StudentReportRecordPlanPageVo> planPage = studentReportRecordService.getPlanPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        PageOutput<StudentReportRecordPlanPageVo> pageOutput = ConventPage.getPageOutput(planPage, StudentReportRecordPlanPageVo.class);
         return RT.ok(pageOutput);
     }
 
     @PostMapping(value = "/sign")
     @ApiOperation(value="学生报到")
     @SaCheckPermission("studentreportrecord:detail")
-    public RT<Boolean> sign(@Valid StudentReportSignDto dto){
-
+    public RT<Boolean> sign(@Valid @RequestBody StudentReportSignDto dto){
         StudentReportRecord record = studentReportRecordService.getById(dto.getId());
-
-        return RT.ok(true);
+        StudentReportPlan reportPlan = studentReportPlanService.getById(record.getStudentReportPlanId());
+        LocalDateTime now = LocalDateTime.now();
+        if(reportPlan.getStatus() != 1 || (now.isAfter(reportPlan.getStartTime()) && now.isBefore(reportPlan.getEndTime()))){
+            return RT.error("不在报到时间内,无法报到");
+        }
+        return RT.ok(studentReportRecordService.sgin(dto));
     }
 
     @PostMapping(value = "/all-sign")
     @ApiOperation(value="变更已报到")
     @SaCheckPermission("studentreportrecord:detail")
-    public RT<Boolean> allSign(@Valid StudentReportSignDto dto){
-
-        StudentReportRecord record = studentReportRecordService.getById(dto.getId());
-
-        return RT.ok(true);
+    public RT<Boolean> allSign(@Valid @RequestBody List<StudentReportSignDto> dtoList){
+        StudentReportRecord record = studentReportRecordService.getById(dtoList.get(0).getId());
+        StudentReportPlan reportPlan = studentReportPlanService.getById(record.getStudentReportPlanId());
+        LocalDateTime now = LocalDateTime.now();
+        if(reportPlan.getStatus() != 1 || (now.isAfter(reportPlan.getStartTime()) && now.isBefore(reportPlan.getEndTime()))){
+            return RT.error("不在报到时间内,无法报到");
+        }
+        return RT.ok(studentReportRecordService.allSgin(dtoList));
     }
 
 
@@ -360,20 +371,18 @@ public class StudentReportRecordController {
     @ApiOperation(value="切换就读方式")
     @SaCheckPermission("studentreportrecord:detail")
     public RT<Boolean> updateStduyStatus(@Valid StudentReportSignDto dto){
-
-        StudentReportRecord record = studentReportRecordService.getById(dto.getId());
-
-        return RT.ok(true);
+        return RT.ok(studentReportRecordService.updateStduyStatus(dto));
     }
 
     @PostMapping(value = "/export-querty")
     @ApiOperation(value="导出")
     @SaCheckPermission("studentreportrecord:detail")
-    public RT<Boolean> exportQuerty(@Valid StudentReportSignDto dto){
-
-        StudentReportRecord record = studentReportRecordService.getById(dto.getId());
-
-        return RT.ok(true);
+    public ResponseEntity<byte[]> exportQuerty(@Valid StudentReportRecordPageDto dto){
+        List<StudentReportRecordPlanPageVo> planPageList = studentReportRecordService.getPlanPageList(dto);
+        ByteArrayOutputStream bot = new ByteArrayOutputStream();
+        EasyExcel.write(bot, StudentReportRecordPlanPageVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(planPageList);
+        String fileName = "exportQuerty" + ExcelTypeEnum.XLSX.getValue();
+        return RT.fileStream(bot.toByteArray(), fileName);
     }
 
 

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

@@ -1,9 +1,14 @@
 package com.xjrsoft.module.student.dto;
 
+import com.alibaba.excel.annotation.ExcelProperty;
 import com.xjrsoft.common.page.PageInput;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDate;
+import java.util.Date;
 
 
 /**
@@ -30,4 +35,34 @@ public class StudentReportRecordPageDto extends PageInput {
 
     @ApiModelProperty("计划id")
     private Long studentReportPlanId;
+
+    @ApiModelProperty("姓名")
+    private String name;
+
+    @ApiModelProperty("班级名称")
+    private String className;
+
+    @ApiModelProperty("身份证号")
+    private String credentialNumber;
+
+    @ApiModelProperty("学籍状态")
+    private String archivesStatus;
+
+    @ApiModelProperty("就读方式")
+    private String stduyStatus;
+
+    @ApiModelProperty("学生来源")
+    private String studentType;
+
+    @ApiModelProperty("是否已报到(1:是 0:否)")
+    private Integer isReport;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty("报到时间开始")
+    private LocalDate reportTimeStart;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty("报到时间结束")
+    private LocalDate reportTimeEnd;
+
 }

+ 3 - 2
src/main/java/com/xjrsoft/module/student/entity/StudentReportPlan.java

@@ -11,6 +11,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.time.LocalDateTime;
 import java.util.Date;
 import java.util.List;
 
@@ -85,12 +86,12 @@ public class StudentReportPlan implements Serializable {
     * 报到开始时间
     */
     @ApiModelProperty("报到开始时间")
-    private Date startTime;
+    private LocalDateTime startTime;
     /**
     * 报到结束时间
     */
     @ApiModelProperty("报到结束时间")
-    private Date endTime;
+    private LocalDateTime endTime;
     /**
     * 数据修改开始时间
     */

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

@@ -6,6 +6,7 @@ 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.StudentReportRecordPlanPageVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsListVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo;
 import org.apache.ibatis.annotations.Mapper;
@@ -28,4 +29,8 @@ public interface StudentReportRecordMapper extends MPJBaseMapper<StudentReportRe
 
     Page<StudentReportRecordPageVo> getMobilePage(Page<StudentReportRecordPageVo> page, @Param("dto") StudentReportRecordPageDto dto);
 
+    Page<StudentReportRecordPlanPageVo> getPlanPage(Page<StudentReportRecordPlanPageVo> page, @Param("dto") StudentReportRecordPageDto dto);
+
+    List<StudentReportRecordPlanPageVo> getPlanPageList(@Param("dto") StudentReportRecordPageDto dto);
+
 }

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

@@ -7,8 +7,10 @@ import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
 import com.xjrsoft.module.student.dto.StudentReportSignDto;
 import com.xjrsoft.module.student.entity.StudentReportRecord;
 import com.xjrsoft.module.student.vo.StudentReportRecordPageVo;
+import com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsListVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -33,4 +35,14 @@ public interface IStudentReportRecordService extends MPJBaseService<StudentRepor
 
 
     Boolean sgin(StudentReportSignDto dto);
+
+
+    Page<StudentReportRecordPlanPageVo> getPlanPage(Page<StudentReportRecordPlanPageVo> page, StudentReportRecordPageDto dto);
+
+    List<StudentReportRecordPlanPageVo> getPlanPageList(StudentReportRecordPageDto dto);
+
+
+    Boolean allSgin(List<StudentReportSignDto> dtoList);
+
+    Boolean updateStduyStatus(StudentReportSignDto dto);
 }

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

@@ -4,13 +4,25 @@ import cn.dev33.satoken.stp.StpUtil;
 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.common.enums.DeleteMark;
+import com.xjrsoft.common.enums.EnabledMark;
+import com.xjrsoft.common.enums.StudentChangeTypeEnum;
+import com.xjrsoft.common.enums.StudyStatusEnum;
+import com.xjrsoft.module.organization.entity.User;
+import com.xjrsoft.module.organization.service.IUserService;
 import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
 import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
 import com.xjrsoft.module.student.dto.StudentReportSignDto;
+import com.xjrsoft.module.student.entity.BaseStudent;
+import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import com.xjrsoft.module.student.entity.StudentReportRecord;
 import com.xjrsoft.module.student.mapper.StudentReportRecordMapper;
+import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
+import com.xjrsoft.module.student.service.IBaseStudentService;
+import com.xjrsoft.module.student.service.IStudentChangeRecordService;
 import com.xjrsoft.module.student.service.IStudentReportRecordService;
 import com.xjrsoft.module.student.vo.StudentReportRecordPageVo;
+import com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsListVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo;
 import lombok.AllArgsConstructor;
@@ -29,6 +41,11 @@ import java.util.List;
 @Service
 @AllArgsConstructor
 public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentReportRecordMapper, StudentReportRecord> implements IStudentReportRecordService {
+
+    private final IBaseStudentService studentService;
+    private final IUserService userService;
+    private final IBaseStudentSchoolRollService rollService;
+    private final IStudentChangeRecordService changeRecordService;
     @Override
     public StudentReportRecordStatisticsVo getClassStatistics(StudentReportRecordStatisticsDto dto) {
         return this.baseMapper.getClassStatistics(dto);
@@ -66,6 +83,86 @@ public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentRe
         record.setReportTime(new Date());
         this.updateById(record);
 
-        return null;
+        BaseStudent student = studentService.getOne(
+                new QueryWrapper<BaseStudent>().lambda()
+                        .eq(BaseStudent::getUserId, record.getUserId())
+                        .eq(BaseStudent::getDeleteMark, DeleteMark.NODELETE.getCode())
+        );
+        student.setIsNormal(1);
+        studentService.updateById(student);
+
+        User user = userService.getById(record.getUserId());
+        user.setEnabledMark(EnabledMark.ENABLED.getCode());
+        userService.updateById(user);
+        return true;
+    }
+
+    @Override
+    public Page<StudentReportRecordPlanPageVo> getPlanPage(Page<StudentReportRecordPlanPageVo> page, StudentReportRecordPageDto dto) {
+        return this.baseMapper.getPlanPage(page, dto);
+    }
+
+    @Override
+    public List<StudentReportRecordPlanPageVo> getPlanPageList(StudentReportRecordPageDto dto) {
+        return this.baseMapper.getPlanPageList(dto);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean allSgin(List<StudentReportSignDto> dtoList) {
+        for (StudentReportSignDto dto : dtoList) {
+            StudentReportRecord record = this.getById(dto.getId());
+            record.setModifyDate(new Date());
+            record.setUserId(StpUtil.getLoginIdAsLong());
+            record.setReportTime(new Date());
+            this.updateById(record);
+
+            BaseStudent student = studentService.getOne(
+                    new QueryWrapper<BaseStudent>().lambda()
+                            .eq(BaseStudent::getUserId, record.getUserId())
+                            .eq(BaseStudent::getDeleteMark, DeleteMark.NODELETE.getCode())
+            );
+            student.setIsNormal(1);
+            studentService.updateById(student);
+
+            User user = userService.getById(record.getUserId());
+            user.setEnabledMark(EnabledMark.ENABLED.getCode());
+            userService.updateById(user);
+        }
+        return true;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean updateStduyStatus(StudentReportSignDto dto) {
+        StudentReportRecord record = this.getById(dto.getId());
+        BaseStudentSchoolRoll roll = rollService.getOne(
+                new QueryWrapper<BaseStudentSchoolRoll>().lambda()
+                        .eq(BaseStudentSchoolRoll::getUserId, record.getUserId())
+                        .eq(BaseStudentSchoolRoll::getDeleteMark, DeleteMark.NODELETE.getCode())
+        );
+
+        String beforeDataCode = roll.getStduyStatus();
+        String beforeData = StudyStatusEnum.fromCode(beforeDataCode);
+
+
+        if(StudyStatusEnum.InResidence.getCode().equals(roll.getStduyStatus())){
+            roll.setStduyStatus(StudyStatusEnum.AttendDaySchool.getCode());
+        }else if(StudyStatusEnum.AttendDaySchool.getCode().equals(roll.getStduyStatus())){
+            roll.setStduyStatus(StudyStatusEnum.InResidence.getCode());
+        }
+        rollService.updateById(roll);
+
+        String afterDataCode = roll.getStduyStatus();
+        String afterData = StudyStatusEnum.fromCode(afterDataCode);
+
+        changeRecordService.insertData(
+                beforeDataCode, beforeData,
+                afterDataCode, afterData,
+                StpUtil.getLoginIdAsLong(), StpUtil.getLoginIdAsLong(),
+                StudentChangeTypeEnum.StduyStatus.getCode(), 3
+        );
+
+        return true;
     }
 }

+ 77 - 0
src/main/java/com/xjrsoft/module/student/vo/StudentReportRecordPlanPageVo.java

@@ -0,0 +1,77 @@
+package com.xjrsoft.module.student.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+* @title: 学生报到记录表分页列表出参
+* @Author dzx
+* @Date: 2024-08-28
+* @Version 1.0
+*/
+@Data
+public class StudentReportRecordPlanPageVo {
+
+    @ExcelIgnore
+    @ApiModelProperty("学生id")
+    private Long userId;
+
+    @ExcelIgnore
+    @ApiModelProperty("主键id")
+    private Long id;
+
+    @ExcelProperty("年级")
+    @ApiModelProperty("年级")
+    private String gradeName;
+
+
+    @ExcelProperty("班级")
+    @ApiModelProperty("班级")
+    private String className;
+
+    @ExcelProperty("班主任")
+    @ApiModelProperty("班主任")
+    private String teacherName;
+
+    @ExcelProperty("学生姓名")
+    @ApiModelProperty("学生姓名")
+    private String name;
+
+    @ExcelProperty("性别")
+    @ApiModelProperty("性别")
+    private String gender;
+
+    @ExcelProperty("身份证号")
+    @ApiModelProperty("身份证号")
+    private String credentialNumber;
+
+    @ExcelProperty("手机号")
+    @ApiModelProperty("手机号")
+    private String mobile;
+
+    @ExcelProperty("学生来源")
+    @ApiModelProperty("学生来源")
+    private String studentTypeCn;
+
+    @ExcelProperty("就读方式")
+    @ApiModelProperty("就读方式")
+    private String stduyStatusCn;
+
+    @ExcelProperty("学籍状态")
+    @ApiModelProperty("学籍状态")
+    private String archivesStatusCn;
+
+    @ExcelIgnore
+    @ApiModelProperty("是否已报到(1:是 0:否)")
+    private Integer isReport;
+
+    @ExcelProperty("报到时间")
+    @ApiModelProperty("报到时间")
+    private Date reportTime;
+
+}

+ 118 - 0
src/main/resources/mapper/student/StudentReportRecordMapper.xml

@@ -54,6 +54,124 @@
         </if>
         ORDER BY t1.create_date DESC, t2.create_date DESC,t3.create_date DESC,t1.id
     </select>
+    <select id="getPlanPage" parameterType="com.xjrsoft.module.student.dto.StudentReportRecordPageDto" resultType="com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo">
+        SELECT t1.id, t1.user_id, t4.name AS grade_name,t5.name AS class_name,t6.name AS teacher_name,
+        t3.name,t7.name AS gender,t3.credential_number,t3.mobile,t8.name AS student_type_cn,
+        t9.name AS stduy_status_cn,t10.name AS archives_status_cn,
+        t1.report_time,IF(t1.report_time IS NULL, 0, 1) as is_report FROM student_report_record t1
+        INNER JOIN base_student_school_roll t2 ON t1.user_id = t2.user_id
+        INNER JOIN xjr_user t3 ON t3.id = t1.user_id
+        LEFT JOIN base_grade t4 ON t2.grade_id = t4.id
+        LEFT JOIN base_class t5 ON t2.class_id = t5.id
+        LEFT JOIN xjr_user t6 ON t5.teacher_id = t6.id
+        LEFT JOIN xjr_dictionary_detail t7 ON t3.gender = t7.code
+        LEFT JOIN xjr_dictionary_detail t8 ON t2.student_type = t8.code
+        LEFT JOIN xjr_dictionary_detail t9 ON t2.stduy_status = t9.code
+        LEFT JOIN xjr_dictionary_detail t10 ON t2.archives_status = t10.code
+        WHERE t1.delete_mark = 0 AND t1.enabled_mark = 1
+        and t1.student_report_plan_id = #{dto.studentReportPlanId}
+        <if test="dto.keyword != null and dto.keyword != ''">
+            and t1.name like concat('%', #{dto.keyword},'%')
+        </if>
+        <if test="dto.classId != null">
+            and t5.id = #{dto.classId}
+        </if>
+        <if test="dto.gradeId != null">
+            and t4.id = #{dto.gradeId}
+        </if>
+        <if test="dto.name != null and dto.name != ''">
+            and t3.name like concat('%', #{dto.name}, '%')
+        </if>
+        <if test="dto.className != null and dto.className != ''">
+            and t5.name like concat('%', #{dto.className}, '%')
+        </if>
+        <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
+            and t3.credentialNumber like concat('%', #{dto.credentialNumber}, '%')
+        </if>
+        <if test="dto.archivesStatus != null and dto.archivesStatus != ''">
+            and t2.archives_status = #{dto.archivesStatus}
+        </if>
+        <if test="dto.stduyStatus != null and dto.stduyStatus != ''">
+            and t2.stduy_status = #{dto.stduyStatus}
+        </if>
+        <if test="dto.studentType != null and dto.studentType != ''">
+            and t2.student_type = #{dto.studentType}
+        </if>
+        <if test="dto.studentType != null and dto.studentType != ''">
+            and t2.student_type = #{dto.studentType}
+        </if>
+        <if test="dto.isReport != null">
+            <if test="dto.isReport == 1">
+                and t1.report_time is not null
+            </if>
+            <if test="dto.isReport == 0">
+                and t1.report_time is null
+            </if>
+        </if>
+        <if test="dto.reportTimeStart != null and dto.reportTimeEnd != null">
+            and t1.report_time between #{dto.reportTimeStart} and #{dto.reportTimeEnd}
+        </if>
+        ORDER BY t1.id desc
+    </select>
+    <select id="getPlanPageList" parameterType="com.xjrsoft.module.student.dto.StudentReportRecordPageDto" resultType="com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo">
+        SELECT t1.id, t1.user_id, t4.name AS grade_name,t5.name AS class_name,t6.name AS teacher_name,
+        t3.name,t7.name AS gender,t3.credential_number,t3.mobile,t8.name AS student_type_cn,
+        t9.name AS stduy_status_cn,t10.name AS archives_status_cn,
+        t1.report_time,IF(t1.report_time IS NULL, 0, 1) as is_report FROM student_report_record t1
+        INNER JOIN base_student_school_roll t2 ON t1.user_id = t2.user_id
+        INNER JOIN xjr_user t3 ON t3.id = t1.user_id
+        LEFT JOIN base_grade t4 ON t2.grade_id = t4.id
+        LEFT JOIN base_class t5 ON t2.class_id = t5.id
+        LEFT JOIN xjr_user t6 ON t5.teacher_id = t6.id
+        LEFT JOIN xjr_dictionary_detail t7 ON t3.gender = t7.code
+        LEFT JOIN xjr_dictionary_detail t8 ON t2.student_type = t8.code
+        LEFT JOIN xjr_dictionary_detail t9 ON t2.stduy_status = t9.code
+        LEFT JOIN xjr_dictionary_detail t10 ON t2.archives_status = t10.code
+        WHERE t1.delete_mark = 0 AND t1.enabled_mark = 1
+        and t1.student_report_plan_id = #{dto.studentReportPlanId}
+        <if test="dto.keyword != null and dto.keyword != ''">
+            and t1.name like concat('%', #{dto.keyword},'%')
+        </if>
+        <if test="dto.classId != null">
+            and t5.id = #{dto.classId}
+        </if>
+        <if test="dto.gradeId != null">
+            and t4.id = #{dto.gradeId}
+        </if>
+        <if test="dto.name != null and dto.name != ''">
+            and t3.name like concat('%', #{dto.name}, '%')
+        </if>
+        <if test="dto.className != null and dto.className != ''">
+            and t5.name like concat('%', #{dto.className}, '%')
+        </if>
+        <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
+            and t3.credentialNumber like concat('%', #{dto.credentialNumber}, '%')
+        </if>
+        <if test="dto.archivesStatus != null and dto.archivesStatus != ''">
+            and t2.archives_status = #{dto.archivesStatus}
+        </if>
+        <if test="dto.stduyStatus != null and dto.stduyStatus != ''">
+            and t2.stduy_status = #{dto.stduyStatus}
+        </if>
+        <if test="dto.studentType != null and dto.studentType != ''">
+            and t2.student_type = #{dto.studentType}
+        </if>
+        <if test="dto.studentType != null and dto.studentType != ''">
+            and t2.student_type = #{dto.studentType}
+        </if>
+        <if test="dto.isReport != null">
+            <if test="dto.isReport == 1">
+                and t1.report_time is not null
+            </if>
+            <if test="dto.isReport == 0">
+                and t1.report_time is null
+            </if>
+        </if>
+        <if test="dto.reportTimeStart != null and dto.reportTimeEnd != null">
+            and t1.report_time between #{dto.reportTimeStart} and #{dto.reportTimeEnd}
+        </if>
+        ORDER BY t1.id desc
+    </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 ,