builder.AppendFormat(@" SELECT A.* FROM RB_Class_Check AS A WHERE 1=1 ");
if(query!=null)
{
if(query.Group_Id>0)
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Class_Check_ViewModel.Group_Id),query.Group_Id);
}
if(query.School_Id>0)
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Class_Check_ViewModel.School_Id),query.School_Id);
}
if(query.ClassId>0)
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Class_Check_ViewModel.ClassId),query.ClassId);
}
if(!string.IsNullOrWhiteSpace(query.StartDate))
{
builder.AppendFormat(" AND DATE_FORMAT(A.{0},'%Y-%m-%d')>=DATE_FORMAT('{1}','%Y-%m-%d') ",nameof(RB_Class_Check_ViewModel.CreateTime),query.StartDate);
}
if(!string.IsNullOrWhiteSpace(query.EndDate))
{
builder.AppendFormat(" AND DATE_FORMAT(A.{0},'%Y-%m-%d')>=DATE_FORMAT('{1}','%Y-%m-%d') ",nameof(RB_Class_Check_ViewModel.CreateTime),query.EndDate);