肖玮 5 vuotta sitten
vanhempi
commit
6bf62d69a6
21 muutettua tiedostoa jossa 493 lisäystä ja 13 poistoa
  1. 52 0
      mec-education/src/main/java/com/ym/mec/education/controller/AttendClassController.java
  2. 8 0
      mec-education/src/main/java/com/ym/mec/education/controller/CourseScheduleController.java
  3. 12 0
      mec-education/src/main/java/com/ym/mec/education/controller/HomeWorkController.java
  4. 10 0
      mec-education/src/main/java/com/ym/mec/education/entity/StudentAttendance.java
  5. 1 1
      mec-education/src/main/java/com/ym/mec/education/mapper/CourseHomeworkMapper.java
  6. 10 0
      mec-education/src/main/java/com/ym/mec/education/mapper/StudentAttendanceMapper.java
  7. 51 0
      mec-education/src/main/java/com/ym/mec/education/req/AttendClassReq.java
  8. 59 0
      mec-education/src/main/java/com/ym/mec/education/resp/AttendClassResp.java
  9. 70 0
      mec-education/src/main/java/com/ym/mec/education/resp/CourseHomeworkResp.java
  10. 45 0
      mec-education/src/main/java/com/ym/mec/education/resp/CourseInfoResp.java
  11. 2 0
      mec-education/src/main/java/com/ym/mec/education/resp/HomeWrokResp.java
  12. 1 1
      mec-education/src/main/java/com/ym/mec/education/service/ICourseHomeworkService.java
  13. 10 0
      mec-education/src/main/java/com/ym/mec/education/service/ICourseScheduleService.java
  14. 7 0
      mec-education/src/main/java/com/ym/mec/education/service/IStudentAttendanceService.java
  15. 7 0
      mec-education/src/main/java/com/ym/mec/education/service/IStudentCourseHomeworkService.java
  16. 1 1
      mec-education/src/main/java/com/ym/mec/education/service/impl/ClassGroupStudentMapperServiceImpl.java
  17. 1 1
      mec-education/src/main/java/com/ym/mec/education/service/impl/CourseHomeworkServiceImpl.java
  18. 38 0
      mec-education/src/main/java/com/ym/mec/education/service/impl/CourseScheduleServiceImpl.java
  19. 27 0
      mec-education/src/main/java/com/ym/mec/education/service/impl/StudentAttendanceServiceImpl.java
  20. 47 0
      mec-education/src/main/java/com/ym/mec/education/service/impl/StudentCourseHomeworkServiceImpl.java
  21. 34 9
      mec-education/src/main/resources/mapper/StudentAttendanceMapper.xml

+ 52 - 0
mec-education/src/main/java/com/ym/mec/education/controller/AttendClassController.java

@@ -0,0 +1,52 @@
+package com.ym.mec.education.controller;
+
+import com.ym.mec.education.base.BaseResponse;
+import com.ym.mec.education.base.PageResponse;
+import com.ym.mec.education.req.AttendClassReq;
+import com.ym.mec.education.service.IStudentAttendanceService;
+import io.swagger.annotations.Api;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author : chengp
+ * @version V1.0
+ * @Description: TODO
+ * @date Date : 2019年10月07日 10:08
+ */
+@RestController
+@RequestMapping("api/attendClass")
+@Api(tags = "上课记录")
+@Slf4j
+public class AttendClassController {
+
+    @Autowired
+    private IStudentAttendanceService studentAttendanceService;
+    /**
+     * 服务降级处理
+     *
+     * @return
+     */
+    private BaseResponse defaultFallback() {
+        BaseResponse response = new BaseResponse();
+        response.setReturnCode(500);
+        response.setMessage("太拥挤了, 请稍后再试!");
+        return response;
+    }
+
+
+    /**
+     *
+     * @param req
+     * @return
+     */
+    @PostMapping(value = "/attendRecord")
+    public PageResponse attendRecord(@RequestBody AttendClassReq req) {
+
+        return  studentAttendanceService.attendRecordList(req);
+    }
+}

+ 8 - 0
mec-education/src/main/java/com/ym/mec/education/controller/CourseScheduleController.java

