Commit ea33105e authored by 吴春's avatar 吴春

提交代码

parent 79809223
......@@ -73,45 +73,48 @@ namespace Edu.Repository.Course
/// <returns></returns>
public List<RB_Order_Guest_ViewModel> GetList_V2(RB_Order_Guest_ViewModel demodel)
{
string where = $@" 1=1 and Status=0";
string where = $@" ";
if (demodel.Group_Id > 0)
{
where += $@" and {nameof(RB_Order_Guest_ViewModel.Group_Id)} ={demodel.Group_Id}";
where += $@" and a.{nameof(RB_Order_Guest_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.School_Id > 0)
{
where += $@" and {nameof(RB_Order_Guest_ViewModel.School_Id)} ={demodel.School_Id}";
where += $@" and a.{nameof(RB_Order_Guest_ViewModel.School_Id)} ={demodel.School_Id}";
}
if (demodel.Id > 0)
{
where += $@" and {nameof(RB_Order_Guest_ViewModel.Id)} ={demodel.Id}";
where += $@" and a.{nameof(RB_Order_Guest_ViewModel.Id)} ={demodel.Id}";
}
if (demodel.OrderId > 0)
{
where += $@" and {nameof(RB_Order_Guest_ViewModel.OrderId)} ={demodel.OrderId}";
where += $@" and a.{nameof(RB_Order_Guest_ViewModel.OrderId)} ={demodel.OrderId}";
}
if (demodel.ClassId > 0)
{
where += $@" and {nameof(RB_Order_Guest_ViewModel.ClassId)} ={demodel.ClassId}";
where += $@" and a.{nameof(RB_Order_Guest_ViewModel.ClassId)} ={demodel.ClassId}";
}
if (!string.IsNullOrEmpty(demodel.OrderIds))
{
where += $@" and {nameof(RB_Order_Guest_ViewModel.OrderId)} in({demodel.OrderIds})";
where += $@" and a.{nameof(RB_Order_Guest_ViewModel.OrderId)} in({demodel.OrderIds})";
}
if (!string.IsNullOrEmpty(demodel.ClassIds))
{
where += $@" and {nameof(RB_Order_Guest_ViewModel.ClassId)} in({demodel.ClassIds})";
where += $@" and a.{nameof(RB_Order_Guest_ViewModel.ClassId)} in({demodel.ClassIds})";
}
if (!string.IsNullOrEmpty(demodel.GuestName))
{
where += $@" and {nameof(RB_Order_Guest_ViewModel.GuestName)} like '%{demodel.GuestName}%'";
where += $@" and a.{nameof(RB_Order_Guest_ViewModel.GuestName)} like '%{demodel.GuestName}%'";
}
if (demodel.GuestState > 0)
{
where += $@" and {nameof(RB_Order_Guest_ViewModel.GuestState)} ={demodel.GuestState}";
where += $@" and a.{nameof(RB_Order_Guest_ViewModel.GuestState)} ={demodel.GuestState}";
}
string sql = $@" select * from RB_Order_Guest where {where}";
string sql = $@" SELECT A.* ,IFNULL(course.CourseName,'') AS CourseName,tOrder.CourseId,tOrder.OrderType,tOrder.StartClassHours,tOrder.IsChaBan
FROM RB_Order_Guest AS A LEFT JOIN RB_Order as tOrder ON A.OrderId=tOrder.OrderId
LEFT JOIN rb_course AS course ON (tOrder.CourseId=course.CourseId AND tOrder.CourseId>0 AND tOrder.OrderType=1)
WHERE 1=1 AND A.Status=0 {where}";
return Get<RB_Order_Guest_ViewModel>(sql).ToList();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment