SELECT A.*,(SELECT Id FROM RB_ActivitySurvey_Guest WHERE GuestType=2 AND IsFinish=0 AND SurveyId=A.ID AND StartTime<'{0}' AND EndTime>'{0}' AND GuestId={1} LIMIT 1) AS ActivitySurveyGuestId
@@ -448,10 +448,10 @@ where sog.Status =0 and o.Group_Id ={group_Id} and o.OrderState <>3 and IFNULL(o
{
where+=$" and s.{nameof(RB_Student_ViewModel.StuPurpose)} ={demodel.StuPurpose}";
}
if(demodel.School_Id>-1)
{
where+=$" and cl.School_Id ={demodel.School_Id}";
}
//if (demodel.School_Id > -1)
//{
// where += $" and cl.School_Id ={demodel.School_Id}";
//}
if(demodel.ConsultantId>0)
{
where+=$@" AND s.StuId IN (SELECT StuId FROM rb_student_assist WHERE AssistId ={demodel.ConsultantId} AND `Status`=0)";
...
...
@@ -539,7 +539,11 @@ FROM rb_student s
INNER JOIN rb_course c on o.CourseId = c.CourseId
LEFT JOIN rb_education_contract ec on ec.GuestId = og.GuestId
LEFT JOIN rb_student_advisorconfig AS b ON s.AdvisorStatus=B.Id
LEFT JOIN (SELECT OrderGuestId,MIN(ClassDate) AS ClassDate FROM rb_class_check WHERE Status=0 AND CheckStatus=0 GROUP BY OrderGuestId) AS clcheck ON org.Id=clcheck.OrderGuestId
LEFT JOIN (
SELECT B.Student_Id,MIN(A.ClassDate) AS ClassDate
FROM rb_class_check AS A INNER JOIN rb_student_orderguest AS B ON A.OrderGuestId=B.GuestId
WHERE A.Status=0 AND A.CheckStatus=0 GROUP BY B.Student_Id
@@ -29,6 +29,7 @@ SELECT DATE_FORMAT(A.Date, '%Y-%m-%d') AS Date,A.YearStr,SUM(StudentCount) AS St
,SUM(N4ClassHoursScore) AS N4ClassHoursScore,SUM(N3ClassHours) AS N3ClassHours,SUM(N3ClassHoursScore) AS N3ClassHoursScore,SUM(N2ClassHours) AS N2ClassHours,SUM(N2ClassHoursScore) AS N2ClassHoursScore
,SUM(N1ClassHours) AS N1ClassHours,SUM(N1ClassHoursScore) AS N1ClassHoursScore,SUM(MiniAppPractise) AS MiniAppPractise,SUM(MiniAppPractiseScore) AS MiniAppPractiseScore,SUM(MiniAppTime) AS MiniAppTime
,SUM(MiniAppTimeScore) AS MiniAppTimeScore,SUM(TotalScore) AS TotalScore,SUM(AvgScore) AS AvgScore,SUM(ScoreGap) AS ScoreGap,SUM(ActivityNum) AS ActivityNum
,SUM(SpeakClassScore) AS SpeakClassScore,SUM(SpeakVipScore) AS SpeakVipScore,SUM(GradeTestScore) AS GradeTestScore,SUM(SpeakFailScore) AS SpeakFailScore
FROM RB_Teacher_Static AS A
WHERE 1=1
");
...
...
@@ -87,6 +88,7 @@ SELECT A.TeacherId,CONCAT(DATE_FORMAT(A.Date, '%Y-%m'),'-01') AS Date,A.YearStr,
,SUM(N4ClassHoursScore) AS N4ClassHoursScore,SUM(N3ClassHours) AS N3ClassHours,SUM(N3ClassHoursScore) AS N3ClassHoursScore,SUM(N2ClassHours) AS N2ClassHours,SUM(N2ClassHoursScore) AS N2ClassHoursScore
,SUM(N1ClassHours) AS N1ClassHours,SUM(N1ClassHoursScore) AS N1ClassHoursScore,SUM(MiniAppPractise) AS MiniAppPractise,SUM(MiniAppPractiseScore) AS MiniAppPractiseScore,SUM(MiniAppTime) AS MiniAppTime
,SUM(MiniAppTimeScore) AS MiniAppTimeScore,SUM(TotalScore) AS TotalScore,SUM(AvgScore) AS AvgScore,SUM(ScoreGap) AS ScoreGap,SUM(ActivityNum) AS ActivityNum
,SUM(SpeakClassScore) AS SpeakClassScore,SUM(SpeakVipScore) AS SpeakVipScore,SUM(GradeTestScore) AS GradeTestScore,SUM(SpeakFailScore) AS SpeakFailScore
FROM RB_Teacher_Static AS A
WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00' AND A.TeacherId>0
");
...
...
@@ -131,6 +133,7 @@ SELECT CONCAT(DATE_FORMAT(A.Date, '%Y-%m'),'-01') AS Date,A.YearStr,SUM(StudentC
,SUM(N4ClassHoursScore) AS N4ClassHoursScore,SUM(N3ClassHours) AS N3ClassHours,SUM(N3ClassHoursScore) AS N3ClassHoursScore,SUM(N2ClassHours) AS N2ClassHours,SUM(N2ClassHoursScore) AS N2ClassHoursScore
,SUM(N1ClassHours) AS N1ClassHours,SUM(N1ClassHoursScore) AS N1ClassHoursScore,SUM(MiniAppPractise) AS MiniAppPractise,SUM(MiniAppPractiseScore) AS MiniAppPractiseScore,SUM(MiniAppTime) AS MiniAppTime
,SUM(MiniAppTimeScore) AS MiniAppTimeScore,SUM(TotalScore) AS TotalScore,SUM(AvgScore) AS AvgScore,SUM(ScoreGap) AS ScoreGap,SUM(ActivityNum) AS ActivityNum
,SUM(SpeakClassScore) AS SpeakClassScore,SUM(SpeakVipScore) AS SpeakVipScore,SUM(GradeTestScore) AS GradeTestScore,SUM(SpeakFailScore) AS SpeakFailScore
FROM RB_Teacher_Static AS A
WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00'
");
...
...
@@ -182,6 +185,7 @@ SELECT CONCAT(A.YearStr,'-01','-01') AS Date,A.YearStr,SUM(StudentCount) AS Stud
,SUM(N4ClassHoursScore) AS N4ClassHoursScore,SUM(N3ClassHours) AS N3ClassHours,SUM(N3ClassHoursScore) AS N3ClassHoursScore,SUM(N2ClassHours) AS N2ClassHours,SUM(N2ClassHoursScore) AS N2ClassHoursScore
,SUM(N1ClassHours) AS N1ClassHours,SUM(N1ClassHoursScore) AS N1ClassHoursScore,SUM(MiniAppPractise) AS MiniAppPractise,SUM(MiniAppPractiseScore) AS MiniAppPractiseScore,SUM(MiniAppTime) AS MiniAppTime
,SUM(MiniAppTimeScore) AS MiniAppTimeScore,SUM(TotalScore) AS TotalScore,SUM(AvgScore) AS AvgScore,SUM(ScoreGap) AS ScoreGap,SUM(ActivityNum) AS ActivityNum
,SUM(SpeakClassScore) AS SpeakClassScore,SUM(SpeakVipScore) AS SpeakVipScore,SUM(GradeTestScore) AS GradeTestScore,SUM(SpeakFailScore) AS SpeakFailScore