@@ -49,4 +49,12 @@ public class CourseScheduleController {
     public BaseResponse getStatisticsInfo(@RequestBody ClassGroupReq classGroupReq) {
         return courseScheduleService.getStatisticsInfo(classGroupReq);
     }
+
+
+    @PostMapping("/courseInfo")
+    @ApiOperation("课程详情-头信息")
+    public BaseResponse<CourseScheduleResp> courseInfo(@RequestBody CourseScheduleReq courseScheduleReq) {
+        return courseScheduleService.courseInfo(courseScheduleReq);
+    }
+
 }

+ 12 - 0
mec-education/src/main/java/com/ym/mec/education/controller/HomeWorkController.java

@@ -86,4 +86,16 @@ public class HomeWorkController {
         }
         return studentCourseHomeworkService.getHomeWorkDetail(req);
     }
+
+
+    /**
+     *
+     * @param req
+     * @return
+     */
+    @PostMapping(value = "/homeWorkList")
+    public PageResponse homeWorkList(@RequestBody HomeWorkReq req) {
+
+       return studentCourseHomeworkService.homeWorkList(req);
+    }
 }

+ 10 - 0
mec-education/src/main/java/com/ym/mec/education/entity/StudentAttendance.java

@@ -58,6 +58,16 @@ public class StudentAttendance extends Model<StudentAttendance> {
     @TableField("remark_")
     private String remark;
 
+    @TableField("current_class_times_")
+    private Integer currentClassTimes;
+
+    public Integer getCurrentClassTimes() {
+        return currentClassTimes;
+    }
+
+    public void setCurrentClassTimes(Integer currentClassTimes) {
+        this.currentClassTimes = currentClassTimes;
+    }
 
     public Long getId() {
         return id;

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/mapper/CourseHomeworkMapper.java

@@ -1,7 +1,7 @@
 package com.ym.mec.education.mapper;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ym.mec.education.entity.CourseHomework;
-import com.baomidou.mybatisplus.mapper.BaseMapper;
 
 /**
  * <p>

+ 10 - 0
mec-education/src/main/java/com/ym/mec/education/mapper/StudentAttendanceMapper.java

@@ -1,7 +1,11 @@
 package com.ym.mec.education.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ym.mec.education.entity.StudentAttendance;
+import com.ym.mec.education.req.AttendClassReq;
+import com.ym.mec.education.resp.AttendClassResp;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * <p>
@@ -13,4 +17,10 @@ import com.ym.mec.education.entity.StudentAttendance;
  */
 public interface StudentAttendanceMapper extends BaseMapper<StudentAttendance> {
 
+    /**
+     *学生上课记录
+     * @param page
+     * @return
+     */
+    Page<AttendClassResp> selectPageByCondition(Page page, @Param("query") AttendClassReq req);
 }

+ 51 - 0
mec-education/src/main/java/com/ym/mec/education/req/AttendClassReq.java

@@ -0,0 +1,51 @@
+package com.ym.mec.education.req;
+
+/**
+ * @version V1.0
+ * @Description: TODO
+ * @date Date : 2019年10月07日 9:43
+ */
+
+import com.ym.mec.education.base.BaseQuery;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+
+/**
+ * |上课记录
+ */
+@Data
+@ToString
+public class AttendClassReq extends BaseQuery implements Serializable {
+    @ApiModelProperty(value = "月份", required = false)
+    private String months;
+    @ApiModelProperty(value = "类型1.已上课,2 未上课", required = true)
+    private String type;
+    /**
+     * 	NORMAL("NORMAL", "普通班级"),
+     * 	MIX("MIX", "合奏班级"),
+     * 	HIGH("HIGH", "提高班"),
+     * 	VIP("VIP", "vip课"),
+     * 	DEMO("demo", "试听课");
+     */
+    @ApiModelProperty(value = "课程类型", required = false)
+    private String classType;
+
+    /**
+     * 到课状态
+     */
+    @ApiModelProperty(value = "到课情况", required = false)
+    /**
+     *     NOT_START("NOT_START","未开始"),
+     *     UNDERWAY("UNDERWAY","进行中"),
+     *     OVER("OVER","已结束");
+     */
+    private String status;
+
+    /**
+     * 学生id
+     */
+    private Integer userId;
+}

+ 59 - 0
mec-education/src/main/java/com/ym/mec/education/resp/AttendClassResp.java

@@ -0,0 +1,59 @@
+package com.ym.mec.education.resp;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author : chengp
+ * @version V1.0
+ * @Description: TODO
+ * @date Date : 2019年10月07日 9:43
+ */
+
+@Data
+@ToString
+@ApiModel(description = "上课记录出参")
+public class AttendClassResp implements Serializable {
+
+    @ApiModelProperty(value = "剩余课程数")
+    private Integer subClassNum;
+    @ApiModelProperty(value = "上课状态")
+    private String status;
+    @ApiModelProperty(value = "日期")
+    private String dateStr;
+    @ApiModelProperty(value = "开始时间")
+    private String startTime;
+    @ApiModelProperty(value = "结束时间")
+    private String endTime;
+
+    @ApiModelProperty(value = "线上,线下")
+    private String teachMode;
+    @ApiModelProperty(value = "课程名")
+    private String className;
+    @ApiModelProperty(value = "星期")
+    private String week;
+
+    private Integer musicGroupId;
+    private Integer classGroupId;
+    private Integer userId;
+    private Integer teacherId;
+    private String type;//vip 普通课
+    private String name;//乐团名
+    private String courseName;//课程名
+    @ApiModelProperty(value = "老师名")
+    private String realName;
+
+
+    private Date startClassTime;
+    private Date endClassTime;
+    private Date classDate;//课表日期
+
+    private Integer totalClassTimes;
+
+    private Integer currentclassTimes;
+}

+ 70 - 0
mec-education/src/main/java/com/ym/mec/education/resp/CourseHomeworkResp.java

@@ -0,0 +1,70 @@
+package com.ym.mec.education.resp;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 课程作业表
+ * </p>
+ *
+ * @author lemeng
+ * @since 2019-09-25
+ */
+@ToString
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class CourseHomeworkResp implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+    private Long courseScheduleId;
+    /**
+     * 附件地址(多个用逗号分隔)
+     */
+    private String attachments;
+    /**
+     * 作业内容
+     */
+    private String content;
+    private Date createTime;
+    private Date updateTime;
+    private Integer musicGroupId;
+    private Integer classGroupId;
+    /**
+     * 截止日期
+     */
+    private Date expiryDate;
+    /**
+     * 完成人数
+     */
+    private Integer completedNum;
+    /**
+     * 预计人数
+     */
+    private Integer expectNum;
+
+    private String courseName;
+
+    /**
+     * 总课时
+     */
+    private Integer totalClassTimes;
+    /**
+     * 当前
+     */
+    private Integer currentClassTimes;
+
+
+
+
+
+}

+ 45 - 0
mec-education/src/main/java/com/ym/mec/education/resp/CourseInfoResp.java

@@ -0,0 +1,45 @@
+package com.ym.mec.education.resp;
+
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 课程作业表
+ * </p>
+ *
+ * @author lemeng
+ * @since 2019-09-25
+ */
+@ToString
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class CourseInfoResp implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+    private Long courseScheduleId;
+    //课程名s
+    private String courseName;
+    //老师名
+    private String realName;
+
+
+    private String startClassTime;
+    private String endClassTime;
+    //课表日期
+    private String classDate;
+
+    private String week;
+
+    private String schoolName;
+}

