where+=$@" and o.{nameof(RB_Order_ViewModel.OrderType)} ={(int)OrderTypeEnum.StudyabroadOrder} ";
if(demodel.Group_Id>0)
{
where+=$@" and o.{nameof(RB_Order_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if(demodel.School_Id>0)
{
where+=$@" and o.{nameof(RB_Order_ViewModel.School_Id)} ={demodel.School_Id}";
}
if(demodel.OrderId>0)
{
where+=$@" and o.{nameof(RB_Order_ViewModel.OrderId)} ={demodel.OrderId}";
}
if(demodel.ClassId>0)
{
where+=$@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}";
}
if(demodel.OrderState>0)
{
where+=$@" and o.{nameof(RB_Order_ViewModel.OrderState)} ={(int)demodel.OrderState}";
}
if(demodel.OrderSource>0)
{
where+=$@" and o.{nameof(RB_Order_ViewModel.OrderSource)} ={(int)demodel.OrderSource}";
}
if(demodel.OrderForm>0)
{
where+=$@" and o.{nameof(RB_Order_ViewModel.OrderForm)} ={(int)demodel.OrderForm}";
}
if(demodel.EnterID>0)
{
where+=$@" and o.{nameof(RB_Order_ViewModel.EnterID)} ={demodel.EnterID}";
}
if(demodel.Dept_Id>0)
{
where+=$@" and o.{nameof(RB_Order_ViewModel.Dept_Id)} ={demodel.Dept_Id}";
}
if(demodel.Q_OrderState>0)
{
if(demodel.Q_OrderState==1)
{
where+=$@" and o.{nameof(RB_Order_ViewModel.OrderState)} in(1,2)";
}
elseif(demodel.Q_OrderState==2)
{
where+=$@" and o.{nameof(RB_Order_ViewModel.OrderState)} =3";
}
}
if(!string.IsNullOrEmpty(demodel.GuestName))
{
if(demodel.Group_Id>0)
{
where+=$@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and Group_Id ={demodel.Group_Id} and GuestName like '%{demodel.GuestName}%')";
}
else
{
where+=$@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and GuestName like '%{demodel.GuestName}%')";
}
}
if(!string.IsNullOrEmpty(demodel.StartTime))
{
where+=$@" and o.{nameof(RB_Order_ViewModel.CreateTime)} >='{demodel.StartTime}'";
}
if(!string.IsNullOrEmpty(demodel.EndTime))
{
where+=$@" and o.{nameof(RB_Order_ViewModel.CreateTime)} <='{demodel.EndTime} 23:59:59'";
where+=$@" and o.{nameof(RB_Order_ViewModel.OrderType)} ={(int)OrderTypeEnum.StudyabroadOrder} ";
if(demodel.Group_Id>0)
{
where+=$@" and o.{nameof(RB_Order_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if(demodel.School_Id>0)
{
where+=$@" and o.{nameof(RB_Order_ViewModel.School_Id)} ={demodel.School_Id}";
}
if(demodel.OrderId>0)
{
where+=$@" and o.{nameof(RB_Order_ViewModel.OrderId)} ={demodel.OrderId}";
}
if(demodel.ClassId>0)
{
where+=$@" and o.{nameof(RB_Order_ViewModel.ClassId)} ={demodel.ClassId}";
}
if(demodel.OrderSource>0)
{
where+=$@" and o.{nameof(RB_Order_ViewModel.OrderSource)} ={(int)demodel.OrderSource}";
}
if(demodel.OrderForm>0)
{
where+=$@" and o.{nameof(RB_Order_ViewModel.OrderForm)} ={(int)demodel.OrderForm}";
}
if(demodel.EnterID>0)
{
where+=$@" and o.{nameof(RB_Order_ViewModel.EnterID)} ={demodel.EnterID}";
}
if(demodel.Dept_Id>0)
{
where+=$@" and o.{nameof(RB_Order_ViewModel.Dept_Id)} ={demodel.Dept_Id}";
}
if(!string.IsNullOrEmpty(demodel.GuestName))
{
if(demodel.Group_Id>0)
{
where+=$@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and Group_Id ={demodel.Group_Id} and GuestName like '%{demodel.GuestName}%')";
}
else
{
where+=$@" and o.OrderId in (select OrderId from rb_order_guest where Status =0 and GuestName like '%{demodel.GuestName}%')";
}
}
if(!string.IsNullOrEmpty(demodel.StartTime))
{
where+=$@" and o.{nameof(RB_Order_ViewModel.CreateTime)} >='{demodel.StartTime}'";
}
if(!string.IsNullOrEmpty(demodel.EndTime))
{
where+=$@" and o.{nameof(RB_Order_ViewModel.CreateTime)} <='{demodel.EndTime} 23:59:59'";