SELECT A.*,IFNULL(B.StuName,'') AS VisitorName,C.ClassDate,C.ClassTime,C.EndTime,C.ClassContent,IFNULL(D.TeacherName,'') AS TeacherName,IFNULL(E.RoomName,'') AS RoomName
,IFNULL(B.StuTel,'') AS StuTel,IFNULL(F.LessonName,'') AS LessonName
,IFNULL(B.StuTel,'') AS StuTel,IFNULL(F.LessonName,'') AS LessonName,C.TeacherId
FROM RB_Visitor_Reserve AS A LEFT JOIN rb_student AS B ON A.Visitor_Id=B.StuId
LEFT JOIN rb_reserve_class AS C ON A.ReserveClassId=C.ReserveClassId
LEFT JOIN rb_teacher AS D ON C.TeacherId=D.TId
...
...
@@ -154,6 +154,14 @@ WHERE 1=1
{
builder.AppendFormat(" AND C.{0}>='{1}' ",nameof(RB_Visitor_Reserve_Extend.ClassDate),query.StartClassDate);
}
if(query.Visitor_Id>0)
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Visitor_Reserve_Extend.Visitor_Id),query.Visitor_Id);
}
if(query.IsQNotReserveClassId==2)
{
builder.AppendFormat(" AND A.{0}>0 ",nameof(RB_Visitor_Reserve_Extend.ReserveClassId));
}
if(!string.IsNullOrEmpty(query.EndClassDate))
{
builder.AppendFormat(" AND C.{0}<='{1} 23:59:59' ",nameof(RB_Visitor_Reserve_Extend.ClassDate),query.EndClassDate);