|
@@ -85,6 +85,9 @@
|
|
|
or b.name_ like concat('%',#{param.search},'%')
|
|
|
)
|
|
|
</if>
|
|
|
+ <if test="param.type != null and param.type != ''">
|
|
|
+ and b.type_ = #{param.type}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
@@ -135,6 +138,9 @@
|
|
|
<if test="param.auditVersion != null ">
|
|
|
and #{param.auditVersion} = b.audit_version_
|
|
|
</if>
|
|
|
+ <if test="param.subjectId != null ">
|
|
|
+ and #{param.subjectId} = b.subject_id_
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
@@ -357,7 +363,7 @@
|
|
|
LEFT JOIN sys_user su ON sp.user_id_=su.id_
|
|
|
LEFT JOIN (SELECT course_group_id_,COUNT(1) AS count_ FROM course_schedule WHERE type_='PRACTICE' AND status_='COMPLETE' GROUP BY course_group_id_) cs ON cg.id_=cs.course_group_id_
|
|
|
LEFT JOIN (SELECT course_group_id_,start_time_ FROM course_schedule WHERE type_='PRACTICE' GROUP BY course_group_id_) cst ON cg.id_=cst.course_group_id_
|
|
|
- WHERE cg.type_='PRACTICE'
|
|
|
+ WHERE cg.type_='PRACTICE' AND cg.status_ IN('ING','COMPLETE')
|
|
|
<if test="param.search != null and param.search != ''">
|
|
|
AND (
|
|
|
cg.id_ LIKE concat('%',#{param.search},'%') OR
|
|
@@ -405,6 +411,7 @@
|
|
|
LEFT JOIN student_attendance sa ON cs.id_=sa.course_schedule_id_
|
|
|
LEFT JOIN course_schedule_teacher_salary ts ON cs.id_=ts.course_schedule_id_
|
|
|
WHERE cs.type_='PRACTICE'
|
|
|
+ AND cs.lock_=0
|
|
|
AND cs.course_group_id_=#{param.courseGroupId}) a
|
|
|
<where>
|
|
|
<if test="param.search != null and param.search != ''">
|
|
@@ -477,6 +484,142 @@
|
|
|
AND cg.status_ = #{param.status}
|
|
|
</if>
|
|
|
</select>
|
|
|
+ <select id="selectLiveGroupStudent" resultType="com.yonge.cooleshow.biz.dal.vo.CourseSchedulePaymentVo">
|
|
|
+ SELECT
|
|
|
+ p.user_id_ AS studentId,
|
|
|
+ u.username_ AS studentName,
|
|
|
+ u.real_name_ AS studentRealName,
|
|
|
+ u.phone_ AS studentPhone,
|
|
|
+ p.actual_price_ AS actualPrice,
|
|
|
+ p.order_no_ AS orderNo,
|
|
|
+ o.create_time_ AS createdOrderTime
|
|
|
+ FROM course_schedule_student_payment p
|
|
|
+ LEFT JOIN sys_user u ON p.user_id_=u.id_
|
|
|
+ LEFT JOIN user_order o ON p.order_no_ = o.order_no_
|
|
|
+ WHERE p.course_group_id_=#{param.groupId}
|
|
|
+ <if test="param.search != null and param.search != ''">
|
|
|
+ AND (
|
|
|
+ p.course_id_ LIKE concat('%',#{param.search},'%') OR
|
|
|
+ p.user_id_ LIKE concat('%',#{param.search},'%') OR
|
|
|
+ u.username_ LIKE concat('%',#{param.search},'%') OR
|
|
|
+ u.phone_ LIKE concat('%',#{param.search},'%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="param.orderNo != null and param.orderNo != ''">
|
|
|
+ AND p.order_no_ = #{param.orderNo}
|
|
|
+ </if>
|
|
|
+ <if test="param.startTime != null">
|
|
|
+ AND o.create_time_ <= #{param.startTime}
|
|
|
+ </if>
|
|
|
+ <if test="param.endTime != null">
|
|
|
+ AND o.create_time_ >= #{param.endTime}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="selectLiveGroupPlan" resultType="com.yonge.cooleshow.biz.dal.vo.CourseSchedulePlanVo">
|
|
|
+ SELECT
|
|
|
+ cs.id_ AS courseId,
|
|
|
+ g.course_introduce_ AS courseIntroduce,
|
|
|
+ cs.class_num_ AS classNum,
|
|
|
+ cs.class_date_ AS classDate,
|
|
|
+ cs.start_time_ AS startTime,
|
|
|
+ cs.end_time_ AS endTime,
|
|
|
+ ts.status_ AS salaryStatus,
|
|
|
+ v.url_ AS url,
|
|
|
+ cs.status_ AS courseStatus,
|
|
|
+ (CASE WHEN cs.start_time_ >= ta.sign_in_time_ THEN 1 ELSE 0 END) AS teacherInSign,
|
|
|
+ (CASE WHEN cs.end_time_ <= ta.sign_out_time_ THEN 1 ELSE 0 END) AS teacherOutSign
|
|
|
+ FROM course_schedule cs
|
|
|
+ LEFT JOIN course_group g ON cs.course_group_id_=g.id_
|
|
|
+ LEFT JOIN course_schedule_teacher_salary ts ON cs.id_=ts.course_schedule_id_
|
|
|
+ LEFT JOIN live_room_video v ON cs.id_=v.course_id_
|
|
|
+ LEFT JOIN teacher_attendance ta ON cs.id_=ta.course_schedule_id_
|
|
|
+ WHERE cs.course_group_id_= #{param.groupId}
|
|
|
+ <if test="param.salaryStatus != null and param.salaryStatus != ''">
|
|
|
+ AND ts.status_ = #{param.salaryStatus}
|
|
|
+ </if>
|
|
|
+ <if test="param.startTime != null">
|
|
|
+ AND cs.start_time_ <= #{param.startTime}
|
|
|
+ </if>
|
|
|
+ <if test="param.endTime != null">
|
|
|
+ AND cs.end_time_ >= #{param.endTime}
|
|
|
+ </if>
|
|
|
+ <if test="param.endTime != null">
|
|
|
+ AND cs.id_ LIKE concat('%',#{param.courseId},'%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="selectVideoGroup" resultType="com.yonge.cooleshow.biz.dal.vo.CourseGroupVideoVo">
|
|
|
+ SELECT
|
|
|
+ g.id_ AS groupId,
|
|
|
+ g.lesson_name_ AS lessonName,
|
|
|
+ g.lesson_subject_ AS subjectId,
|
|
|
+ s.name_ AS subjectName,
|
|
|
+ g.lesson_count_ AS lessonCount,
|
|
|
+ IFNULL(p.count_,0) AS buyCount,
|
|
|
+ g.teacher_id_ AS teacherId,
|
|
|
+ u.username_ AS teacherName,
|
|
|
+ u.real_name_ AS teacherRealName,
|
|
|
+ g.create_time_ AS createTime
|
|
|
+ FROM video_lesson_group g
|
|
|
+ LEFT JOIN `subject` s ON g.lesson_subject_=s.id_
|
|
|
+ LEFT JOIN sys_user u ON g.teacher_id_=u.id_
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT video_lesson_group_id_,COUNT(1) AS count_ FROM video_lesson_purchase_record
|
|
|
+ WHERE order_status_='PAID' GROUP BY video_lesson_group_id_) p ON g.id_=p.video_lesson_group_id_
|
|
|
+ <where>
|
|
|
+ <if test="param.search != null and param.search != ''">
|
|
|
+ AND (
|
|
|
+ g.id_ LIKE concat('%',#{param.search},'%') OR
|
|
|
+ g.lesson_name_ LIKE concat('%',#{param.search},'%') OR
|
|
|
+ g.teacher_id_ LIKE concat('%',#{param.search},'%') OR
|
|
|
+ u.username_ LIKE concat('%',#{param.search},'%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="param.subjectId != null and param.subjectId != ''">
|
|
|
+ AND g.lesson_subject_ = #{param.subjectId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <select id="selectVideoGroupStudent" resultType="com.yonge.cooleshow.biz.dal.vo.CourseGroupStudentVo">
|
|
|
+ SELECT
|
|
|
+ r.student_id_ AS studentId,
|
|
|
+ u.username_ AS studentName,
|
|
|
+ u.real_name_ AS studentRealName,
|
|
|
+ u.phone_ AS studentPhone,
|
|
|
+ r.order_no_ AS orderNo,
|
|
|
+ r.pay_money_ AS payMoney,
|
|
|
+ o.create_time_ AS createTime
|
|
|
+ FROM video_lesson_purchase_record r
|
|
|
+ LEFT JOIN sys_user u ON r.student_id_=u.id_
|
|
|
+ LEFT JOIN user_order o ON r.order_no_=o.order_no_
|
|
|
+ WHERE r.order_status_='PAID'
|
|
|
+ AND video_lesson_group_id_ = #{param.groupId}
|
|
|
+ <if test="param.search != null and param.search != ''">
|
|
|
+ AND (
|
|
|
+ r.student_id_ LIKE concat('%',#{param.search},'%') OR
|
|
|
+ u.username_ LIKE concat('%',#{param.search},'%') OR
|
|
|
+ u.phone_ LIKE concat('%',#{param.search},'%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="param.orderNo != null and param.orderNo != ''">
|
|
|
+ AND r.order_no_ = #{param.orderNo}
|
|
|
+ </if>
|
|
|
+ <if test="param.startTime != null">
|
|
|
+ AND o.create_time_ <= #{param.startTime}
|
|
|
+ </if>
|
|
|
+ <if test="param.endTime != null">
|
|
|
+ AND o.create_time_ >= #{param.endTime}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="selectVideoGroupPlan" resultType="com.yonge.cooleshow.biz.dal.entity.VideoLessonGroupDetail">
|
|
|
+ SELECT
|
|
|
+ id_ AS id,
|
|
|
+ video_title_ AS videoTitle,
|
|
|
+ video_content_ AS videoContent,
|
|
|
+ video_url_ AS videoUrl,
|
|
|
+ cover_url_ AS coverUrl
|
|
|
+ FROM video_lesson_group_detail
|
|
|
+ WHERE video_lesson_group_id_=#{param.groupId}
|
|
|
+ </select>
|
|
|
|
|
|
<update id="opsPreStudentNum">
|
|
|
update course_group
|