|
@@ -89,6 +89,129 @@
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectAdminLivePage" resultType="com.yonge.cooleshow.biz.dal.vo.LiveCourseGroupVo">
|
|
|
+ select distinct
|
|
|
+ cg.id_ as courseGroupId,
|
|
|
+ cg.name_ as name,
|
|
|
+ cg.complete_course_num_ as endCourseNum,
|
|
|
+ if(cg.complete_course_num_ = 0 ,cg.course_num_,cg.course_num_ - cg.complete_course_num_) as noStartCourseNum,
|
|
|
+ cg.course_price_ as coursePrice,
|
|
|
+ cg.pre_student_num_ as preStudentNum,
|
|
|
+ cg.status_ as status,
|
|
|
+ cg.course_num_ as courseNum,
|
|
|
+ cg.created_time_ as createTime,
|
|
|
+ cg.course_introduce_ as courseIntroduce
|
|
|
+ from course_group cg
|
|
|
+ left join course_schedule_student_payment cssp on cg.id_ = cssp.course_group_id_
|
|
|
+ <if test="param.search != null and param.search != ''">
|
|
|
+ left join sys_user su on su.id_ = cssp.user_id_
|
|
|
+ </if>
|
|
|
+ <where>
|
|
|
+ <if test="param.teacherId != null">
|
|
|
+ and #{param.teacherId} = cg.teacher_id_
|
|
|
+ </if>
|
|
|
+ <if test="param.search != null and param.search !=''">
|
|
|
+ and (
|
|
|
+ cg.id_ like concat('%',#{param.search},'%')
|
|
|
+ or su.id_ like concat('%',#{param.search},'%')
|
|
|
+ or su.username_ like concat('%',#{param.search},'%')
|
|
|
+ or su.phone_ like concat('%',#{param.search},'%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="param.orderNo != null and param.orderNo != ''">
|
|
|
+ and cssp.order_no_ like concat('%',#{param.orderNo},'%')
|
|
|
+ </if>
|
|
|
+ <if test="param.subjectId != null">
|
|
|
+ and #{param.subjectId} = cg.subject_id_
|
|
|
+ </if>
|
|
|
+ <if test="param.status != null">
|
|
|
+ and #{param.status} = cg.status_
|
|
|
+ </if>
|
|
|
+ <if test="param.startTime != null">
|
|
|
+ and #{param.startTime} <= cg.created_time_
|
|
|
+ </if>
|
|
|
+ <if test="param.endTime != null">
|
|
|
+ and #{param.endTime} >= cg.created_time_
|
|
|
+ </if>
|
|
|
+ <if test="param.courseType != null">
|
|
|
+ and #{param.courseType} = cg.type_
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectCourseGroupSubject" resultType="com.yonge.cooleshow.biz.dal.vo.LiveCourseGroupVo">
|
|
|
+ select
|
|
|
+ cg.id_ as courseGroupId,
|
|
|
+ s.name_ as subjectName
|
|
|
+ from course_group cg
|
|
|
+ left join subject s on cg.subject_id_ = s.id_
|
|
|
+ <where>
|
|
|
+ <if test="courseGroupIdList != null and courseGroupIdList.size() != 0">
|
|
|
+ and cg.id_ in
|
|
|
+ <foreach collection="courseGroupIdList" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <if test="courseGroupIdList != null and courseGroupIdList.size() != 0">
|
|
|
+ order by field(cg.id_,
|
|
|
+ <foreach collection="courseGroupIdList" item="item" open="" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
+ <select id="selectAdminLiveStudentPage" resultType="com.yonge.cooleshow.biz.dal.vo.LiveCourseGroupStudentVo">
|
|
|
+ select
|
|
|
+ su.id_ as studentId,
|
|
|
+ su.username_ as studentName,
|
|
|
+ cssp.actual_price_ as price,
|
|
|
+ cssp.order_no_ as orderNo,
|
|
|
+ cssp.created_time_ as payTime
|
|
|
+ from course_schedule_student_payment cssp
|
|
|
+ left join sys_user su on cssp.user_id_ = su.id_
|
|
|
+ <where>
|
|
|
+ <if test="param.courseGroupId != null">
|
|
|
+ and #{param.courseGroupId} = cssp.course_group_id_
|
|
|
+ </if>
|
|
|
+ <if test="param.search != null and param.search != ''">
|
|
|
+ and (
|
|
|
+ cssp.course_group_id_ like concat('%',#{param.search},'%')
|
|
|
+ or su.id_ like concat('%',#{param.search},'%')
|
|
|
+ or su.username_ like concat('%',#{param.search},'%')
|
|
|
+ or su.phone_ like concat('%',#{param.search},'%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="param.orderNo != null and param.orderNo != ''">
|
|
|
+ and cssp.order_no_ like concat('%',#{param.orderNo},'%')
|
|
|
+ </if>
|
|
|
+ <if test="param.startTime != null">
|
|
|
+ and #{param.startTime} <= cssp.created_time_
|
|
|
+ </if>
|
|
|
+ <if test="param.endTime != null">
|
|
|
+ and #{param.endTime} >= cssp.created_time_
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
|
|
|
+ <select id="selectAdminLivePlan" resultType="com.yonge.cooleshow.biz.dal.vo.LiveCourseGroupPlanVo">
|
|
|
+ select
|
|
|
+ cs.id_ as courseId,
|
|
|
+ cs.class_num_ as classNum,
|
|
|
+ cs.class_date_ as classDate,
|
|
|
+ cs.start_time_ as startTime,
|
|
|
+ cs.end_time_ as endTime,
|
|
|
+ cs.status_ as courseStatus,
|
|
|
+ cp.plan_ as planInfo,
|
|
|
+ lrv.url_ as videoUrl
|
|
|
+ from course_schedule cs
|
|
|
+ left join live_room_video lrv on cs.id_ = lrv.course_id_
|
|
|
+ left join course_plan cp on cp.course_group_id_ = cs.course_group_id_ and cp.class_num_ = cs.class_num_
|
|
|
+ <where>
|
|
|
+ <if test="courseGroupId != null">
|
|
|
+ and #{courseGroupId} = cs.course_group_id_
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by cs.class_num_
|
|
|
+ </select>
|
|
|
</mapper>
|