builder.AppendFormat(" AND (A.{0}<>0 OR A.{1}<>0) ",nameof(RB_Student_Company_Extend.OrderNotMoney),nameof(RB_Student_Company_Extend.StudyOrderNotMoney));
}
if(!string.IsNullOrEmpty(query.QIds))
{
builder.AppendFormat(" AND A.{0} IN({1}) ",nameof(RB_Student_Company_Extend.Id),query.QIds);
}
}
builder.AppendFormat(" ORDER BY A.{0} ASC ",nameof(RB_Student_Company_Extend.Id));
SELECT CONCAT(DATE_FORMAT(A.Date, '%Y-%m'),'-01') AS Date,A.YearStr,A.MonthStr,SUM(A.PushCount) AS PushCount,SUM(A.NewCount) AS NewCount,MAX(A.CommunicationCount) AS CommunicationCount
SELECT MAX(Id) AS Id,CONCAT(DATE_FORMAT(A.Date, '%Y-%m'),'-01') AS Date,A.YearStr,A.MonthStr,SUM(A.PushCount) AS PushCount,SUM(A.NewCount) AS NewCount,MAX(A.CommunicationCount) AS CommunicationCount
,SUM(A.TrialLessonCount) AS TrialLessonCount,MAX(A.NotContacted) AS NotContacted,SUM(A.JPCount) AS JPCount,SUM(A.KRCount) AS KRCount,SUM(A.FRCount) AS FRCount
,SUM(A.JPStudyCount) AS JPStudyCount,SUM(A.KRStudyCount) AS KRStudyCount,SUM(A.YGAStudyCount) AS YGAStudyCount,SUM(A.USStudyCount) AS USStudyCount
,SUM(A.SGStudyCount) AS SGStudyCount,SUM(A.AXStudyCount) AS AXStudyCount,SUM(A.OtherCount) AS OtherCount,SUM(A.ClassACount) AS ClassACount,SUM(A.ClassBCount) AS ClassBCount
...
...
@@ -106,7 +110,7 @@ WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00'
{
StringBuilderbuilder=newStringBuilder();
builder.AppendFormat(@"
SELECT CONCAT(A.YearStr,'-01','-01') AS Date,A.YearStr,SUM(A.PushCount) AS PushCount,SUM(A.NewCount) AS NewCount,MAX(A.CommunicationCount) AS CommunicationCount
SELECT MAX(Id) AS Id,CONCAT(A.YearStr,'-01','-01') AS Date,A.YearStr,SUM(A.PushCount) AS PushCount,SUM(A.NewCount) AS NewCount,MAX(A.CommunicationCount) AS CommunicationCount
,SUM(A.TrialLessonCount) AS TrialLessonCount,MAX(A.NotContacted) AS NotContacted,SUM(A.JPCount) AS JPCount,SUM(A.KRCount) AS KRCount,SUM(A.FRCount) AS FRCount
,SUM(A.JPStudyCount) AS JPStudyCount,SUM(A.KRStudyCount) AS KRStudyCount,SUM(A.YGAStudyCount) AS YGAStudyCount,SUM(A.USStudyCount) AS USStudyCount
,SUM(A.SGStudyCount) AS SGStudyCount,SUM(A.AXStudyCount) AS AXStudyCount,SUM(A.OtherCount) AS OtherCount,SUM(A.ClassACount) AS ClassACount,SUM(A.ClassBCount) AS ClassBCount
builder.AppendFormat(" AND (A.{0}<>0 OR A.{1}<>0) ",nameof(RB_Student_Static_Extend.OrderNotMoney),nameof(RB_Student_Static_Extend.StudyOrderNotMoney));
}
if(!string.IsNullOrWhiteSpace(query.QIds))
{
builder.AppendFormat(" AND A.{0} IN({1}) ",nameof(RB_Student_Static_Extend.Id),query.QIds);
}
}
builder.AppendFormat(" ORDER BY A.{0} ASC ",nameof(RB_Student_Static_Extend.Id));
SELECT CONCAT(DATE_FORMAT(A.Date, '%Y-%m'),'-01') AS Date,A.YearStr,A.MonthStr,SUM(A.PushCount) AS PushCount,SUM(A.NewCount) AS NewCount,SUM(A.CommunicationCount) AS CommunicationCount
SELECT MAX(Id) AS Id,CONCAT(DATE_FORMAT(A.Date, '%Y-%m'),'-01') AS Date,A.YearStr,A.MonthStr,SUM(A.PushCount) AS PushCount,SUM(A.NewCount) AS NewCount,SUM(A.CommunicationCount) AS CommunicationCount
,SUM(A.TrialLessonCount) AS TrialLessonCount,SUM(A.NotContacted) AS NotContacted,SUM(A.JPCount) AS JPCount,SUM(A.KRCount) AS KRCount,SUM(A.FRCount) AS FRCount
,SUM(A.JPStudyCount) AS JPStudyCount,SUM(A.KRStudyCount) AS KRStudyCount,SUM(A.YGAStudyCount) AS YGAStudyCount,SUM(A.USStudyCount) AS USStudyCount
,SUM(A.SGStudyCount) AS SGStudyCount,SUM(A.AXStudyCount) AS AXStudyCount,SUM(A.OtherCount) AS OtherCount,SUM(A.ClassACount) AS ClassACount,SUM(A.ClassBCount) AS ClassBCount
...
...
@@ -107,7 +111,7 @@ WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00'
{
StringBuilderbuilder=newStringBuilder();
builder.AppendFormat(@"
SELECT CONCAT(A.YearStr,'-01','-01') AS Date,A.YearStr,SUM(A.PushCount) AS PushCount,SUM(A.NewCount) AS NewCount,SUM(A.CommunicationCount) AS CommunicationCount
SELECT MAX(Id) AS Id,CONCAT(A.YearStr,'-01','-01') AS Date,A.YearStr,SUM(A.PushCount) AS PushCount,SUM(A.NewCount) AS NewCount,SUM(A.CommunicationCount) AS CommunicationCount
,SUM(A.TrialLessonCount) AS TrialLessonCount,SUM(A.NotContacted) AS NotContacted,SUM(A.JPCount) AS JPCount,SUM(A.KRCount) AS KRCount,SUM(A.FRCount) AS FRCount
,SUM(A.JPStudyCount) AS JPStudyCount,SUM(A.KRStudyCount) AS KRStudyCount,SUM(A.YGAStudyCount) AS YGAStudyCount,SUM(A.USStudyCount) AS USStudyCount
,SUM(A.SGStudyCount) AS SGStudyCount,SUM(A.AXStudyCount) AS AXStudyCount,SUM(A.OtherCount) AS OtherCount,SUM(A.ClassACount) AS ClassACount,SUM(A.ClassBCount) AS ClassBCount