| 
					
				 | 
			
			
				@@ -799,4 +799,53 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             AND g.status_ = #{param.status} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <select id="selectPianoGroupStudentDetail" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            resultType="com.yonge.cooleshow.biz.dal.vo.CourseGroupPianoDetailVo"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SELECT * FROM ( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SELECT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cs.id_ AS courseId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        sb.id_ AS subjectId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        sb.name_ AS subjectName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cs.teacher_id_ AS teacherId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        tu.username_ AS teacherName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        tu.real_name_ AS teacherRealName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cs.status_ AS `status`, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        a.studentCount AS studentCount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        (cs.single_course_time_ * a.studentCount) AS course_time_, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cs.start_time_ AS startTime, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cs.end_time_ AS endTime, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        p.user_id_ AS userId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        (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, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        (CASE WHEN cs.start_time_ >= sa.sign_in_time_ AND cs.end_time_ <= sa.sign_out_time_ THEN 1 ELSE 0 END) AS studentSign, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        (CASE WHEN cs.start_time_ >= ta.sign_in_time_ AND cs.end_time_ <= ta.sign_out_time_ THEN 1 ELSE 0 END) AS teacherSign 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        FROM course_schedule cs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN course_group cg ON cs.course_group_id_ = cg.id_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN `subject` sb ON cg.subject_id_ = sb.id_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN sys_user tu ON cs.teacher_id_ = tu.id_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN (SELECT course_id_,COUNT(1) AS studentCount FROM course_schedule_student_payment WHERE course_type_='PIANO_ROOM_CLASS' GROUP BY course_id_) a ON cs.id_=a.course_id_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN teacher_attendance ta ON cs.id_=ta.course_schedule_id_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN student_attendance sa ON cs.id_=sa.course_schedule_id_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN course_schedule_student_payment p ON cs.id_=p.course_id_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WHERE cs.type_='PIANO_ROOM_CLASS' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        AND p.user_id_=#{param.studentId}) m 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="param.search != null and param.search != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            AND courseId LIKE concat('%',#{param.search},'%') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="param.studentSign != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            AND studentSign = #{param.studentSign} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="param.teacherSign != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            AND teacherSign = #{param.teacherSign} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="param.status != null and param.status != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            AND `status` = #{param.status} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="param.startTime != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            AND startTime <= #{param.startTime} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="param.endTime != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            AND endTime >= #{param.endTime} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </mapper> 
			 |