builder.AppendFormat(@" SELECT A.*,b.TeacherName,b.TeacherHead as TeacherIcon FROM RB_Class_FeedBack AS A LEFT JOIN rb_teacher as b on a.CreateBy=b.TId WHERE 1=1 ");
if(query!=null)
{
if(query.Group_Id>0)
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Class_FeedBack_ViewModel.Group_Id),query.Group_Id);
}
if(query.ClassId>0)
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Class_FeedBack_ViewModel.ClassId),query.ClassId);
}
if(query.FeedBackId>0)
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Class_FeedBack_ViewModel.FeedBackId),query.FeedBackId);
}
if(query.OrderGuestId>0)
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Class_FeedBack_ViewModel.OrderGuestId),query.OrderGuestId);
}
if(!string.IsNullOrEmpty(query.Q_ClassIds))
{
builder.AppendFormat(" AND A.{0} in({1}) ",nameof(RB_Class_FeedBack_ViewModel.ClassId),query.Q_ClassIds);
}
if(!string.IsNullOrEmpty(query.Q_ClassTimeIds))
{
builder.AppendFormat(" AND A.{0} in({1}) ",nameof(RB_Class_FeedBack_ViewModel.ClassTimeId),query.Q_ClassTimeIds);
}
if(query.ClassTimeId>0)
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Class_FeedBack_ViewModel.ClassTimeId),query.ClassTimeId);
}
if(query.ClassPlanId>0)
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Class_FeedBack_ViewModel.ClassPlanId),query.ClassPlanId);
builder.AppendFormat(@" SELECT A.*,b.TeacherName,b.TeacherHead as TeacherIcon FROM RB_Class_FeedBack AS A LEFT JOIN rb_teacher as b on a.TeacherId=b.TId
LEFT JOIN rb_student_orderguest as sog on sog.GuestId=a.OrderGuestId
LEFT JOIN rb_student as s on s.StuId = sog.Student_Id where 1=1 and a.`Status`=0 and sog.`Status`=0 and s.`Status`=0");
if(query!=null)
{
if(query.Group_Id>0)
{
builder.AppendFormat(" AND a.{0}={1} ",nameof(RB_Class_FeedBack_ViewModel.Group_Id),query.Group_Id);
}
if(query.ClassTimeId>0)
{
builder.AppendFormat(" AND a.{0}={1} ",nameof(RB_Class_FeedBack_ViewModel.ClassTimeId),query.ClassTimeId);
}
if(query.ClassId>0)
{
builder.AppendFormat(" AND a.{0}={1} ",nameof(RB_Class_FeedBack_ViewModel.ClassId),query.ClassId);
}
if(query.OrderGuestId>0)
{
builder.AppendFormat(" AND a.{0}={1} ",nameof(RB_Class_FeedBack_ViewModel.OrderGuestId),query.OrderGuestId);
}
if(query.StuId>0)
{
builder.AppendFormat(" AND s.{0}={1} ",nameof(RB_Class_FeedBack_ViewModel.StuId),query.StuId);
}
}
builder.AppendFormat(" ORDER BY a.CreateTime desc ");
SELECT sog.Student_Id as StudentId,A.*,cs.ClassName,cs.ClassNo,IFNULL(B.JoinType,0) AS JoinType,IFNULL(B.TargetJoinType,0) AS TargetJoinType,IFNULL(B.StartClassHours,0) AS StartClassHours
SELECT sog.Student_Id as StudentId,A.*,cs.ClassName,cs.Teacher_Id,cs.ClassNo,IFNULL(B.JoinType,0) AS JoinType,IFNULL(B.TargetJoinType,0) AS TargetJoinType,IFNULL(B.StartClassHours,0) AS StartClassHours
,IFNULL(C.CourseName,'') AS CourseName,B.EffectStatus,B.EffectTime,B.UpOrderId,B.OrderType,B.CourseId,B.IsRenewOrder,B.RenewOrderId,B.EnterID
,sc.StopClassEffectTime,B.SourceOrderId,B.TargetOrderId,IFNULL(D.FirstClassHours,0)+IFNULL(D.SecondClassHours,0)+IFNULL(D.ThirdClassHours,0) AS ContractTotalHours
FROM RB_Order_Guest AS A LEFT JOIN rb_order AS B ON A.OrderId=B.OrderId