case when og.TotalHours <= og.CompleteHours then 3 else
case when og.CompleteHours = 0 then 1 else
case when og.TotalHours > og.CompleteHours then 2 else 0 end end end as ClassStatus,
sch.SName,sch.SId,t.TeacherName,o.EnterID,og.TotalHours,og.CompleteHours, if((og.ValidClassHours-og.CompleteHours)<0,0,(og.ValidClassHours-og.CompleteHours)) as SurplusHours
case when og.TotalHours <= og.CompleteHours then 3 else
case when og.CompleteHours = 0 then 1 else
case when og.TotalHours > og.CompleteHours then 2 else 0 end end end as ClassStatus,
sch.SName,sch.SId,t.TeacherName,o.EnterID,og.TotalHours,og.CompleteHours, if((og.ValidClassHours-og.CompleteHours)<0,0,(og.ValidClassHours-og.CompleteHours)) as SurplusHours
,cou.OpenBankLevel
FROM rb_student as s LEFT JOIN rb_student_orderguest as sog on s.StuId=sog.Student_Id
LEFT JOIN rb_order_guest as og on og.Id=sog.GuestId
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Student_Company_Extend.Times),query.Times);
}
if(query.IsQueryNotMoney==1)
{
builder.AppendFormat(" AND (A.{0}<>0 OR A.{1}<>0) ",nameof(RB_Student_Company_Extend.OrderNotMoney),nameof(RB_Student_Company_Extend.StudyOrderNotMoney));
}
}
builder.AppendFormat(" ORDER BY A.{0} ASC ",nameof(RB_Student_Company_Extend.Id));
@@ -66,7 +70,7 @@ SELECT CONCAT(DATE_FORMAT(A.Date, '%Y-%m'),'-01') AS Date,A.YearStr,A.MonthStr,S
,SUM(A.ClassCCount) AS ClassCCount,SUM(A.ClassDCount) AS ClassDCount,SUM(A.CustomerCount) AS CustomerCount,SUM(A.B2CCount) AS B2CCount,SUM(A.TransCount) AS TransCount
,SUM(A.InnerCount) AS InnerCount,SUM(A.InvalidCount) AS InvalidCount,SUM(A.SuspectedCount) AS SuspectedCount,SUM(A.IntentionCount) AS IntentionCount
,SUM(A.InvitationCount) AS InvitationCount,SUM(A.NegotiationCount) AS NegotiationCount,SUM(A.ContractCount) AS ContractCount,SUM(A.OrderMoney) AS OrderMoney
,SUM(A.StudyOrderMoney) AS StudyOrderMoney
,SUM(A.StudyOrderMoney) AS StudyOrderMoney,SUM(A.OrderNotMoney) AS OrderNotMoney,SUM(A.StudyOrderNotMoney) AS StudyOrderNotMoney
FROM RB_Student_Company AS A
WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00'
");
...
...
@@ -109,7 +113,7 @@ SELECT CONCAT(A.YearStr,'-01','-01') AS Date,A.YearStr,SUM(A.PushCount) AS PushC
,SUM(A.ClassCCount) AS ClassCCount,SUM(A.ClassDCount) AS ClassDCount,SUM(A.CustomerCount) AS CustomerCount,SUM(A.B2CCount) AS B2CCount,SUM(A.TransCount) AS TransCount
,SUM(A.InnerCount) AS InnerCount,SUM(A.InvalidCount) AS InvalidCount,SUM(A.SuspectedCount) AS SuspectedCount,SUM(A.IntentionCount) AS IntentionCount
,SUM(A.InvitationCount) AS InvitationCount,SUM(A.NegotiationCount) AS NegotiationCount,SUM(A.ContractCount) AS ContractCount,SUM(A.OrderMoney) AS OrderMoney
,SUM(A.StudyOrderMoney) AS StudyOrderMoney
,SUM(A.StudyOrderMoney) AS StudyOrderMoney,SUM(A.OrderNotMoney) AS OrderNotMoney,SUM(A.StudyOrderNotMoney) AS StudyOrderNotMoney
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Student_Market_Extend.Times),query.Times);
}
if(query.IsQueryNotMoney==1)
{
builder.AppendFormat(" AND (A.{0}<>0 OR A.{1}<>0) ",nameof(RB_Student_Market_Extend.OrderNotMoney),nameof(RB_Student_Market_Extend.StudyOrderNotMoney));
}
}
builder.AppendFormat(" ORDER BY A.{0} ASC ",nameof(RB_Student_Static_Extend.Id));
,SUM(A.OfficialAccount) AS OfficialAccount,SUM(A.TeacherRecommend) AS TeacherRecommend,SUM(A.ByteDance) AS ByteDance,SUM(A.ThirdPartyPlatform) AS ThirdPartyPlatform
,SUM(A.Other) AS Other,SUM(A.ClassACount) AS ClassACount,SUM(A.ClassBCount) AS ClassBCount,SUM(A.ClassCCount) AS ClassCCount,SUM(A.ClassDCount) AS ClassDCount
,SUM(A.InvalidCount) AS InvalidCount,SUM(A.ContractCount) AS ContractCount,SUM(A.OrderMoney) AS OrderMoney,SUM(A.StudyOrderMoney) AS StudyOrderMoney
,SUM(A.OrderNotMoney) AS OrderNotMoney,SUM(A.StudyOrderNotMoney) AS StudyOrderNotMoney
FROM RB_Student_Market AS A
WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00'
");
...
...
@@ -104,6 +109,7 @@ WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00'
,SUM(A.OfficialAccount) AS OfficialAccount,SUM(A.TeacherRecommend) AS TeacherRecommend,SUM(A.ByteDance) AS ByteDance,SUM(A.ThirdPartyPlatform) AS ThirdPartyPlatform
,SUM(A.Other) AS Other,SUM(A.ClassACount) AS ClassACount,SUM(A.ClassBCount) AS ClassBCount,SUM(A.ClassCCount) AS ClassCCount,SUM(A.ClassDCount) AS ClassDCount
,SUM(A.InvalidCount) AS InvalidCount,SUM(A.ContractCount) AS ContractCount,SUM(A.OrderMoney) AS OrderMoney,SUM(A.StudyOrderMoney) AS StudyOrderMoney
,SUM(A.OrderNotMoney) AS OrderNotMoney,SUM(A.StudyOrderNotMoney) AS StudyOrderNotMoney
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Student_Static_Extend.Times),query.Times);
}
if(query.IsQueryNotMoney==1)
{
builder.AppendFormat(" AND (A.{0}<>0 OR A.{1}<>0) ",nameof(RB_Student_Static_Extend.OrderNotMoney),nameof(RB_Student_Static_Extend.StudyOrderNotMoney));
}
}
builder.AppendFormat(" ORDER BY A.{0} ASC ",nameof(RB_Student_Static_Extend.Id));
@@ -67,7 +71,7 @@ SELECT CONCAT(DATE_FORMAT(A.Date, '%Y-%m'),'-01') AS Date,A.YearStr,A.MonthStr,S
,SUM(A.ClassCCount) AS ClassCCount,SUM(A.ClassDCount) AS ClassDCount,SUM(A.CustomerCount) AS CustomerCount,SUM(A.B2CCount) AS B2CCount,SUM(A.TransCount) AS TransCount
,SUM(A.InnerCount) AS InnerCount,SUM(A.InvalidCount) AS InvalidCount,SUM(A.SuspectedCount) AS SuspectedCount,SUM(A.IntentionCount) AS IntentionCount
,SUM(A.InvitationCount) AS InvitationCount,SUM(A.NegotiationCount) AS NegotiationCount,SUM(A.ContractCount) AS ContractCount,SUM(A.OrderMoney) AS OrderMoney
,SUM(A.StudyOrderMoney) AS StudyOrderMoney
,SUM(A.StudyOrderMoney) AS StudyOrderMoney,SUM(A.OrderNotMoney) AS OrderNotMoney,SUM(A.StudyOrderNotMoney) AS StudyOrderNotMoney
FROM RB_Student_Static AS A
WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00'
");
...
...
@@ -110,7 +114,7 @@ SELECT CONCAT(A.YearStr,'-01','-01') AS Date,A.YearStr,SUM(A.PushCount) AS PushC
,SUM(A.ClassCCount) AS ClassCCount,SUM(A.ClassDCount) AS ClassDCount,SUM(A.CustomerCount) AS CustomerCount,SUM(A.B2CCount) AS B2CCount,SUM(A.TransCount) AS TransCount
,SUM(A.InnerCount) AS InnerCount,SUM(A.InvalidCount) AS InvalidCount,SUM(A.SuspectedCount) AS SuspectedCount,SUM(A.IntentionCount) AS IntentionCount
,SUM(A.InvitationCount) AS InvitationCount,SUM(A.NegotiationCount) AS NegotiationCount,SUM(A.ContractCount) AS ContractCount,SUM(A.OrderMoney) AS OrderMoney
,SUM(A.StudyOrderMoney) AS StudyOrderMoney
,SUM(A.StudyOrderMoney) AS StudyOrderMoney,SUM(A.OrderNotMoney) AS OrderNotMoney,SUM(A.StudyOrderNotMoney) AS StudyOrderNotMoney