+ 2 - 0
mec-education/src/main/java/com/ym/mec/education/resp/HomeWrokResp.java

@@ -41,4 +41,6 @@ public class HomeWrokResp implements Serializable {
     private Long id;
 
     private Long courseHomeworkId;
+
+    private String content;
 }

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/service/ICourseHomeworkService.java

@@ -1,7 +1,7 @@
 package com.ym.mec.education.service;
 
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.ym.mec.education.entity.CourseHomework;
-import com.baomidou.mybatisplus.service.IService;
 
 /**
  * <p>

+ 10 - 0
mec-education/src/main/java/com/ym/mec/education/service/ICourseScheduleService.java

@@ -49,4 +49,14 @@ public interface ICourseScheduleService extends IService<CourseSchedule> {
      * @return
      */
     BaseResponse getCourseScheduleByStudent(StudentReq studentReq);
+
+
+    /**
+     * 根据课程计划id获取课程计划详情
+     * @param courseScheduleReq
+     * @return
+     */
+    BaseResponse courseInfo(CourseScheduleReq courseScheduleReq);
+
+
 }

+ 7 - 0
mec-education/src/main/java/com/ym/mec/education/service/IStudentAttendanceService.java

@@ -3,6 +3,7 @@ package com.ym.mec.education.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ym.mec.education.base.PageResponse;
 import com.ym.mec.education.entity.StudentAttendance;
