Bläddra i källkod

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

# Conflicts:
#	mec-biz/src/main/java/com/ym/mec/biz/service/impl/DemoGroupServiceImpl.java
zouxuan 6 år sedan
förälder
incheckning
717e75a31b

+ 27 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -3,12 +3,13 @@ package com.ym.mec.biz.dal.dao;
 import com.ym.mec.biz.dal.dto.CourseScheduleDto;
 import com.ym.mec.biz.dal.dto.TeacherAttendanceDto;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.entity.StudentCourseScheduleRecordDto;
 import com.ym.mec.common.dal.BaseDAO;
-
 import org.apache.ibatis.annotations.Param;
 
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
 
@@ -73,7 +74,8 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
      * 获取学生有课日期
      */
     List<Date> getStudentCourseScheduleDate(@Param("studentId") Long studentId,
-                                            @Param("month") Date month);
+                                            @Param("month") Date month,
+                                            @Param("isAttend") Integer isAttend);
 
     /**
      * @Author: Joburgess
@@ -130,9 +132,31 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
 
     /**
      * 获取班级的课程计划
-     *
      * @param classGroupList
      * @return
      */
     List<CourseSchedule> findClassGroupCourseSchedules(@Param("classGroupList") List classGroupList);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/30
+     * 获取学生上课记录
+     */
+    List<StudentCourseScheduleRecordDto> findStudentCourseScheduleRecords(Map<String,Object> params);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/30
+     * 统计学生上课记录
+     */
+    int countStudentCourseScheduleRecords(Map<String,Object> params);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/30
+     * 获取学生未上课记录
+     */
+    List<StudentCourseScheduleRecordDto> findStudentCourseScheduleNotStartRecords(@Param("userId") Long userId,
+                                                                                  @Param("date") Date date);
+
 }

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/DemoGroupCoursesPlanDao.java

@@ -15,6 +15,7 @@ public interface DemoGroupCoursesPlanDao extends BaseDAO<Long, DemoGroupCoursesP
      * 根据上课时间批量记录临时上课计划
      */
     int batchInsertByDates(@Param("dates") List<Date> dates,
-                           @Param("demoGroupId") Long demoGroupId);
+                           @Param("demoGroupId") Long demoGroupId,
+                           @Param("classMinutes") Integer classMinutes);
 	
 }

+ 10 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/DemoGroupDao.java

