|
@@ -350,54 +350,6 @@
|
|
|
</foreach>
|
|
|
</update>
|
|
|
|
|
|
- <select id="getTeacherOperatingStudentsNum" resultType="java.util.Map">
|
|
|
- select teacher_id_ 'key', count(*) 'value'
|
|
|
- FROM student
|
|
|
- WHERE FIND_IN_SET(teacher_id_, #{teacherIds})
|
|
|
- AND operating_tag_ = 1
|
|
|
- GROUP BY teacher_id_
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getBuyNums" resultType="java.util.Map">
|
|
|
- SELECT s.teacher_id_ 'key', COUNT(DISTINCT cssp.user_id_) 'value'
|
|
|
- FROM course_schedule_student_payment cssp
|
|
|
- LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_ AND cs.teach_mode_ = 'ONLINE'
|
|
|
- LEFT JOIN student s ON s.user_id_ = cssp.user_id_
|
|
|
- <if test="groupType != null and groupType==@com.ym.mec.biz.dal.enums.GroupType@PRACTICE">
|
|
|
- LEFT JOIN practice_group pg ON cssp.music_group_id_ = pg.id_ AND cssp.group_type_ = 'PRACTICE'
|
|
|
- </if>
|
|
|
- WHERE s.teacher_id_ = #{teacherId}
|
|
|
- AND cs.status_ IN ('NOT_START', 'UNDERWAY')
|
|
|
- AND (cs.is_lock_ IS NULL OR cs.is_lock_ = 0)
|
|
|
- <if test="groupType != null">
|
|
|
- AND cs.group_type_ = #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
- </if>
|
|
|
- <if test="groupType != null and groupType==@com.ym.mec.biz.dal.enums.GroupType@PRACTICE">
|
|
|
- AND pg.group_status_ IN ('NORMAL', 'FINISH')
|
|
|
- AND pg.buy_months_ >= 1
|
|
|
- </if>
|
|
|
- GROUP BY s.teacher_id_
|
|
|
- </select>
|
|
|
- <select id="getPracticeAndVipNums" resultType="java.util.Map">
|
|
|
- SELECT s.teacher_id_ 'key', COUNT(DISTINCT pg.student_id_) 'value'
|
|
|
- FROM practice_group pg
|
|
|
- LEFT JOIN student s on s.user_id_ = pg.student_id_
|
|
|
- LEFT JOIN course_schedule_student_payment vcssp
|
|
|
- ON vcssp.user_id_ = pg.student_id_ AND vcssp.group_type_ = 'VIP'
|
|
|
- LEFT JOIN course_schedule_student_payment pcssp
|
|
|
- ON pcssp.user_id_ = pg.student_id_ AND pcssp.group_type_ = 'PRACTICE'
|
|
|
- LEFT JOIN course_schedule vcs ON vcs.id_ = vcssp.course_schedule_id_ AND vcs.teach_mode_ = 'ONLINE'
|
|
|
- LEFT JOIN course_schedule pcs ON pcs.id_ = pcssp.course_schedule_id_
|
|
|
- WHERE FIND_IN_SET(s.teacher_id_, #{teacherIds})
|
|
|
- AND pg.group_status_ IN ('NORMAL', 'FINISH')
|
|
|
- AND vcs.status_ IN ('NOT_START', 'UNDERWAY')
|
|
|
- AND pcs.status_ IN ('NOT_START', 'UNDERWAY')
|
|
|
- AND (vcs.is_lock_ IS NULL OR vcs.is_lock_ = 0)
|
|
|
- AND (pcs.is_lock_ IS NULL OR pcs.is_lock_ = 0)
|
|
|
- AND pg.buy_months_ >= 1
|
|
|
- GROUP BY s.teacher_id_
|
|
|
- </select>
|
|
|
-
|
|
|
<select id="getServeStudentIds" resultType="int">
|
|
|
SELECT user_id_
|
|
|
FROM student stu
|