+import com.ym.mec.education.req.AttendClassReq;
 import com.ym.mec.education.req.ClassGroupReq;
 import com.ym.mec.education.req.CourseScheduleReq;
 
@@ -33,4 +34,10 @@ public interface IStudentAttendanceService extends IService<StudentAttendance> {
      */
     PageResponse statisticsList(ClassGroupReq classGroupReq);
 
+    /**
+     * 学员上课记录
+     * @param req
+     * @return
+     */
+    PageResponse attendRecordList(AttendClassReq req);
 }

+ 7 - 0
mec-education/src/main/java/com/ym/mec/education/service/IStudentCourseHomeworkService.java

@@ -20,4 +20,11 @@ public interface IStudentCourseHomeworkService extends IService<StudentCourseHom
     PageResponse workList(HomeWorkReq req);
 
     BaseResponse getHomeWorkDetail(HomeWorkDetailReq req);
+
+    /**
+     * 学员列表 作业列表
+     * @param req
+     * @return
+     */
+    PageResponse homeWorkList(HomeWorkReq req);
 }

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/service/impl/ClassGroupStudentMapperServiceImpl.java

@@ -221,7 +221,7 @@ public class ClassGroupStudentMapperServiceImpl extends ServiceImpl<ClassGroupSt
             sysUserQueryWrapper.lambda().in(SysUser::getId,
                 classGroupStudentMapperList.stream().map(ClassGroupStudentMapper::getUserId).collect(Collectors.toList()))
                 .like(SysUser::getRealName, studentReq.getStudentName());
