builder.AppendFormat(" where {0}={1}",nameof(RB_Course_Chapter_ViewModel.CourseId),model.CourseId);
builder.AppendFormat(" and ({0} like '{1}%' or {2}={3})",nameof(RB_Course_Chapter_ViewModel.ChapterNo),model.ChapterNo,nameof(RB_Course_Chapter_ViewModel.ChapterId),model.ChapterId);
,(SELECT COUNT(0) as Num FROM rb_course_chapter c2 WHERE c2.`Status` =0 and c2.CourseId = c.CourseId and c2.CourseRate = c.CourseRate and c2.SortNum <= c.SortNum) AS GrageNum
FROM rb_course_chapter c WHERE c.`Status` =0 and c.CourseId ={courseId}) cc2 on cc.ChapterId =cc2.ChapterId
,(SELECT COUNT(0) as Num FROM rb_course_chapter c2 WHERE c2.`Status` =0 and c2.CourseId = c.CourseId and c2.CourseRate = c.CourseRate and c2.SortNum <= c.SortNum) AS GrageNum
FROM rb_course_chapter c
WHERE c.`Status` =0 and c.CourseId ={courseId}
) cc2 on cc.ChapterId =cc2.ChapterId
SET cc.ChapterGradeNo = cc2.GrageNum
WHERE cc.Group_Id ={group_Id} and cc.CourseId ={courseId} and cc.ChapterNo >={chapterNo}";
WHERE cc.Group_Id ={group_Id} and cc.CourseId ={courseId}";