SELECT CONCAT(DATE_FORMAT(A.Date, '%Y-%m'),'-01') AS Date,SUM(A.PushCount) AS PushCount,SUM(A.NewCount) AS NewCount,SUM(A.CommunicationCount) AS CommunicationCount
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
,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
...
...
@@ -79,11 +79,18 @@ WHERE 1=1 AND A.Date<>'0001-01-01 00:00:00'
}
if(query.YearStr>0)
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Student_Static_Extend.YearStr),query.YearStr);
if(isYear)
{
builder.AppendFormat(" AND A.{0}<={1} ",nameof(RB_Student_Static_Extend.YearStr),query.YearStr);
}
else
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Student_Static_Extend.YearStr),query.YearStr);
}
}
}
builder.AppendFormat(" GROUP BY DATE_FORMAT(A.Date, '%Y-%m') ");
builder.AppendFormat(" ORDER BY DATE_FORMAT(A.Date, '%Y-%m') ASC ",nameof(RB_Student_Static_Extend.Id));
builder.AppendFormat(" ORDER BY DATE_FORMAT(A.Date, '%Y-%m') ASC ");