@@ -33,13 +33,22 @@ public interface DemoGroupDao extends BaseDAO<Long, DemoGroup> {
      * @Date: 2019/9/25
      * 根据试听课信息构造课程计划
      */
-    List<CourseSchedule> createCourseScheduleByDemoGroup(@Param("demoGroup") DemoGroup demoGroup,
+    List<CourseSchedule> createCourseSchedulesByDemoGroup(@Param("demoGroup") DemoGroup demoGroup,
                                                          @Param("startTime") Date startTime,
                                                          @Param("classGroupId") Long classGroupId);
 
     /**
      * @Author: Joburgess
      * @Date: 2019/9/25
+     * 根据试听课信息构造课程计划
+     */
+    CourseSchedule createCourseScheduleByDemoGroupPlan(@Param("demoGroup") DemoGroup demoGroup,
+                                                         @Param("coursePlanId") Long coursePlanId,
+                                                         @Param("classGroupId") Long classGroupId);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/25
      * 统计乐团已报名人数
      */
     Integer countDemoGroupStudents(Long demoGroupId);

+ 35 - 11
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/DemoGroupCoursesPlan.java

@@ -4,6 +4,8 @@ import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
+import java.util.Date;
+
 /**
  * 对应数据库表(demo_group_courses_plan):
  */
@@ -14,9 +16,15 @@ public class DemoGroupCoursesPlan {
 	
 	/**  */
 	private Long demoGroupId;
-	
-	/**  */
-	private java.util.Date coursesStartTime;
+
+	@ApiModelProperty(value = "上课日期")
+	private Date courseDate;
+
+	@ApiModelProperty(value = "上课时间")
+	private Date startTime;
+
+	@ApiModelProperty(value = "结束时间")
+	private Date endTime;
 	
 	/**  */
 	private java.util.Date createTime;
@@ -24,6 +32,30 @@ public class DemoGroupCoursesPlan {
 	@ApiModelProperty(value = "预约状态",required = false)
 	private YesOrNoEnum status;
 
+	public Date getCourseDate() {
+		return courseDate;
+	}
+
+	public void setCourseDate(Date courseDate) {
+		this.courseDate = courseDate;
+	}
+
+	public Date getStartTime() {
+		return startTime;
+	}
+
+	public void setStartTime(Date startTime) {
+		this.startTime = startTime;
+	}
+
+	public Date getEndTime() {
+		return endTime;
+	}
+
+	public void setEndTime(Date endTime) {
+		this.endTime = endTime;
+	}
+
 	public YesOrNoEnum getStatus() {
 		return status;
 	}
@@ -48,14 +80,6 @@ public class DemoGroupCoursesPlan {
 		return this.demoGroupId;
 	}
 			
-	public void setCoursesStartTime(java.util.Date coursesStartTime){
-		this.coursesStartTime = coursesStartTime;
-	}
-	
-	public java.util.Date getCoursesStartTime(){
-		return this.coursesStartTime;
-	}
-			
 	public void setCreateTime(java.util.Date createTime){
 		this.createTime = createTime;
 	}

+ 138 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentCourseScheduleRecordDto.java

@@ -0,0 +1,138 @@
+package com.ym.mec.biz.dal.entity;
+
+import com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/9/30
+ */
+public class StudentCourseScheduleRecordDto {
+
+
+    @ApiModelProperty(value = "记录编号",required = false)
+    private Long id;
+
+    @ApiModelProperty(value = "课程ID")
+    private Long courseScheduleId;
+
+    @ApiModelProperty(value = "课程名称",required = false)
+    private String courseName;
+
+    /** 上课日期 */
+    @ApiModelProperty(value = "上课日期", required = false)
+    private java.util.Date classDate;
+
+    /** 上课时间 */
+    @ApiModelProperty(value = "上课时间", required = false)
+    private java.util.Date startClassTime;
+
+    /** 结束时间 */
+    @ApiModelProperty(value = "结束时间", required = false)
+    private java.util.Date endClassTime;
+
+    @ApiModelProperty(value = "课程类型",required = false)
+    private CourseSchedule.CourseScheduleType type;
+
+    @ApiModelProperty(value = "状态(正常、旷课、请假、休学)",required = false)
+    private StudentAttendanceStatusEnum status;
+
+    @ApiModelProperty(value = "教师ID")
+    private Long teacherId;
+
+    @ApiModelProperty(value = "教师名称",required = false)
+    private String teacherName;
+
+    @ApiModelProperty(value = "剩余课次",required = false)
+    private Integer restOfClass;
+
+    public Long getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Long teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public Long getCourseScheduleId() {
+        return courseScheduleId;
+    }
+
+    public void setCourseScheduleId(Long courseScheduleId) {
+        this.courseScheduleId = courseScheduleId;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+
+    public Date getClassDate() {
+        return classDate;
+    }
+
+    public void setClassDate(Date classDate) {
+        this.classDate = classDate;
+    }
+
+    public Date getStartClassTime() {
+        return startClassTime;
+    }
+
+    public void setStartClassTime(Date startClassTime) {
+        this.startClassTime = startClassTime;
+    }
+
+    public Date getEndClassTime() {
+        return endClassTime;
+    }
+
+    public void setEndClassTime(Date endClassTime) {
+        this.endClassTime = endClassTime;
+    }
+
+    public CourseSchedule.CourseScheduleType getType() {
+        return type;
+    }
+
+    public void setType(CourseSchedule.CourseScheduleType type) {
+        this.type = type;
+    }
+
+    public StudentAttendanceStatusEnum getStatus() {
+        return status;
+    }
+
+    public void setStatus(StudentAttendanceStatusEnum status) {
+        this.status = status;
+    }
+
+    public String getTeacherName() {
+        return teacherName;
+    }
+
+    public void setTeacherName(String teacherName) {
+        this.teacherName = teacherName;
+    }
+
+    public Integer getRestOfClass() {
+        return restOfClass;
+    }
+
+    public void setRestOfClass(Integer restOfClass) {
+        this.restOfClass = restOfClass;
+    }
+}

+ 80 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentCourseScheduleRecordQueryInfo.java

@@ -0,0 +1,80 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/9/30
+ */
+public class StudentCourseScheduleRecordQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "上课方式")
+    private String teachMode;
+
+    @ApiModelProperty(value = "课程类型")
+    private String type;
+
+    @ApiModelProperty(value = "考勤状态")
+    private String status;
+
+    @ApiModelProperty(value = "用户ID")
+    private Long userId;
+
+    @ApiModelProperty(value = "上课日期")
+    private Date date;
+
+    @ApiModelProperty(value = "是否是未上课时")
+    private YesOrNoEnum isAttend;
+
+    public Date getDate() {
+        return date;
+    }
+
+    public void setDate(Date date) {
+        this.date = date;
+    }
+
+    public YesOrNoEnum getIsAttend() {
+        return isAttend;
+    }
+
+    public void setIsAttend(YesOrNoEnum isAttend) {
+        this.isAttend = isAttend;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public String getTeachMode() {
+        return teachMode;
+    }
+
+    public void setTeachMode(String teachMode) {
+        this.teachMode = teachMode;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+}

+ 10 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleService.java

@@ -4,6 +4,7 @@ import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
 import com.ym.mec.biz.dal.dto.CourseScheduleDto;
 import com.ym.mec.biz.dal.dto.TeacherAttendanceDto;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
 import com.ym.mec.common.service.BaseService;
 
 import java.util.Date;
@@ -65,7 +66,7 @@ public interface CourseScheduleService extends BaseService<Long, CourseSchedule>
      * @Date: 2019/9/17
      * 根据学生获取乐团在该月有课的日期
      */
-    List<Date> getCourseScheduleDateByStudent(Date month);
+    List<Date> getCourseScheduleDateByStudent(Date month, Integer isAttend);
 
     /**
      * @Author: Joburgess
@@ -95,4 +96,12 @@ public interface CourseScheduleService extends BaseService<Long, CourseSchedule>
      * @return
      */
     List<CourseSchedule> findClassGroupCourseSchedules(List classGroupList);
+
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/30
+     * 获取学生上课记录
+     */
+    Object findStudentCourseScheduleRecords(StudentCourseScheduleRecordQueryInfo queryInfo);
 }

+ 44 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -8,11 +8,16 @@ import com.ym.mec.biz.dal.dto.CourseScheduleDto;
 import com.ym.mec.biz.dal.dto.TeacherAttendanceDto;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.enums.ParamEnum;
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
+import org.apache.commons.lang.time.DateUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -69,9 +74,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	}
 
 	@Override
-	public List<Date> getCourseScheduleDateByStudent(Date month) {
+	public List<Date> getCourseScheduleDateByStudent(Date month, Integer isAttend) {
 		SysUser user = sysUserFeignService.queryUserInfo();
-		return courseScheduleDao.getStudentCourseScheduleDate(user.getId().longValue(),month);
+		return courseScheduleDao.getStudentCourseScheduleDate(user.getId().longValue(),month,isAttend);
 	}
 
 	@Override
@@ -172,6 +177,15 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	@Transactional(rollbackFor = Exception.class)
 	@Override
 	public void classStartDateAdjust(ClassDateAdjustDto classDateAdjustDto) {
+
+		CourseSchedule nowCourseSchedule = courseScheduleDao.get(classDateAdjustDto.getId());
+		if(DateUtils.isSameDay(nowCourseSchedule.getClassDate(),classDateAdjustDto.getClassDate())&&
+				DateUtils.isSameDay(nowCourseSchedule.getStartClassTime(),classDateAdjustDto.getStartClassTime())&&
+				DateUtils.isSameDay(nowCourseSchedule.getEndClassTime(),classDateAdjustDto.getEndClassTime())){
+			courseScheduleDao.update(classDateAdjustDto);
+			return;
+		}
+
 		//单次调整课时
 		if(null==classDateAdjustDto.getAdjustStartTime()&&null==classDateAdjustDto.getAdjustEndTime()){
 			ArrayList<Date> dates = new ArrayList<>();
@@ -288,4 +302,32 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		courseScheduleDao.batchAddCourseSchedules(courseSchedules);
 	}
 
+	@Override
+	public Object findStudentCourseScheduleRecords(StudentCourseScheduleRecordQueryInfo queryInfo) {
+		SysUser user = sysUserFeignService.queryUserInfo();
+		queryInfo.setUserId(user.getId().longValue());
+		PageInfo pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+
+		if(queryInfo.getIsAttend()== YesOrNoEnum.YES){
+			pageInfo.setRows(courseScheduleDao.findStudentCourseScheduleNotStartRecords(user.getId().longValue(),
+					queryInfo.getDate()));
+			return pageInfo;
+		}
+
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List dataList = null;
+		int count = courseScheduleDao.countStudentCourseScheduleRecords(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = courseScheduleDao.findStudentCourseScheduleRecords(params);
+		}
+		if (count == 0) {
+			dataList = new ArrayList<>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
 }

+ 15 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/DemoGroupServiceImpl.java

@@ -48,7 +48,6 @@ public class DemoGroupServiceImpl extends BaseServiceImpl<Long, DemoGroup>  impl
 	@Autowired
 	private SubjectDao subjectDao;
 
-
 	@Override
 	public BaseDAO<Long, DemoGroup> getDAO() {
 		return demoGroupDao;
@@ -65,7 +64,9 @@ public class DemoGroupServiceImpl extends BaseServiceImpl<Long, DemoGroup>  impl
 
 		demoGroupApplyDto.setUserId(user.getId());
 		demoGroupDao.insert(demoGroupApplyDto);
-		demoGroupCoursesPlanDao.batchInsertByDates(demoGroupApplyDto.getCourseDates(),demoGroupApplyDto.getId());
+		demoGroupCoursesPlanDao.batchInsertByDates(demoGroupApplyDto.getCourseDates(),
+				demoGroupApplyDto.getId(),
+				demoGroupApplyDto.getSingleClassMinutes());
 	}
 
 	@Override
@@ -132,15 +133,22 @@ public class DemoGroupServiceImpl extends BaseServiceImpl<Long, DemoGroup>  impl
 
 		//创建课程
 		DemoGroupCoursesPlan demoGroupCoursesPlan=demoGroupCoursesPlanDao.get(coursePlanId);
-		List<CourseSchedule> courseScheduleByDemoGroup = demoGroupDao.createCourseScheduleByDemoGroup(
+//		List<CourseSchedule> courseScheduleByDemoGroup = demoGroupDao.createCourseSchedulesByDemoGroup(
+//				demoGroup,
+//				demoGroupCoursesPlan.getCoursesStartTime(),
+//				classGroup.getId().longValue());
+		CourseSchedule courseScheduleByDemoGroup = demoGroupDao.createCourseScheduleByDemoGroupPlan(
 				demoGroup,
-				demoGroupCoursesPlan.getCoursesStartTime(),
+				coursePlanId,
 				classGroup.getId().longValue());
-		String[] classSubjects = courseScheduleDao.findClassSubjects(Arrays.asList(new Integer[]{classGroup.getId()}));
+//		String[] classSubjects = courseScheduleDao.findClassSubjects(Arrays.asList(new Integer[]{classGroup.getId()}));
 		StringBuilder className=new StringBuilder(subjectDao.get(demoGroup.getSubjectId().intValue()).getName());
 		className.append("-");
 		className.append(CourseSchedule.CourseScheduleType.DEMO.getMsg());
-		courseScheduleDao.batchAddCourseSchedules(courseScheduleByDemoGroup);
+		courseScheduleByDemoGroup.setName(className.toString());
+		ArrayList<CourseSchedule> courseSchedules = new ArrayList<>();
+		courseSchedules.add(courseScheduleByDemoGroup);
+		courseScheduleDao.batchAddCourseSchedules(courseSchedules);
 
 		//更新所属分部列表
 		List<Integer> organIds = demoGroupDao.organIdListByDemoGroupId(demoGroup.getId());
@@ -158,7 +166,7 @@ public class DemoGroupServiceImpl extends BaseServiceImpl<Long, DemoGroup>  impl
 	@Override
 	public PageInfo findTeacherDemoGroups(TeacherManageDemoGroupQueryInfo queryInfo) {
 		PageInfo pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
-		Map<String, Object> params = new HashMap<String, Object>();
+		Map<String, Object> params = new HashMap<>();
 		MapUtil.populateMap(params, queryInfo);
 
 		List dataList = null;

+ 84 - 1
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -33,6 +33,21 @@
         <result column="seal_class_id_" property="sealClassId"/>
     </resultMap>
 
+    <resultMap type="com.ym.mec.biz.dal.entity.StudentCourseScheduleRecordDto" id="studentCourseScheduleRecord">
+        <result column="id_" property="id"/>
+        <result column="course_schedule_id_" property="courseScheduleId"/>
+        <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="name_" property="courseName"/>
+        <result column="class_date_" property="classDate"/>
+        <result column="start_class_time_" property="startClassTime"/>
+        <result column="end_class_time_" property="endClassTime"/>
+        <result column="teacher_id_" property="teacherId"/>
+        <result column="teacher_name_" property="teacherName"/>
+        <result column="teach_mode_" property="teachMode" />
+        <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="rest_of_class_" property="restOfClass"/>
+    </resultMap>
+
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="CourseSchedule">
 		SELECT * FROM course_schedule WHERE id_ = #{id} 
@@ -340,7 +355,8 @@
             DATE_FORMAT(#{date},'%Y-%m-%d')
         </foreach>
         AND (
-        DATE_FORMAT(cs.start_class_time_,"%H:%i:%s") &gt; DATE_FORMAT(#{endClassTime}, '%H:%i:%s' ) OR DATE_FORMAT(cs.end_class_time_,"%H:%i:%s") &lt; DATE_FORMAT( #{endClassTime}, '%H:%i:%s' )
+          DATE_FORMAT(cs.start_class_time_,"%H:%i:%s") &gt; DATE_FORMAT(#{endClassTime}, '%H:%i:%s' )
+          OR DATE_FORMAT(cs.end_class_time_,"%H:%i:%s") &lt; DATE_FORMAT( #{endClassTime}, '%H:%i:%s' )
         )=0
     </select>
 
@@ -379,6 +395,9 @@
             <if test="month!=null">
                 AND DATE_FORMAT( #{month}, '%Y%m' ) = DATE_FORMAT( cs.class_date_, '%Y%m' )
             </if>
+            <if test="isAttend!=null">
+                AND cs.status_='NOT_START'
+            </if>
         GROUP BY
             cs.class_date_
     </select>
@@ -412,4 +431,68 @@
         </foreach>
         GROUP BY cg.id_
     </select>
+
+    <sql id="queryStudentCourseScheduleRecordCondition">
+        <where>
+            sa.user_id_=#{userId}
+            <if test="teachMode!=null and teachMode!=''">
+                AND cs.teach_mode_=#{teachMode}
+            </if>
+            <if test="type!=null and type!=''">
+                AND cs.type_=#{type}
+            </if>
+            <if test="status!=null and status!=''">
+                AND sa.status_=#{status}
+            </if>
+        </where>
+    </sql>
+
+    <select id="findStudentCourseScheduleRecords" resultMap="studentCourseScheduleRecord">
+        SELECT
+            sa.id_,
+            sa.status_,
+            sa.teacher_id_,
+            su.username_,
+            cs.id_ course_schedule_id_,
+            cs.name_,
+            cs.class_date_,
+            cs.start_class_time_,
+            cs.end_class_time_,
+            cs.teacher_id_,
+            cs.teach_mode_
+        FROM
+            student_attendance sa
+            LEFT JOIN course_schedule cs ON sa.course_schedule_id_=cs.id_
+            LEFT JOIN sys_user su ON sa.teacher_id_=su.id_
+        <include refid="queryStudentCourseScheduleRecordCondition"/>
+        ORDER BY sa.id_
+        <include refid="global.limit"/>
+    </select>
+    <select id="countStudentCourseScheduleRecords" resultType="int">
+        SELECT
+        count(*)
+        FROM
+        student_attendance sa
+        LEFT JOIN course_schedule cs ON sa.course_schedule_id_=cs.id_
+        LEFT JOIN sys_user su ON sa.teacher_id_=su.id_
+        <include refid="queryStudentCourseScheduleRecordCondition"/>
+    </select>
+    <select id="findStudentCourseScheduleNotStartRecords" resultMap="studentCourseScheduleRecord">
+        SELECT
+            cs.teacher_id_,
+            su.username_ teacher_name_,
+            cs.id_ course_schedule_id_,
+            cs.name_,
+            cs.class_date_,
+            cs.start_class_time_,
+            cs.end_class_time_,
+            cs.teach_mode_,
+	        (cg.total_class_times_-cg.current_class_times_) rest_of_class_
+        FROM
+            class_group_student_mapper cgsm
+            LEFT JOIN course_schedule cs ON cs.class_group_id_=cgsm.class_group_id_
+            LEFT JOIN sys_user su ON cs.teacher_id_ = su.id_
+            LEFT JOIN class_group cg ON cgsm.class_group_id_=cg.id_
+        WHERE cs.status_='NOT_START' AND cgsm.user_id_=#{userId} AND cs.class_date_=DATE_FORMAT(#{date},'%Y%m%d')
+    </select>
 </mapper>

+ 29 - 20
mec-biz/src/main/resources/config/mybatis/DemoGroupCoursesPlanMapper.xml

@@ -9,9 +9,11 @@
 	<resultMap type="com.ym.mec.biz.dal.entity.DemoGroupCoursesPlan" id="DemoGroupCoursesPlan">
 		<result column="id_" property="id" />
 		<result column="demo_group_id_" property="demoGroupId" />
-		<result column="courses_start_time_" property="coursesStartTime" />
 		<result column="create_time_" property="createTime" />
 		<result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+		<result column="course_date_" property="courseDate"/>
+		<result column="start_time_" property="startTime"/>
+		<result column="end_time_" property="endTime"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -31,10 +33,10 @@
 		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
 		</selectKey>
 		-->
-		INSERT INTO demo_group_courses_plan (demo_group_id_,courses_start_time_,create_time_,status_)
+		INSERT INTO demo_group_courses_plan (demo_group_id_,create_time_,status_,course_date_,start_time_,end_time_)
 		VALUE
 		<foreach collection="dates" item="date" separator=",">
-			(#{demoGroupId},#{date},now(),#{status})
+			(#{demoGroupId},now(),#{status},#{date},#{date},DATE_ADD(#{date},INTERVAL #{classMinutes} MINUTE))
 		</foreach>
 	</insert>
 
@@ -45,28 +47,35 @@
 		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
 		</selectKey>
 		-->
-		INSERT INTO demo_group_courses_plan (id_,demo_group_id_,courses_start_time_,create_time_,status_) VALUES(#{id},#{demoGroupId},#{coursesStartTime},now(),#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
+		INSERT INTO demo_group_courses_plan (id_,demo_group_id_,course_date_,create_time_,status_,start_time_,end_time_)
+		VALUES(#{id},#{demoGroupId},#{courseDate},now(),#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{startTime},#{endTime})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.DemoGroupCoursesPlan">
 		UPDATE demo_group_courses_plan <set>
-<if test="id != null">
-id_ = #{id},
-</if>
-<if test="demoGroupId != null">
-demo_group_id_ = #{demoGroupId},
-</if>
-<if test="coursesStartTime != null">
-courses_start_time_ = #{coursesStartTime},
-</if>
-<if test="createTime != null">
-create_time_ = #{createTime},
-</if>
-<if test="status!=null">
-	status_=#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-</if>
-</set> WHERE id_ = #{id} 
+		<if test="id != null">
+		id_ = #{id},
+		</if>
+		<if test="demoGroupId != null">
+		demo_group_id_ = #{demoGroupId},
+		</if>
+		<if test="courseDate != null">
+			course_date_ = #{courseDate},
+		</if>
+		<if test="createTime != null">
+		create_time_ = #{createTime},
+		</if>
+		<if test="status!=null">
+			status_=#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+		</if>
+		<if test="startTime!=null">
+			start_time_=#{startTime},
+		</if>
+		<if test="endTime!=null">
+			end_time_=#{endTime},
+		</if>
+		</set> WHERE id_ = #{id}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->

+ 186 - 178
mec-biz/src/main/resources/config/mybatis/DemoGroupMapper.xml

@@ -5,103 +5,99 @@
 不要修改此文件。所有改动将在下次重新自动生成时丢失。
 -->
 <mapper namespace="com.ym.mec.biz.dal.dao.DemoGroupDao">
-
-    <resultMap type="com.ym.mec.biz.dal.entity.DemoGroup" id="DemoGroup">
-        <result column="id_" property="id"/>
-        <result column="name_" property="name"/>
-        <result column="single_class_minutes_" property="singleClassMinutes"/>
-        <result column="organ_id_list_" property="organIdList"/>
-        <result column="create_time_" property="createTime"/>
-        <result column="update_time_" property="updateTime"/>
-        <result column="user_id_" property="userId"/>
-        <result column="price_" property="price"/>
-        <result column="subject_id_" property="subjectId"/>
-    </resultMap>
-
-    <resultMap id="studentDemoGroupListDto" type="com.ym.mec.biz.dal.dto.StudentDemoGroupListDto">
-        <result property="demoGroupId" column="demo_group_id_"/>
-        <result property="userId" column="user_id_"/>
-        <result property="userName" column="username_"/>
-        <result property="avatar" column="avatar_"/>
-        <result property="introduction" column="introduction_"/>
-        <result property="numberOfClasses" column="number_of_classes_"/>
-        <result property="subjectName" column="subject_name_"/>
-        <collection property="coursesPlans"
-                    resultMap="com.ym.mec.biz.dal.dao.DemoGroupCoursesPlanDao.DemoGroupCoursesPlan" column="dgcp.id_"/>
-    </resultMap>
-
-    <!-- 根据主键查询一条记录 -->
-    <select id="get" resultMap="DemoGroup">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.DemoGroup" id="DemoGroup">
+		<result column="id_" property="id" />
+		<result column="name_" property="name" />
+		<result column="single_class_minutes_" property="singleClassMinutes" />
+		<result column="organ_id_list_" property="organIdList" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+		<result column="user_id_" property="userId" />
+		<result column="price_" property="price"/>
+		<result column="subject_id_" property="subjectId"/>
+	</resultMap>
+
+	<resultMap id="studentDemoGroupListDto" type="com.ym.mec.biz.dal.dto.StudentDemoGroupListDto">
+		<result property="demoGroupId" column="demo_group_id_"/>
+		<result property="userId" column="user_id_"/>
+		<result property="userName" column="username_"/>
+		<result property="avatar" column="avatar_"/>
+		<result property="introduction" column="introduction_"/>
+		<result property="numberOfClasses" column="number_of_classes_"/>
+		<result property="subjectName" column="subject_name_"/>
+		<collection property="coursesPlans" resultMap="com.ym.mec.biz.dal.dao.DemoGroupCoursesPlanDao.DemoGroupCoursesPlan" column="dgcp.id_"/>
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="DemoGroup" >
 		SELECT * FROM demo_group WHERE id_ = #{id} 
 	</select>
-
-    <!-- 全查询 -->
-    <select id="findAll" resultMap="DemoGroup">
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="DemoGroup">
 		SELECT * FROM demo_group ORDER BY id_
 	</select>
-
-    <!-- 向数据库增加一条记录 -->
-    <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.DemoGroup" useGeneratedKeys="true" keyColumn="id"
-            keyProperty="id">
-        <!--
-        <selectKey resultClass="int" keyProperty="id" >
-        SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
-        </selectKey>
-        -->
-        INSERT INTO demo_group
-        (id_,name_,single_class_minutes_,organ_id_list_,create_time_,update_time_,user_id_,price_,subject_id_)
-        VALUES(#{id},#{name},#{singleClassMinutes},#{organIdList},#{createTime},#{updateTime},#{userId},#{price},#{subjectId})
-    </insert>
-
-    <!-- 根据主键查询一条记录 -->
-    <update id="update" parameterType="com.ym.mec.biz.dal.entity.DemoGroup">
-        UPDATE demo_group
-        <set>
-            <if test="userId != null">
-                user_id_ = #{userId},
-            </if>
-            <if test="updateTime != null">
-                update_time_ = #{updateTime},
-            </if>
-            <if test="singleClassMinutes != null">
-                single_class_minutes_ = #{singleClassMinutes},
-            </if>
-            <if test="organIdList != null">
-                organ_id_list_ = #{organIdList},
-            </if>
-            <if test="name != null">
-                name_ = #{name},
-            </if>
-            <if test="createTime != null">
-                create_time_ = #{createTime},
-            </if>
-            <if test="price != null">
-                price_ = #{price},
-            </if>
-            <if test="subjectId != null">
-                subject_id_ = #{subjectId},
-            </if>
-        </set>
-        WHERE id_ = #{id}
-    </update>
-
-    <!-- 根据主键删除一条记录 -->
-    <delete id="delete">
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.DemoGroup" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO demo_group (id_,name_,single_class_minutes_,organ_id_list_,create_time_,update_time_,user_id_,price_,subject_id_) VALUES(#{id},#{name},#{singleClassMinutes},#{organIdList},#{createTime},#{updateTime},#{userId},#{price},#{subjectId})
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.DemoGroup">
+		UPDATE demo_group <set>
+<if test="userId != null">
+user_id_ = #{userId},
+</if>
+<if test="id != null">
+id_ = #{id},
+</if>
+<if test="updateTime != null">
+update_time_ = #{updateTime},
+</if>
+<if test="singleClassMinutes != null">
+single_class_minutes_ = #{singleClassMinutes},
+</if>
+<if test="organIdList != null">
+organ_id_list_ = #{organIdList},
+</if>
+<if test="name != null">
+name_ = #{name},
+</if>
+<if test="createTime != null">
+create_time_ = #{createTime},
+</if>
+		<if test="price != null">
+			price_ = #{price},
+		</if>
+		<if test="subjectId != null">
+			subject_id_ = #{subjectId},
+		</if>
+</set> WHERE id_ = #{id} 
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
 		DELETE FROM demo_group WHERE id_ = #{id} 
 	</delete>
-
-    <!-- 分页查询 -->
-    <select id="queryPage" resultMap="DemoGroup" parameterType="map">
-        SELECT * FROM demo_group ORDER BY id_
-        <include refid="global.limit"/>
-    </select>
-
-    <!-- 查询当前表的总记录数 -->
-    <select id="queryCount" resultType="int">
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="DemoGroup" parameterType="map">
+		SELECT * FROM demo_group ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM demo_group
 	</select>
 
-    <select id="organIdListByDemoGroupId" resultType="int">
+	<select id="organIdListByDemoGroupId" resultType="int">
 		SELECT
 			su.organ_id_
 		FROM
@@ -110,25 +106,38 @@
 			LEFT JOIN sys_user su ON cgsm.user_id_=su.id_
 		WHERE dgcgm.demo_group_id_=#{demoGroupId}
 	</select>
-    <select id="getOrganIdByUserId" resultType="java.lang.Integer">
+	<select id="getOrganIdByUserId" resultType="java.lang.Integer">
 		select organ_id_ from sys_user where id_=#{userId}
 	</select>
-    <select id="createCourseScheduleByDemoGroup" parameterType="com.ym.mec.biz.dal.entity.DemoGroup"
-            resultMap="com.ym.mec.biz.dal.dao.CourseScheduleDao.CourseSchedule">
+	<select id="createCourseSchedulesByDemoGroup" parameterType="com.ym.mec.biz.dal.entity.DemoGroup" resultMap="com.ym.mec.biz.dal.dao.CourseScheduleDao.CourseSchedule">
+		SELECT
+			#{classGroupId} class_group_id_,
+			'NOT_START' status_,
+			DATE_FORMAT(dgcp.courses_start_time_,'%Y-%m-%d') class_date_,
+			dgcp.courses_start_time_ start_class_time_,
+			DATE_ADD(dgcp.courses_start_time_,INTERVAL #{demoGroup.singleClassMinutes} MINUTE) end_class_time_,
+			#{demoGroup.userId} teacher_id_,
+			'ONLINE' teach_mode_,
+			'demo' type_
+		FROM
+			demo_group_courses_plan dgcp
+			WHERE dgcp.demo_group_id_=#{demoGroup.id} AND dgcp.courses_start_time_ = #{startTime}
+	</select>
+	<select id="createCourseScheduleByDemoGroupPlan" parameterType="com.ym.mec.biz.dal.entity.DemoGroup" resultMap="com.ym.mec.biz.dal.dao.CourseScheduleDao.CourseSchedule">
 		SELECT
 			#{classGroupId} class_group_id_,
 			'NOT_START' status_,
-			DATE_FORMAT(dgcp.start_time_,'%Y-%m-%d') class_date_,
-			dgcp.start_time_ start_class_time_,
-			DATE_ADD(dgcp.start_time_,INTERVAL #{demoGroup.singleClassMinutes} MINUTE) end_class_time_,
+			dgcp.course_date_ class_date_,
+			CONCAT(dgcp.course_date_,' ',dgcp.start_time_) start_class_time_,
+			DATE_ADD( CONCAT(dgcp.course_date_,' ',dgcp.start_time_),INTERVAL #{demoGroup.singleClassMinutes} MINUTE) end_class_time_,
 			#{demoGroup.userId} teacher_id_,
 			'ONLINE' teach_mode_,
 			'demo' type_
 		FROM
 			demo_group_courses_plan dgcp
-			WHERE dgcp.demo_group_id_=#{demoGroup.id} AND dgcp.start_time_ = #{startTime}
+			WHERE dgcp.id_=#{coursePlanId}
 	</select>
-    <select id="countDemoGroupStudents" resultType="java.lang.Integer">
+	<select id="countDemoGroupStudents" resultType="java.lang.Integer">
 		SELECT
 			count(cgsm.user_id_)
 		FROM
@@ -137,55 +146,55 @@
 		WHERE dgcgm.demo_group_id_=#{demoGroupId}
 	</select>
 
-    <sql id="demoGroupQueryCondition">
-        <where>
-            dgcp.status_=0
-            <if test="search!=null">
-                AND su.username_ like concat('%',#{search},'%')
-            </if>
-            <if test="subjectIds!=null and subjectIds!=''">
-                AND FIND_IN_SET(dg.subject_id_,#{subjectIds})
-            </if>
-            <if test="startTime!=null and endTime==null">
-                AND dgcp.start_time_=#{startTime}
-            </if>
-            <if test="startTime!=null and endTime!=null">
-                AND dgcp.start_time_&gt;=#{startTime} AND dgcp.start_time_ &lt;= #{endTime}
-            </if>
-        </where>
-    </sql>
-
-    <select id="findDemoGroupList" resultMap="studentDemoGroupListDto">
-        SELECT
-        dg.id_ demo_group_id_,
-        su.username_,
-        su.avatar_,
-        t.introduction_,
-        s.name_ subject_name_,
-        COUNT(dgcgm.class_group_id_) number_of_classes_,
-        dgcp.*
-        FROM
-        demo_group dg
-        LEFT JOIN demo_group_courses_plan dgcp ON dg.id_=dgcp.demo_group_id_
-        LEFT JOIN teacher t ON dg.user_id_=t.id_
-        LEFT JOIN sys_user su ON dg.user_id_=su.id_
-        LEFT JOIN `subject` s ON dg.subject_id_=s.id_
-        LEFT JOIN demo_group_class_group_mapper dgcgm ON dg.id_=dgcgm.demo_group_id_
-        <include refid="demoGroupQueryCondition"/>
-        GROUP BY dgcp.id_,dg.id_
-        ORDER BY dgcp.start_time_
-        <include refid="global.limit"/>
-    </select>
-    <select id="countDemoGroupList" resultType="java.lang.Integer">
-        SELECT
-        count(*)
-        FROM
-        demo_group dg
-        LEFT JOIN demo_group_courses_plan dgcp ON dg.id_=dgcp.demo_group_id_
-        LEFT JOIN sys_user su ON dg.user_id_=su.id_
-        <include refid="demoGroupQueryCondition"/>
-    </select>
-    <select id="findClassGroupIDByDemoGroupId" resultType="java.lang.Integer">
+	<sql id="demoGroupQueryCondition">
+		<where>
+			dgcp.status_=0
+			<if test="search!=null">
+				AND su.username_ like concat('%',#{search},'%')
+			</if>
+			<if test="subjectIds!=null and subjectIds!=''">
+				AND FIND_IN_SET(dg.subject_id_,#{subjectIds})
+			</if>
+			<if test="startTime!=null and endTime==null">
+				AND dgcp.courses_start_time_=#{startTime}
+			</if>
+			<if test="startTime!=null and endTime!=null">
+				AND dgcp.courses_start_time_&gt;=#{startTime} AND dgcp.courses_start_time_ &lt;= #{endTime}
+			</if>
+		</where>
+	</sql>
+
+	<select id="findDemoGroupList" resultMap="studentDemoGroupListDto">
+		SELECT
+		dg.id_ demo_group_id_,
+		su.username_,
+		su.avatar_,
+		t.introduction_,
+		s.name_ subject_name_,
+		COUNT(dgcgm.class_group_id_) number_of_classes_,
+		dgcp.*
+		FROM
+		demo_group dg
+		LEFT JOIN demo_group_courses_plan dgcp ON dg.id_=dgcp.demo_group_id_
+		LEFT JOIN teacher t ON dg.user_id_=t.id_
+		LEFT JOIN sys_user su ON dg.user_id_=su.id_
+		LEFT JOIN `subject` s ON dg.subject_id_=s.id_
+		LEFT JOIN demo_group_class_group_mapper dgcgm ON dg.id_=dgcgm.demo_group_id_
+		<include refid="demoGroupQueryCondition"/>
+		GROUP BY dgcp.id_,dg.id_
+		ORDER BY dgcp.courses_start_time_
+		<include refid="global.limit"/>
+	</select>
+	<select id="countDemoGroupList" resultType="java.lang.Integer">
+		SELECT
+			count(*)
+		FROM
+			demo_group dg
+			LEFT JOIN demo_group_courses_plan dgcp ON dg.id_=dgcp.demo_group_id_
+			LEFT JOIN sys_user su ON dg.user_id_=su.id_
+		<include refid="demoGroupQueryCondition"/>
+	</select>
+	<select id="findClassGroupIDByDemoGroupId" resultType="java.lang.Integer">
 		SELECT
 			class_group_id_
 		FROM
@@ -196,41 +205,40 @@
 		SELECT * FROM demo_group WHERE user_id_=#{teacherId}
 	</select>
 
-    <sql id="teacherDemoGroupsQueryCondition">
-        <where>
-            dg.user_id_=#{teacherId}
-        </where>
-    </sql>
+	<sql id="teacherDemoGroupsQueryCondition">
+		<where>
+			dg.user_id_=#{teacherId}
+		</where>
+	</sql>
 
-    <select id="findTeacherDemoGroups" resultType="com.ym.mec.biz.dal.dto.TeacherManageDemoGroupListDto">
-        SELECT
-        cs.class_date_ classDate,
-        GROUP_CONCAT(DISTINCT CONCAT(cs.start_class_time_,cs.end_class_time_)) startTimes,
-        GROUP_CONCAT(s.name_) subjectNames
-        FROM
-        demo_group dg
-        LEFT JOIN demo_group_class_group_mapper dgcgm ON dg.id_=dgcgm.demo_group_id_
-        LEFT JOIN class_group cg ON dgcgm.class_group_id_=cg.id_
-        LEFT JOIN course_schedule cs ON cg.id_=cs.class_group_id_
-        LEFT JOIN `subject` s ON FIND_IN_SET(s.id_,cg.subject_id_list_)
-        <include refid="teacherDemoGroupsQueryCondition"/>
-        GROUP BY cs.class_date_
-        <include refid="global.limit"/>
-    </select>
-    <select id="countTeacherDemoGroups" resultType="int">
-        SELECT
-        count(*)
-        FROM
-        demo_group dg
-        LEFT JOIN demo_group_class_group_mapper dgcgm ON dg.id_=dgcgm.demo_group_id_
-        LEFT JOIN class_group cg ON dgcgm.class_group_id_=cg.id_
-        LEFT JOIN course_schedule cs ON cg.id_=cs.class_group_id_
-        <include refid="teacherDemoGroupsQueryCondition"/>
-        GROUP BY cs.class_date_
-    </select>
+	<select id="findTeacherDemoGroups" resultType="com.ym.mec.biz.dal.dto.TeacherManageDemoGroupListDto">
+		SELECT
+			cs.class_date_ classDate,
+			GROUP_CONCAT(DISTINCT CONCAT(cs.start_class_time_,' ',cs.end_class_time_)) startTimes,
+			GROUP_CONCAT(s.name_) subjectNames
+		FROM
+			demo_group dg
+		LEFT JOIN demo_group_class_group_mapper dgcgm ON dg.id_=dgcgm.demo_group_id_
+		LEFT JOIN class_group cg ON dgcgm.class_group_id_=cg.id_
+		LEFT JOIN course_schedule cs ON cg.id_=cs.class_group_id_
+		LEFT JOIN `subject` s ON FIND_IN_SET(s.id_,cg.subject_id_list_)
+		<include refid="teacherDemoGroupsQueryCondition"/>
+		GROUP BY cs.class_date_
+		<include refid="global.limit"/>
+	</select>
+	<select id="countTeacherDemoGroups" resultType="int">
+		SELECT
+			count(*)
+		FROM
+			demo_group dg
+		LEFT JOIN demo_group_class_group_mapper dgcgm ON dg.id_=dgcgm.demo_group_id_
+		LEFT JOIN class_group cg ON dgcgm.class_group_id_=cg.id_
+		LEFT JOIN course_schedule cs ON cg.id_=cs.class_group_id_
+		<include refid="teacherDemoGroupsQueryCondition"/>
+		GROUP BY cs.class_date_
+	</select>
 
-    <select id="findDemoGroupStartClassTimesWithWeekByTeacherId"
-            resultType="com.ym.mec.biz.dal.dto.EducationDemoGroupListDto">
+	<select id="findDemoGroupStartClassTimesWithWeekByTeacherId" resultType="com.ym.mec.biz.dal.dto.EducationDemoGroupListDto">
 		SELECT
 			class_date_ classDate,
 			GROUP_CONCAT(start_class_time_) startClassTimes

+ 10 - 2
mec-student/src/main/java/com/ym/mec/student/controller/StudentCourseScheduleController.java

@@ -1,6 +1,7 @@
 package com.ym.mec.student.controller;
 
 import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
+import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.StudentAttendanceService;
 import com.ym.mec.common.controller.BaseController;
@@ -29,8 +30,9 @@ public class StudentCourseScheduleController extends BaseController {
 
     @ApiOperation(value = "根据月份获取乐团在该月有课的日期")
     @GetMapping("/getCourseScheduleDateByMonth")
-    public Object getCourseScheduleDateByMonth(@ApiParam(value = "月份", required = true) @RequestParam Date month) {
-        return succeed(scheduleService.getCourseScheduleDateByStudent(month));
+    public Object getCourseScheduleDateByMonth(@ApiParam(value = "月份", required = true) @RequestParam Date month,
+                                               @ApiParam(value = "未上课", required = true) Integer isAttend) {
+        return succeed(scheduleService.getCourseScheduleDateByStudent(month,isAttend));
     }
 
     @ApiOperation(value = "根据日期获取当日排课")
@@ -53,4 +55,10 @@ public class StudentCourseScheduleController extends BaseController {
         return succeed();
     }
 
+    @ApiOperation(value = "上课记录")
+    @GetMapping(value = "/findStudentCourseScheduleRecords")
+    public Object findStudentCourseScheduleRecords(StudentCourseScheduleRecordQueryInfo queryInfo){
+        return succeed(scheduleService.findStudentCourseScheduleRecords(queryInfo));
+    }
+
 }