-            Page<SysUser> sysUserPage = new Page<>(studentReq.getPageNo(), studentReq.getPageSize());
+            Page<SysUser> sysUserPage = new Page<SysUser>(studentReq.getPageNo(), studentReq.getPageSize());
             IPage<SysUser> page = sysUserService.page(sysUserPage, sysUserQueryWrapper);
             if (!CollectionUtils.isEmpty(page.getRecords())) {
                 BeanUtils.copyProperties(page, pageResult);

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/service/impl/CourseHomeworkServiceImpl.java

@@ -1,9 +1,9 @@
 package com.ym.mec.education.service.impl;
 
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ym.mec.education.entity.CourseHomework;
 import com.ym.mec.education.mapper.CourseHomeworkMapper;
 import com.ym.mec.education.service.ICourseHomeworkService;
-import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
 /**

+ 38 - 0
mec-education/src/main/java/com/ym/mec/education/service/impl/CourseScheduleServiceImpl.java

@@ -16,6 +16,7 @@ import com.ym.mec.education.mapper.CourseScheduleMapper;
 import com.ym.mec.education.req.ClassGroupReq;
 import com.ym.mec.education.req.CourseScheduleReq;
 import com.ym.mec.education.req.StudentReq;
+import com.ym.mec.education.resp.CourseInfoResp;
 import com.ym.mec.education.resp.CourseScheduleResp;
 import com.ym.mec.education.resp.StudentResp;
 import com.ym.mec.education.service.*;
@@ -294,4 +295,41 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
         }
         return Collections.emptyList();
     }
+
+    @Override
+    public BaseResponse courseInfo(CourseScheduleReq courseScheduleReq) {
+
+
+        if(courseScheduleReq.getCourseScheduleId() == null){
+            return BaseResponse.failParams();
+        }
+        CourseInfoResp resp = new CourseInfoResp();
+        CourseSchedule courseSchedule = this.baseMapper.selectById(courseScheduleReq.getCourseScheduleId());
+        if(courseSchedule != null){
+            resp.setCourseName(courseSchedule.getName());
+            resp.setClassDate(DateUtil.date2String(courseSchedule.getClassDate(),DateUtil.DATE_FORMAT));
+            resp.setCourseScheduleId(courseSchedule.getId());
+            resp.setStartClassTime(DateUtil.date2String(courseSchedule.getStartClassTime(),DateUtil.TIME_FORMAT));
+            resp.setEndClassTime(DateUtil.date2String(courseSchedule.getEndClassTime(),DateUtil.TIME_FORMAT));
+            resp.setWeek(DateUtil.date2Week(courseSchedule.getClassDate()));
+
+            SysUser sysUser = sysUserService.getById(courseSchedule.getTeacherId());
+            if(sysUser != null){
+                resp.setRealName(sysUser.getRealName());
+            }
+            ClassGroup classGroup = groupService.getById(courseSchedule.getClassGroupId());
+            if(classGroup != null){
+                MusicGroup musicGroup = musicGroupService.getById(courseSchedule.getClassGroupId());
+                if(musicGroup != null && musicGroup.getSchoolId()!= null){
+                    School school = schoolService.getById(musicGroup.getSchoolId());
+                    if(school != null){
+                        resp.setSchoolName(school.getName());
+                    }
+                }
+            }
+
+
+        }
+        return BaseResponse.success(resp);
+    }
 }

+ 27 - 0
mec-education/src/main/java/com/ym/mec/education/service/impl/StudentAttendanceServiceImpl.java

@@ -9,8 +9,10 @@ import com.ym.mec.education.base.PageResponse;
 import com.ym.mec.education.entity.*;
 import com.ym.mec.education.enums.StudentAttendanceStatusEnum;
 import com.ym.mec.education.mapper.StudentAttendanceMapper;
+import com.ym.mec.education.req.AttendClassReq;
 import com.ym.mec.education.req.ClassGroupReq;
 import com.ym.mec.education.req.CourseScheduleReq;
+import com.ym.mec.education.resp.AttendClassResp;
 import com.ym.mec.education.resp.StudentAttendanceResp;
 import com.ym.mec.education.resp.StudentAttendanceStatisticsResp;
 import com.ym.mec.education.service.*;
@@ -216,4 +218,29 @@ public class StudentAttendanceServiceImpl extends ServiceImpl<StudentAttendanceM
         }
         return PageResponse.success(pageResult);
     }
+
+    @Override
+    public PageResponse attendRecordList(AttendClassReq req) {
+
+        PageResponse<AttendClassResp> response = new PageResponse();
+        Page<StudentAttendance> pageParam = new Page(req.getPageNo(), req.getPageSize());
+
+        Page<AttendClassResp>  attendClassRespPage = this.baseMapper.selectPageByCondition(pageParam,req);
+
+        List<AttendClassResp> respList = attendClassRespPage.getRecords();
+        if(!CollectionUtils.isEmpty(respList)){
+
+            respList.forEach(e->{
+
+                e.setDateStr(DateUtil.date2String(e.getClassDate(),DateUtil.DATE_FORMAT));
+                e.setStartTime(DateUtil.date2String(e.getStartClassTime(),DateUtil.TIME_FORMAT));
+                e.setEndTime(DateUtil.date2String(e.getEndClassTime(),DateUtil.TIME_FORMAT));
+                e.setWeek(DateUtil.date2Week(e.getClassDate()));
+            });
+
+
+        }
+        return PageResponse.success(pageParam);
+    }
+
 }

+ 47 - 0
mec-education/src/main/java/com/ym/mec/education/service/impl/StudentCourseHomeworkServiceImpl.java

@@ -11,6 +11,7 @@ import com.ym.mec.education.enums.ReturnCodeEnum;
 import com.ym.mec.education.mapper.StudentCourseHomeworkMapper;
 import com.ym.mec.education.req.HomeWorkDetailReq;
 import com.ym.mec.education.req.HomeWorkReq;
+import com.ym.mec.education.resp.CourseHomeworkResp;
 import com.ym.mec.education.resp.HomeWrokDetailResp;
 import com.ym.mec.education.resp.HomeWrokResp;
 import com.ym.mec.education.resp.HomeworkReplyResp;
@@ -49,6 +50,12 @@ public class StudentCourseHomeworkServiceImpl extends ServiceImpl<StudentCourseH
     @Autowired
     private IStudentCourseHomeworkReplyService studentCourseHomeworkReplyService;
 
+    @Autowired
+    private ICourseScheduleService courseScheduleService;
+
+    @Autowired
+    private ICourseHomeworkService courseHomeworkService;
+
     @Override
     public PageResponse workList(HomeWorkReq req) {
 
@@ -144,4 +151,44 @@ public class StudentCourseHomeworkServiceImpl extends ServiceImpl<StudentCourseH
         }
         return BaseResponse.success(resp);
     }
+
+    /**
+     * 作业列表
+     * @param req
+     * @return
+     */
+    @Override
+    public PageResponse homeWorkList(HomeWorkReq req) {
+        PageResponse response = new PageResponse();
+        IPage ipage = new Page(req.getPageNo() == null ? 1: req.getPageNo(),req.getPageSize() == null ? 10:req.getPageSize());
+        QueryWrapper<CourseHomework> queryWrapper = new QueryWrapper<>();
+        IPage<CourseHomework> courseScheduleIPage = courseHomeworkService.page(ipage,queryWrapper);
+
+        List<CourseHomework> courseSchedules = courseScheduleIPage.getRecords();
+        List<CourseHomeworkResp> courseHomeworkRespList = new ArrayList<>();
+        if(!CollectionUtils.isEmpty(courseSchedules)){
+            courseSchedules.forEach(e ->{
+                CourseHomeworkResp resp = new CourseHomeworkResp();
+                BeanUtils.copyProperties(e,resp);
+                CourseSchedule courseSchedule =  courseScheduleService.getById(e.getCourseScheduleId());
+                if(courseSchedule != null){
+                    resp.setCourseName(courseSchedule.getName());
+
+                }
+                ClassGroup classGroup = classGroupService.getById(e.getClassGroupId());
+                if(classGroup != null){
+                    resp.setTotalClassTimes(classGroup.getTotalClassTimes());
+                    resp.setCurrentClassTimes(classGroup.getCurrentClassTimes());
+                }
+                courseHomeworkRespList.add(resp);
+            });
+        }
+        response.setRecords(courseHomeworkRespList);
+        response.setTotal(Math.toIntExact(courseScheduleIPage.getTotal()));
+        response.setCurrent(Math.toIntExact(courseScheduleIPage.getCurrent()));
+        response.setSize(Math.toIntExact(courseScheduleIPage.getSize()));
+        response.setReturnCode(ReturnCodeEnum.CODE_200.getCode());
+        response.setMessage(ReturnCodeEnum.CODE_200.getValue());
+        return response;
+    }
 }

