|
@@ -67,6 +67,7 @@
|
|
<result column="isCallNames" property="isCallNames" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
<result column="isCallNames" property="isCallNames" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
<result column="is_complaints_" property="isComplaints"/>
|
|
<result column="is_complaints_" property="isComplaints"/>
|
|
<result column="merged_course_ids_" property="mergedCourseIds"/>
|
|
<result column="merged_course_ids_" property="mergedCourseIds"/>
|
|
|
|
+ <result column="teachingTeacherIds" property="teachingTeacherIds"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.ym.mec.biz.dal.dto.CourseScheduleDto" id="courseScheduleDto" extends="CourseSchedule">
|
|
<resultMap type="com.ym.mec.biz.dal.dto.CourseScheduleDto" id="courseScheduleDto" extends="CourseSchedule">
|
|
@@ -2404,33 +2405,17 @@
|
|
|
|
|
|
<select id="endFindCourseSchedules" resultMap="CourseScheduleEndDto">
|
|
<select id="endFindCourseSchedules" resultMap="CourseScheduleEndDto">
|
|
SELECT
|
|
SELECT
|
|
- cs.id_ id_,
|
|
|
|
- cs.new_course_id_,
|
|
|
|
- cs.group_type_,
|
|
|
|
- cs.music_group_id_,
|
|
|
|
- cs.class_group_id_,
|
|
|
|
- cs.status_,
|
|
|
|
- cs.name_,
|
|
|
|
- cs.class_date_,
|
|
|
|
- CONCAT(cs.class_date_,' ',cs.start_class_time_) course_start_time_,
|
|
|
|
|
|
+ cs.id_ id_,cs.new_course_id_,cs.group_type_,cs.music_group_id_,cs.class_group_id_,
|
|
|
|
+ cs.status_,cs.name_,cs.class_date_,CONCAT(cs.class_date_,' ',cs.start_class_time_) course_start_time_,
|
|
CONCAT(cs.class_date_,' ',cs.end_class_time_) course_end_time_,
|
|
CONCAT(cs.class_date_,' ',cs.end_class_time_) course_end_time_,
|
|
- cs.actual_teacher_id_,
|
|
|
|
- cs.teach_mode_,
|
|
|
|
- cs.type_,
|
|
|
|
- cs.schoole_id_,
|
|
|
|
- cs.create_time_,
|
|
|
|
- cs.is_lock_,
|
|
|
|
- cs.organ_id_,
|
|
|
|
- cs.member_flag_,
|
|
|
|
- cs.new_course_id_,
|
|
|
|
- s.name_ schoole_name_,
|
|
|
|
- o.name_ organ_name_,
|
|
|
|
|
|
+ cs.actual_teacher_id_,cs.teach_mode_,cs.type_,cs.schoole_id_,cs.create_time_,cs.is_lock_,
|
|
|
|
+ cs.organ_id_,cs.member_flag_,cs.new_course_id_,s.name_ schoole_name_,o.name_ organ_name_,
|
|
CASE WHEN COUNT(CASE WHEN sa.id_ IS NULL OR (sa.status_ = 'LEAVE' AND sa.remark_ IS NOT NULL) THEN NULL ELSE 1 END) > 0 THEN 1 ELSE 0 END isCallNames,
|
|
CASE WHEN COUNT(CASE WHEN sa.id_ IS NULL OR (sa.status_ = 'LEAVE' AND sa.remark_ IS NOT NULL) THEN NULL ELSE 1 END) > 0 THEN 1 ELSE 0 END isCallNames,
|
|
CASE WHEN COUNT(CASE WHEN ta.is_complaints_ = 1 THEN 1 ELSE NULL END) > 0 THEN '1' ELSE '0' END is_complaints_,
|
|
CASE WHEN COUNT(CASE WHEN ta.is_complaints_ = 1 THEN 1 ELSE NULL END) > 0 THEN '1' ELSE '0' END is_complaints_,
|
|
(
|
|
(
|
|
select group_concat(csd.id_) from course_schedule csd
|
|
select group_concat(csd.id_) from course_schedule csd
|
|
where csd.del_flag_ = 0 and csd.id_ != csd.new_course_id_ and csd.new_course_id_ = cs.new_course_id_
|
|
where csd.del_flag_ = 0 and csd.id_ != csd.new_course_id_ and csd.new_course_id_ = cs.new_course_id_
|
|
- ) as merged_course_ids_
|
|
|
|
|
|
+ ) as merged_course_ids_,GROUP_CONCAT(distinct CASE WHEN csts.teacher_role_ = 'TEACHING' THEN csts.user_id_ END) teachingTeacherIds
|
|
FROM
|
|
FROM
|
|
course_schedule cs
|
|
course_schedule cs
|
|
LEFT JOIN school s ON cs.schoole_id_=s.id_
|
|
LEFT JOIN school s ON cs.schoole_id_=s.id_
|
|
@@ -2445,22 +2430,22 @@
|
|
AND cssp.user_id_ = sa.user_id_
|
|
AND cssp.user_id_ = sa.user_id_
|
|
</if>
|
|
</if>
|
|
<include refid="endFindCourseSchedulesCondition"/>
|
|
<include refid="endFindCourseSchedulesCondition"/>
|
|
- GROUP BY
|
|
|
|
- cs.class_date_,
|
|
|
|
- cs.start_class_time_,
|
|
|
|
- cs.id_
|
|
|
|
- ORDER BY
|
|
|
|
- cs.class_date_,
|
|
|
|
- cs.start_class_time_,
|
|
|
|
- cs.id_
|
|
|
|
|
|
+ GROUP BY cs.class_date_, cs.start_class_time_, cs.id_
|
|
|
|
+ <if test="hasTeaching != null">
|
|
|
|
+ <if test="hasTeaching == true">
|
|
|
|
+ HAVING teachingTeacherIds IS NOT NULL
|
|
|
|
+ </if>
|
|
|
|
+ <if test="hasTeaching == false">
|
|
|
|
+ HAVING teachingTeacherIds IS NULL
|
|
|
|
+ </if>
|
|
|
|
+ </if>
|
|
|
|
+ ORDER BY cs.class_date_, cs.start_class_time_, cs.id_
|
|
<include refid="global.limit"/>
|
|
<include refid="global.limit"/>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="endCountCourseSchedules" resultType="int">
|
|
<select id="endCountCourseSchedules" resultType="int">
|
|
- SELECT
|
|
|
|
- COUNT(DISTINCT cs.id_)
|
|
|
|
- FROM
|
|
|
|
- course_schedule cs
|
|
|
|
|
|
+ SELECT COUNT(c.id_) FROM (
|
|
|
|
+ SELECT cs.id_,GROUP_CONCAT(distinct CASE WHEN csts.teacher_role_ = 'TEACHING' THEN csts.user_id_ END) teachingTeacherIds FROM course_schedule cs
|
|
<if test="studentId != null or searchType == 'TEACHER_ERR_ATTENDANCE' or searchType == 'STUDENT_ERR_ATTENDANCE'">
|
|
<if test="studentId != null or searchType == 'TEACHER_ERR_ATTENDANCE' or searchType == 'STUDENT_ERR_ATTENDANCE'">
|
|
LEFT JOIN course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
|
|
LEFT JOIN course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
|
|
</if>
|
|
</if>
|
|
@@ -2471,6 +2456,15 @@
|
|
LEFT JOIN teacher_attendance ta on ta.course_schedule_id_ = cs.id_
|
|
LEFT JOIN teacher_attendance ta on ta.course_schedule_id_ = cs.id_
|
|
LEFT JOIN course_schedule_teacher_salary csts ON csts.course_schedule_id_ = cs.id_
|
|
LEFT JOIN course_schedule_teacher_salary csts ON csts.course_schedule_id_ = cs.id_
|
|
<include refid="endFindCourseSchedulesCondition"/>
|
|
<include refid="endFindCourseSchedulesCondition"/>
|
|
|
|
+ GROUP BY cs.id_
|
|
|
|
+ <if test="hasTeaching != null">
|
|
|
|
+ <if test="hasTeaching == true">
|
|
|
|
+ HAVING teachingTeacherIds IS NOT NULL
|
|
|
|
+ </if>
|
|
|
|
+ <if test="hasTeaching == false">
|
|
|
|
+ HAVING teachingTeacherIds IS NULL
|
|
|
|
+ </if>
|
|
|
|
+ </if>) c
|
|
</select>
|
|
</select>
|
|
<select id="findClassGroupCourseSchedulesWithDate" resultMap="CourseSchedule">
|
|
<select id="findClassGroupCourseSchedulesWithDate" resultMap="CourseSchedule">
|
|
SELECT <include refid="resultSql"/>
|
|
SELECT <include refid="resultSql"/>
|
|
@@ -2558,7 +2552,7 @@
|
|
AND cs.teach_mode_ = #{teachMode,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
AND cs.teach_mode_ = #{teachMode,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
</if>
|
|
</if>
|
|
<if test="teacherIdList != null">
|
|
<if test="teacherIdList != null">
|
|
- AND csts.user_id_=#{teacherIdList}
|
|
|
|
|
|
+ AND csts.user_id_ = #{teacherIdList}
|
|
</if>
|
|
</if>
|
|
<if test="teachType != null">
|
|
<if test="teachType != null">
|
|
AND csts.teacher_role_ = #{teachType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
AND csts.teacher_role_ = #{teachType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
@@ -2575,14 +2569,6 @@
|
|
<if test="tenantId != null">
|
|
<if test="tenantId != null">
|
|
AND cs.tenant_id_ = #{tenantId}
|
|
AND cs.tenant_id_ = #{tenantId}
|
|
</if>
|
|
</if>
|
|
- <if test="hasTeaching != null">
|
|
|
|
- <if test="hasTeaching == 'true'">
|
|
|
|
-
|
|
|
|
- </if>
|
|
|
|
- <if test="hasTeaching == 'false'">
|
|
|
|
-
|
|
|
|
- </if>
|
|
|
|
- </if>
|
|
|
|
<if test="searchType == 'TEACHER_ERR_ATTENDANCE'">
|
|
<if test="searchType == 'TEACHER_ERR_ATTENDANCE'">
|
|
AND ta.teacher_id_ = cs.actual_teacher_id_
|
|
AND ta.teacher_id_ = cs.actual_teacher_id_
|
|
AND cs.status_ = 'OVER'
|
|
AND cs.status_ = 'OVER'
|