builder.AppendFormat($@"SELECT t.TeacherName,croom.RoomName,t.TeacherIcon,c.ClassHours,c.ClassName,cou.CourseName,lp.LessonPlanId,A.ClassPlanId,A.ClassId,A.`Status`,A.ClassRoomId,A.Group_Id,A.School_Id,A.TeacherId,B.ClassTimeId,CONCAT( DATE_FORMAT(A.ClassDate,'%Y-%m-%d') ,' ',B.StartTime,':00') AS NewPlanDateTime,
B.EndTime,B.StartTime,B.SuiPai,B.ClassStatus,CONCAT( DATE_FORMAT(A.ClassDate,'%Y-%m-%d') ,' ',B.EndTime,':00') AS NewEndPlanDateTime
FROM rb_class_plan AS A INNER JOIN rb_class_time AS B ON A.ClassPlanId=B.ClassPlanId
LEFT JOIN rb_teacher as t on a.TeacherId=t.TId
LEFT JOIN rb_class as c on c.ClassId=a.ClassId
LEFT JOIN rb_course as cou on cou.CourseId=c.CouseId
LEFT JOIN rb_class_room as croom on croom.RoomId=a.ClassRoomId
LEFT JOIN (SELECT ClassPlanId,MAX(LessonPlanId) as LessonPlanId from rb_class_lessonplan where `Status`=0 GROUP BY ClassPlanId) as lp on lp.ClassPlanId=a.ClassPlanId
where a.`Status`=0 and c.ClassStatus =2 and a.TeacherId={TId} and a.Group_Id={Group_Id} and DATE_FORMAT(A.ClassDate,'%Y-%m-%d')>=DATE_FORMAT(NOW(),'%Y-%m-%d') ORDER BY CONCAT( DATE_FORMAT(A.ClassDate,'%Y-%m-%d') ,' ',B.EndTime,':00') asc LIMIT 10");