builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Class_Plan_ViewModel.Group_Id),query.Group_Id);
}
if(query.TeacherId>0)
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Class_Plan_ViewModel.TeacherId),query.TeacherId);
}
if(query.School_Id>0)
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Class_Plan_ViewModel.School_Id),query.School_Id);
...
...
@@ -124,6 +128,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}<='{1} 23:59:59' ",nameof(RB_Class_Plan_ViewModel.ClassDate),query.EndTime);
}
if(!string.IsNullOrEmpty(query.QClassDateStr))
{
builder.AppendFormat(" AND DATE_FORMAT(A.{0},'%y/%m/%d')= DATE_FORMAT('{1}','%y/%m/%d') ",nameof(RB_Class_Plan_ViewModel.ClassDate),query.QClassDateStr);
SELECT A.*,IFNULL(B.`Name`,'') AS VisitorName,C.ClassDate,C.ClassTime,C.ClassContent,IFNULL(D.TeacherName,'') AS TeacherName,IFNULL(E.RoomName,'') AS RoomName
FROM RB_Visitor_Reserve AS A LEFT JOIN rb_visitor AS B ON A.Visitor_Id=B.Id
LEFT JOIN rb_reserve_class AS C ON A.ReserveClassId=C.ReserveClassId
LEFT JOIN rb_teacher AS D ON C.TeacherId=D.TId
LEFT JOIN rb_class_room AS E ON C.ClassRoomId=E.RoomId
WHERE 1=1
");
");if(query!=null)
{
if(query.Group_Id>0)
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Visitor_Reserve_Extend.Group_Id),query.Group_Id);
}
if(!string.IsNullOrEmpty(query.StartClassDate))
{
builder.AppendFormat(" AND C.{0}>='{1}' ",nameof(RB_Visitor_Reserve_Extend.ClassDate),query.StartClassDate);
}
if(!string.IsNullOrEmpty(query.EndClassDate))
{
builder.AppendFormat(" AND C.{0}<='{1} 23:59:59' ",nameof(RB_Visitor_Reserve_Extend.ClassDate),query.EndClassDate);
}
if(query.TeacherId>0)
{
builder.AppendFormat(" AND C.{0}={1} ",nameof(RB_Visitor_Reserve_Extend.TeacherId),query.TeacherId);
}
if(query.ClassRoomId>0)
{
builder.AppendFormat(" AND C.{0}={1} ",nameof(RB_Visitor_Reserve_Extend.ClassRoomId),query.ClassRoomId);