|
@@ -1559,12 +1559,17 @@
|
|
|
</select>
|
|
|
<!-- 查找班级未开始的课程 -->
|
|
|
<select id="findCoursesByClassGroupId" resultMap="CourseSchedule">
|
|
|
- SELECT *
|
|
|
- FROM course_schedule
|
|
|
+ SELECT * FROM course_schedule
|
|
|
WHERE class_group_id_ = #{classGroupId}
|
|
|
<if test="status != null">
|
|
|
and status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
</if>
|
|
|
+ union
|
|
|
+ select ncs.* from course_schedule cs left join course_schedule ncs on ncs.id_ = cs.new_course_id_
|
|
|
+ where cs.new_course_id_ > 0 and cs.class_group_id_ = #{classGroupId}
|
|
|
+ <if test="status != null">
|
|
|
+ and ncs.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<resultMap id="CourseAttendanceDetailHeadInfoDto" type="com.ym.mec.biz.dal.dto.CourseAttendanceDetailHeadInfoDto">
|
|
@@ -3330,9 +3335,15 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="queryRemainCourseTypeDuration" resultMap="RemainCourseTypeDurationDto">
|
|
|
- SELECT cs.type_ course_type_,SUM(TIMESTAMPDIFF(MINUTE,STR_TO_DATE(concat(cs.class_date_,' ',cs.start_class_time_),'%Y-%m-%d %H:%i:%s'),
|
|
|
- STR_TO_DATE(concat(cs.class_date_,' ',cs.end_class_time_),'%Y-%m-%d %H:%i:%s'))) remain_minutes_,sum(case when cs.new_course_id_ is null then 0 else 1 end) temp_merged_course_num_
|
|
|
+ SELECT a.course_type_,SUM(remain_minutes_) remain_minutes_ FROM
|
|
|
+ (SELECT cs.type_ course_type_,SUM(TIMESTAMPDIFF(MINUTE,STR_TO_DATE(concat(cs.class_date_,' ',cs.start_class_time_),'%Y-%m-%d %H:%i:%s'),
|
|
|
+ STR_TO_DATE(concat(cs.class_date_,' ',cs.end_class_time_),'%Y-%m-%d %H:%i:%s'))) remain_minutes_
|
|
|
from course_schedule cs where FIND_IN_SET(cs.class_group_id_,#{classgroupId}) and cs.status_ = 'NOT_START' group by cs.type_
|
|
|
+ UNION
|
|
|
+ SELECT ncs.type_ course_type_,SUM(TIMESTAMPDIFF(MINUTE,STR_TO_DATE(concat(ncs.class_date_,' ',ncs.start_class_time_),'%Y-%m-%d %H:%i:%s'),
|
|
|
+ STR_TO_DATE(concat(ncs.class_date_,' ',ncs.end_class_time_),'%Y-%m-%d %H:%i:%s'))) remain_minutes_ FROM course_schedule cs LEFT JOIN course_schedule ncs ON ncs.id_ = cs.new_course_id_
|
|
|
+ WHERE FIND_IN_SET(cs.class_group_id_,#{classgroupId}) and cs.new_course_id_ > 0 AND ncs.status_ = 'NOT_START' GROUP BY ncs.type_) a
|
|
|
+ group BY a.course_type_
|
|
|
</select>
|
|
|
|
|
|
<resultMap id="CourseRepeatCheckDto" type="com.ym.mec.biz.dal.dto.CourseRepeatCheckDto">
|