builder.AppendFormat(" AND A.{0} in ({1}) ",nameof(RB_AI_AuthorizeStudent_ViewModel.ApplicationId),query.ApplicationIds);
}
if(!string.IsNullOrWhiteSpace(query.StudentIds))
{
builder.AppendFormat(" AND A.{0} in ({1}) ",nameof(RB_AI_AuthorizeStudent_ViewModel.StudentId),query.StudentIds);
}
if(query.IsEffective==1)
{
builder.AppendFormat(" AND (A.{0}=2 or (A.{0} =1 AND DATE_FORMAT('{1}','%y-%m-%d')>=DATE_FORMAT(A.{2},'%y-%m-%d') AND DATE_FORMAT('{1}','%y-%m-%d')<=DATE_FORMAT(A.{3},'%y-%m-%d')) ) ",nameof(RB_AI_AuthorizeStudent_ViewModel.DateType),StringHelper.FormatDate(DateTime.Now),nameof(RB_AI_AuthorizeStudent_ViewModel.StartDate),nameof(RB_AI_AuthorizeStudent_ViewModel.EndDate));
builder.AppendFormat(" AND (A.{0}=2 or (A.{0} =1 AND DATE_FORMAT('{1}','%y-%m-%d')>=DATE_FORMAT(A.{2},'%y-%m-%d') AND DATE_FORMAT('{1}','%y-%m-%d')<=DATE_FORMAT(A.{3},'%y-%m-%d')) ) ",nameof(RB_AI_AuthorizeStudent_ViewModel.DateType),StringHelper.FormatDate(DateTime.Now),nameof(RB_AI_AuthorizeStudent_ViewModel.StartDate),nameof(RB_AI_AuthorizeStudent_ViewModel.EndDate));
}
//if (!string.IsNullOrEmpty(query.StartTime))
...
...
@@ -72,6 +77,7 @@ namespace Edu.Repository.AI
// where.AppendFormat(" AND DATE_FORMAT(A.{0},'%y-%m-%d')<=DATE_FORMAT('{1}','%y-%m-%d') ", nameof(RB_Class_Plan_ViewModel.ClassDate), query.EndTime);
//}
}
builder.AppendFormat(" order by A.{0} desc",nameof(RB_AI_AuthorizeStudent_ViewModel.CreateTime));