+ 34 - 9
mec-education/src/main/resources/mapper/StudentAttendanceMapper.xml

@@ -4,20 +4,45 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.ym.mec.education.entity.StudentAttendance">
-        <id column="id_" property="id" />
-        <result column="music_group_id_" property="musicGroupId" />
-        <result column="class_group_id_" property="classGroupId" />
-        <result column="course_schedule_id_" property="courseScheduleId" />
-        <result column="user_id_" property="userId" />
-        <result column="teacher_id_" property="teacherId" />
-        <result column="status_" property="status" />
-        <result column="create_time_" property="createTime" />
-        <result column="remark_" property="remark" />
+        <id column="id_" property="id"/>
+        <result column="music_group_id_" property="musicGroupId"/>
+        <result column="class_group_id_" property="classGroupId"/>
+        <result column="course_schedule_id_" property="courseScheduleId"/>
+        <result column="user_id_" property="userId"/>
+        <result column="teacher_id_" property="teacherId"/>
+        <result column="status_" property="status"/>
+        <result column="create_time_" property="createTime"/>
+        <result column="remark_" property="remark"/>
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
         id_, music_group_id_, class_group_id_, course_schedule_id_, user_id_, teacher_id_, status_, create_time_, remark_
     </sql>
+    <select id="selectPageByCondition" parameterType="com.ym.mec.education.req.AttendClassReq"
+            resultType="com.ym.mec.education.resp.AttendClassResp">
 
+     SELECT
+	s.music_group_id_,s.class_group_id_,s.user_id_,s.teacher_id_,s.current_class_times_,s.status_,g.name_,g.total_class_times_,g.type_,g.teach_mode_,u.real_name_,c.name_ as courseName,c.class_date_,c.start_class_time_,c.end_class_time_
+    FROM
+	student_attendance s
+    LEFT JOIN course_schedule c
+    ON s.course_schedule_id_ = c.id_
+    LEFT JOIN class_group g on g.id_ = s.class_group_id_
+    LEFT JOIN sys_user u on u.id_ = c.teacher_id_
+    LEFT JOIN class_group_student_mapper m ON m.class_group_id_ = g.id_
+        WHERE
+     m.user_id_ = #{query.userId}
+       <if test="query.months != null">
+          and DATE_FORMAT(s.create_time_, '%Y-%m') = #{query.months}
+        </if>
+        <if test="query.status != null">
+            AND c.status_ = #{query.status}
+        </if>
+
+        <if test="query.classType != null">
+            and g.type_ = #{query.classType}
+        </if>
+
+    </select>
 </mapper>