FROM RB_Student_Appointment AS A INNER JOIN rb_student AS B ON A.StuId=B.StuId
WHERE 1=1
WHERE 1=1
");
");
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Student_Appointment_Extend.Status),(int)DateStateEnum.Normal);
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Student_Appointment_Extend.Status),(int)DateStateEnum.Normal);
...
@@ -44,7 +44,15 @@ WHERE 1=1
...
@@ -44,7 +44,15 @@ WHERE 1=1
{
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Student_Appointment_Extend.Id),query.Id);
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Student_Appointment_Extend.Id),query.Id);
}
}
if(query.CreateBy>0)
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Student_Appointment_Extend.CreateBy),query.CreateBy);
}
//指定日期的约访统计
if(!string.IsNullOrEmpty(query.QueryDate))
{
builder.AppendFormat(" AND ( DATE_FORMAT(A.{0},'%y/%m/%d')= DATE_FORMAT('{2}','%y/%m/%d') OR DATE_FORMAT(A.{1},'%y/%m/%d')= DATE_FORMAT('{2}','%y/%m/%d')) ",nameof(RB_Student_Appointment_Extend.CreateTime),nameof(RB_Student_Appointment_Extend.AppointmentTime),Common.ConvertHelper.FormatDate(query.QueryDate));
}
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ",nameof(RB_Student_Appointment_Extend.Id));
builder.AppendFormat(" ORDER BY A.{0} DESC ",nameof(RB_Student_Appointment_Extend.Id));