Commit 69d5c01e authored by 黄奎's avatar 黄奎

页面修改

parent 67fbe49b
......@@ -423,16 +423,18 @@ WHERE p.`Status`=0 AND p.Group_Id={group_Id} AND p.ClassId ={classId}
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT * from (SELECT
(SELECT COUNT(*) from rb_class_plan where `Status`=0 and DATE_FORMAT(ClassDate,'%Y-%m-%d') <=DATE_FORMAT(a.ClassDate,'%Y-%m-%d') and ClassId=a.ClassId) as Ranks,
A.*,class.ClassName,lp.LessonPlanNum,lps.LessonPlanSummaryNum,IFNULL(B.RoomName,'') AS RoomName,IFNULL(T.TeacherName,'') AS TeacherName,IFNULL(T.TeacherHead,'') AS UserIcon
FROM RB_Class_Plan AS A LEFT JOIN rb_class_room AS B ON A.ClassRoomId=B.RoomId
LEFT JOIN rb_class as class on a.ClassId=class.ClassId
LEFT JOIN rb_teacher AS T ON A.TeacherId=T.TId
LEFT JOIN (SELECT ClassPlanId,COUNT(*) as LessonPlanNum from rb_class_lessonplan where `Status`=0 GROUP BY ClassPlanId)as lp on a.ClassPlanId=lp.ClassPlanId
LEFT JOIN (SELECT ClassPlanId,COUNT(*) as LessonPlanSummaryNum from rb_class_lessonplan where `Status`=0 and ISNULL(Summary)=0 and LENGTH(trim(Summary))>0 GROUP BY ClassPlanId)as lps on a.ClassPlanId=lps.ClassPlanId
WHERE 1=1 and class.ClassStatus in(1,2) and t.`Status`=0 and a.`Status`=0 and class.`Status`=0 ORDER BY a.ClassId,a.ClassDate) as a where 1=1
");
SELECT *
FROM
( SELECT (SELECT COUNT(*) from rb_class_plan where `Status`=0 and DATE_FORMAT(ClassDate,'%Y-%m-%d') <=DATE_FORMAT(a.ClassDate,'%Y-%m-%d') and ClassId=a.ClassId) as Ranks,
A.*,class.ClassName,lp.LessonPlanNum,lps.LessonPlanSummaryNum,IFNULL(B.RoomName,'') AS RoomName,IFNULL(T.TeacherName,'') AS TeacherName,IFNULL(T.TeacherHead,'') AS UserIcon
FROM RB_Class_Plan AS A LEFT JOIN rb_class_room AS B ON A.ClassRoomId=B.RoomId
LEFT JOIN rb_class as class on a.ClassId=class.ClassId
LEFT JOIN rb_teacher AS T ON A.TeacherId=T.TId
LEFT JOIN (SELECT ClassPlanId,COUNT(*) as LessonPlanNum from rb_class_lessonplan where `Status`=0 GROUP BY ClassPlanId)as lp on a.ClassPlanId=lp.ClassPlanId
LEFT JOIN (SELECT ClassPlanId,COUNT(*) as LessonPlanSummaryNum from rb_class_lessonplan where `Status`=0 and ISNULL(Summary)=0 and LENGTH(trim(Summary))>0 GROUP BY ClassPlanId) as lps on a.ClassPlanId=lps.ClassPlanId
WHERE 1=1 and class.ClassStatus in(1,2,3) and t.`Status`=0 and a.`Status`=0 and class.`Status`=0 ORDER BY a.ClassId,a.ClassDate
) AS a
WHERE 1=1 ");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_Plan_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment