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.QQ,'') AS QQ,IFNULL(B.WeChatNo,'') AS WeChatNo,C.ReserveType,C.ClassPlanId
,IFNULL(G.OrderCount,0) AS OrderCount,c.ClassRoomId,C.TeacherId,c.TrialLessonId
,IFNULL(G.OrderCount,0) AS OrderCount,c.ClassRoomId,C.TeacherId,c.TrialLessonId,st.StuName
FROM RB_Visitor_Reserve AS A LEFT JOIN rb_student AS B ON A.Visitor_Id=B.StuId
LEFT JOIN
(
...
...
@@ -43,6 +43,7 @@ FROM RB_Visitor_Reserve AS A LEFT JOIN rb_student AS B ON A.Visitor_Id=B.StuId
LEFT JOIN rb_teacher AS D ON C.TeacherId=D.TId
LEFT JOIN rb_class_room AS E ON C.ClassRoomId=E.RoomId
LEFT JOIN rb_triallesson AS F ON C.TrialLessonId=F.Id
LEFT JOIN rb_student as st on st.StuId=a.Visitor_Id
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Visitor_Reserve_Extend.Status),(int)DateStateEnum.Normal);
...
...
@@ -52,6 +53,19 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Visitor_Reserve_Extend.Group_Id),query.Group_Id);
}
if(query.IsQNotReserveClassId==1)
{
if(!string.IsNullOrEmpty(query.StartClassDate))
{
builder.AppendFormat(" AND A.{0}>='{1}' ",nameof(RB_Visitor_Reserve_Extend.ReservationDate),query.StartClassDate);
}
if(!string.IsNullOrEmpty(query.EndClassDate))
{
builder.AppendFormat(" AND A.{0}<='{1} 23:59:59' ",nameof(RB_Visitor_Reserve_Extend.ReservationDate),query.EndClassDate);
}
}
else
{
if(!string.IsNullOrEmpty(query.StartClassDate))
{
builder.AppendFormat(" AND C.{0}>='{1}' ",nameof(RB_Visitor_Reserve_Extend.ClassDate),query.StartClassDate);
...
...
@@ -60,6 +74,7 @@ WHERE 1=1
{
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);
...
...
@@ -99,6 +114,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Visitor_Reserve_Extend.ReserveClassId),query.ReserveClassId);
}
if(query.IsQNotReserveClassId==1)
{
builder.AppendFormat(" AND A.{0}=0 ",nameof(RB_Visitor_Reserve_Extend.ReserveClassId));
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ",nameof(RB_Visitor_Reserve_Extend.Id));