//string sql = $@"UPDATE rb_scroll_appointment SET ChapterNo = ChapterNo +{ChapterNum} WHERE Group_Id ={groupId} and StuId ={stuId} and GuestId ={guestId} ";
stringsql=$@"UPDATE rb_scroll_appointment a
SET a.ChapterNo = a.ChapterNo +{ChapterNum},a.CourseGradeId = (SELECT CourseRate FROM rb_course_chapter c WHERE c.Group_Id ={groupId} and c.CourseId =a.LearnCourseId and c.ChapterNo =a.ChapterNo)
,a.CourseGradeNo = (SELECT ChapterGradeNo FROM rb_course_chapter c WHERE c.Group_Id ={groupId} and c.CourseId =a.LearnCourseId and c.ChapterNo =a.ChapterNo)
@@ -90,7 +90,9 @@ WHERE 1=1 AND B.OrderState=1 AND B.OrderType=1 AND E.ClassScrollType=2
StringBuilderappointBuilder=newStringBuilder();
appointBuilder.AppendFormat(@"
SELECT A.Date,A.AccountId,A.State,A.GuestId,A.LearnCourseId,A.CourseGradeId,A.CourseGradeNo,IFNULL(C.ClassCheckId,0) AS ClassCheckId,IFNULL(C.CurrentDeductionHours,0) AS CurrentDeductionHours
SELECT A.Date,A.AccountId,A.State,A.GuestId,A.LearnCourseId,A.CourseGradeId,A.CourseGradeNo,IFNULL(C.ClassCheckId,0) AS ClassCheckId
,IFNULL(C.CurrentDeductionHours,0) AS CurrentDeductionHours,IFNULL(C.AttendanceMethod,0) AS AttendanceMethod,IFNULL(A.CourseSTime,'') AS StartTime
,IFNULL(A.CourseETime,'') AS EndTime
FROM rb_scroll_appointment AS A LEFT JOIN rb_class_time AS B ON A.ClassPlanId=B.ClassPlanId
LEFT JOIN rb_class_check AS C ON B.ClassTimeId=C.ClassTimeId AND A.GuestId=C.OrderGuestId
WHERE 1=1 AND A.State IN(3) AND A.AppointType IN(1,2)