|
@@ -149,41 +149,48 @@
|
|
|
|
|
|
<select id="queryLiveTeacherCourse" resultType="com.yonge.cooleshow.biz.dal.vo.TeacherLiveCourseInfoVo">
|
|
<select id="queryLiveTeacherCourse" resultType="com.yonge.cooleshow.biz.dal.vo.TeacherLiveCourseInfoVo">
|
|
select
|
|
select
|
|
- b.id_ as courseGroupId,
|
|
|
|
- b.name_ as courseGroupName,
|
|
|
|
- a.id_ as courseId,
|
|
|
|
- a.class_num_ as classNum,
|
|
|
|
|
|
+ cs.course_group_id_ as courseGroupId,
|
|
|
|
+ cs.name_ as courseGroupName,
|
|
|
|
+ cs.id_ as courseId,
|
|
|
|
+ cs.class_num_ as classNum,
|
|
s.name_ as subjectName,
|
|
s.name_ as subjectName,
|
|
- MIN(a.start_time_) as startTime,
|
|
|
|
- MIN(a.end_time_) as endTime,
|
|
|
|
- a.status_ as `status`,
|
|
|
|
- b.pre_student_num_ as studentCount,
|
|
|
|
- b.background_pic_ as backgroundPic,
|
|
|
|
- b.im_group_id_ as imGroupId,
|
|
|
|
|
|
+ cs.start_time_ as startTime,
|
|
|
|
+ cs.end_time_ as endTime,
|
|
|
|
+ cs.status_ as `status`,
|
|
|
|
+ cs.pre_student_num_ as studentCount,
|
|
|
|
+ cs.background_pic_ as backgroundPic,
|
|
|
|
+ cs.im_group_id_ as imGroupId,
|
|
su.username_ as username,
|
|
su.username_ as username,
|
|
su.id_ as userId,
|
|
su.id_ as userId,
|
|
su.avatar_ as avatar,
|
|
su.avatar_ as avatar,
|
|
- b.course_num_ as courseNum,
|
|
|
|
- b.complete_course_num_ as completeCourseNum,
|
|
|
|
- b.course_introduce_ as courseIntroduce
|
|
|
|
- from course_schedule as a
|
|
|
|
- left join course_group as b on a.course_group_id_ = b.id_
|
|
|
|
- left join subject as s on b.subject_id_ = s.id_
|
|
|
|
- left join sys_user su on su.id_ = a.teacher_id_
|
|
|
|
-
|
|
|
|
- where b.teacher_id_ = #{param.teacherId}
|
|
|
|
- AND a.lock_ = 0
|
|
|
|
- AND a.type_ = #{param.type}
|
|
|
|
- <if test="param.groupState !=null and param.groupState !=''">
|
|
|
|
- AND find_in_set(b.status_, #{param.groupState})
|
|
|
|
- </if>
|
|
|
|
- <if test="param.status !=null and param.status !=''">
|
|
|
|
- AND a.status_ = #{param.status}
|
|
|
|
- </if>
|
|
|
|
- <if test="param.subjectId != null and param.subjectId !=''">
|
|
|
|
- AND b.subject_id_ = #{param.subjectId}
|
|
|
|
- </if>
|
|
|
|
- GROUP BY b.id_ order by start_time_
|
|
|
|
|
|
+ cs.course_num_ as courseNum,
|
|
|
|
+ cs.complete_course_num_ as completeCourseNum,
|
|
|
|
+ cs.course_introduce_ as courseIntroduce
|
|
|
|
+ from (select * from (
|
|
|
|
+ select cg.course_num_,cg.complete_course_num_,cg.course_introduce_,cg.pre_student_num_,
|
|
|
|
+ cg.background_pic_,cg.im_group_id_,cg.name_,cg.subject_id_,cg.status_ group_status_,cg.teacher_id_,
|
|
|
|
+ cs.status_,cs.type_,cs.course_group_id_,cs.class_date_,cs.start_time_,cs.end_time_,cs.id_,cs.class_num_
|
|
|
|
+ from course_schedule cs
|
|
|
|
+ left join course_group cg on cs.course_group_id_ = cg.id_
|
|
|
|
+ where cs.type_ = #{param.type} AND cs.lock_ = 0 AND cg.teacher_id_ = #{param.teacherId}
|
|
|
|
+ order by cs.start_time_) cs
|
|
|
|
+ group by cs.course_group_id_) cs
|
|
|
|
+ left join subject as s on cs.subject_id_ = s.id_
|
|
|
|
+ left join sys_user su on su.id_ = cs.teacher_id_
|
|
|
|
+ <where>
|
|
|
|
+ <if test="param.groupState !=null and param.groupState !=''">
|
|
|
|
+ AND find_in_set(cs.group_status_, #{param.groupState})
|
|
|
|
+ </if>
|
|
|
|
+ <if test="param.status !=null and param.status !=''">
|
|
|
|
+ AND cs.status_ = #{param.status}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="param.subjectId != null and param.subjectId !=''">
|
|
|
|
+ AND cs.subject_id_ = #{param.subjectId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="param.search != null and param.search !=''">
|
|
|
|
+ AND (cs.name_ LIKE CONCAT('%', #{param.search}, '%') OR su.username_ LIKE CONCAT('%', #{param.search}, '%'))
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="queryTeacherPracticeCourse" resultType="com.yonge.cooleshow.biz.dal.vo.MyCourseVo">
|
|
<select id="queryTeacherPracticeCourse" resultType="com.yonge.cooleshow.biz.dal.vo.MyCourseVo">
|
|
@@ -548,7 +555,7 @@
|
|
|
|
|
|
<select id="queryStudentLiveCourse" parameterType="map" resultType="com.yonge.cooleshow.biz.dal.vo.CourseStudent">
|
|
<select id="queryStudentLiveCourse" parameterType="map" resultType="com.yonge.cooleshow.biz.dal.vo.CourseStudent">
|
|
SELECT distinct
|
|
SELECT distinct
|
|
- cs.id_ AS courseId,
|
|
|
|
|
|
+ cs.course_id_ AS courseId,
|
|
cs.course_group_id_ AS courseGoupId,
|
|
cs.course_group_id_ AS courseGoupId,
|
|
cs.class_date_ AS classDate,
|
|
cs.class_date_ AS classDate,
|
|
cs.start_time_ AS startTime,
|
|
cs.start_time_ AS startTime,
|
|
@@ -568,23 +575,32 @@
|
|
g.course_num_ as courseNum,
|
|
g.course_num_ as courseNum,
|
|
g.complete_course_num_ as completeCourseNum
|
|
g.complete_course_num_ as completeCourseNum
|
|
FROM
|
|
FROM
|
|
- course_schedule_student_payment as a
|
|
|
|
- LEFT JOIN course_schedule cs on a.course_id_ = cs.id_
|
|
|
|
|
|
+ (select * from (
|
|
|
|
+ select cssp.user_id_,cssp.course_id_,cssp.order_no_,cs.status_,cs.type_,
|
|
|
|
+ cs.course_group_id_,cs.class_date_,cs.start_time_,cs.end_time_,cs.class_num_
|
|
|
|
+ from course_schedule_student_payment cssp
|
|
|
|
+ LEFT JOIN course_schedule cs on cssp.course_id_ = cs.id_
|
|
|
|
+ WHERE cs.type_ = #{param.type} AND cssp.user_id_ = #{param.studentId}
|
|
|
|
+ order by cs.start_time_) cs
|
|
|
|
+ group by cs.course_group_id_) cs
|
|
LEFT JOIN course_group g ON cs.course_group_id_ = g.id_
|
|
LEFT JOIN course_group g ON cs.course_group_id_ = g.id_
|
|
LEFT JOIN `subject` sb ON g.subject_id_=sb.id_
|
|
LEFT JOIN `subject` sb ON g.subject_id_=sb.id_
|
|
LEFT JOIN sys_user su on g.teacher_id_ = su.id_
|
|
LEFT JOIN sys_user su on g.teacher_id_ = su.id_
|
|
- LEFT JOIN user_order o on a.order_no_ = o.order_no_
|
|
|
|
- WHERE cs.type_=#{param.type}
|
|
|
|
- AND a.user_id_ = #{param.studentId}
|
|
|
|
- <if test="param.orderState != null">
|
|
|
|
- AND o.status_ = #{param.orderState}
|
|
|
|
- </if>
|
|
|
|
- <if test="param.subjectId != null">
|
|
|
|
- AND g.subject_id_ = #{param.subjectId}
|
|
|
|
- </if>
|
|
|
|
- <if test="param.courseState != null">
|
|
|
|
- and cs.status_ = #{param.courseState}
|
|
|
|
- </if>
|
|
|
|
|
|
+ LEFT JOIN user_order o on cs.order_no_ = o.order_no_
|
|
|
|
+ <where>
|
|
|
|
+ <if test="param.orderState != null">
|
|
|
|
+ AND o.status_ = #{param.orderState}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="param.subjectId != null">
|
|
|
|
+ AND g.subject_id_ = #{param.subjectId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="param.courseState != null">
|
|
|
|
+ and cs.status_ = #{param.courseState}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="param.search != null and param.search != ''">
|
|
|
|
+ and g.name_ like CONCAT('%',#{param.search},'%')
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<insert id="addCourseGroup" parameterType="com.yonge.cooleshow.biz.dal.dto.PracticeScheduleDto" useGeneratedKeys="true" keyProperty="groupId">
|
|
<insert id="addCourseGroup" parameterType="com.yonge.cooleshow.biz.dal.dto.PracticeScheduleDto" useGeneratedKeys="true" keyProperty="groupId">
|