|  | @@ -485,7 +485,140 @@
 | 
	
		
			
				|  |  |          </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">
 |