| 
					
				 | 
			
			
				@@ -778,13 +778,15 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         LEFT JOIN class_group cg ON cs.class_group_id_ = cg.id_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         LEFT JOIN school s ON cs.schoole_id_ = s.id_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         LEFT JOIN teacher_attendance ta ON cs.id_=ta.course_schedule_id_ AND ta.teacher_id_=#{userId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        WHERE cs.del_flag_ = 0 AND cs.is_lock_ = 0 AND cs.merge_flag_ = 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        AND cs.class_date_ >= DATE_FORMAT(NOW(),'%Y%m%d') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        AND cs.status_ IN ('NOT_START','UNDERWAY') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        AND csts.user_id_ = #{userId} AND cs.pre_course_flag_ != 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WHERE cs.del_flag_ = 0 AND cs.is_lock_ = 0 AND cs.merge_flag_ = 0 AND cs.pre_course_flag_ != 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        AND csts.user_id_ = #{userId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <if test="courseId != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             AND cs.id_ = #{courseId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="courseId == null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            AND cs.class_date_ >= DATE_FORMAT(NOW(),'%Y%m%d') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            AND cs.status_ IN ('NOT_START','UNDERWAY') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ORDER BY cs.class_date_,cs.start_class_time_ LIMIT 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |