Commit 9b06c4be authored by 黄奎's avatar 黄奎

111

parent 65854b0e
...@@ -1186,7 +1186,7 @@ namespace Edu.Module.Course ...@@ -1186,7 +1186,7 @@ namespace Edu.Module.Course
{ {
//获取课程信息 //获取课程信息
var courseModel = courseRepository.GetEntity(courseId); var courseModel = courseRepository.GetEntity(courseId);
if (courseModel.CourseTimeId <= 0) { return ""; } if (courseModel==null || (courseModel!=null && courseModel.CourseTimeId <= 0)) { return ""; }
//查询课程使用的上课时段 //查询课程使用的上课时段
var ctModel = scroll_CourseTimeRepository.GetEntity<RB_Scroll_CourseTime_ViewModel>(courseModel.CourseTimeId); var ctModel = scroll_CourseTimeRepository.GetEntity<RB_Scroll_CourseTime_ViewModel>(courseModel.CourseTimeId);
if (!string.IsNullOrEmpty(ctModel.Content)) if (!string.IsNullOrEmpty(ctModel.Content))
......
...@@ -801,6 +801,7 @@ WHERE {where}"; ...@@ -801,6 +801,7 @@ WHERE {where}";
/// <returns></returns> /// <returns></returns>
public List<RB_Order_Guest_Extend> GetAllStudentPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Order_Guest_Extend demodel) public List<RB_Order_Guest_Extend> GetAllStudentPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Order_Guest_Extend demodel)
{ {
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT a.*,contract.ContractNo,contract.Id as ContractId,b.CourseId,IFNULL(C.CourseName,'') AS CourseName,C.CourseRate,class.ClassName,class.ClassNo SELECT a.*,contract.ContractNo,contract.Id as ContractId,b.CourseId,IFNULL(C.CourseName,'') AS CourseName,C.CourseRate,class.ClassName,class.ClassNo
...@@ -841,7 +842,8 @@ WHERE 1=1 AND A.Status=0 AND class.Status=0 AND class.ClassStatus <>4 AND b.Or ...@@ -841,7 +842,8 @@ WHERE 1=1 AND A.Status=0 AND class.Status=0 AND class.ClassStatus <>4 AND b.Or
if (!string.IsNullOrEmpty(demodel.GuestName)) if (!string.IsNullOrEmpty(demodel.GuestName))
{ {
builder.AppendFormat($@" AND A.{nameof(RB_Order_Guest_Extend.GuestName)} like '%{demodel.GuestName}%'"); builder.AppendFormat($@" AND A.{nameof(RB_Order_Guest_Extend.GuestName)} like @GuestName ");
parameters.Add("GuestName", "%" + demodel.GuestName.Trim() + "%");
} }
if (demodel.GuestState > 0) if (demodel.GuestState > 0)
{ {
...@@ -849,7 +851,8 @@ WHERE 1=1 AND A.Status=0 AND class.Status=0 AND class.ClassStatus <>4 AND b.Or ...@@ -849,7 +851,8 @@ WHERE 1=1 AND A.Status=0 AND class.Status=0 AND class.ClassStatus <>4 AND b.Or
} }
if (!string.IsNullOrEmpty(demodel.ClassNo)) if (!string.IsNullOrEmpty(demodel.ClassNo))
{ {
builder.AppendFormat($@" AND class.{nameof(RB_Order_Guest_Extend.ClassNo)} like '%{demodel.ClassNo}%'"); builder.AppendFormat($@" AND class.{nameof(RB_Order_Guest_Extend.ClassNo)} like @ClassNo ");
parameters.Add("ClassNo", "%" + demodel.ClassNo.Trim() + "%");
} }
if (demodel.OrderId > 0) if (demodel.OrderId > 0)
{ {
...@@ -922,7 +925,7 @@ WHERE 1=1 AND A.Status=0 AND class.Status=0 AND class.ClassStatus <>4 AND b.Or ...@@ -922,7 +925,7 @@ WHERE 1=1 AND A.Status=0 AND class.Status=0 AND class.ClassStatus <>4 AND b.Or
} }
} }
builder.AppendFormat($@" order by A.{nameof(RB_Order_Guest_Extend.Id)} desc"); builder.AppendFormat($@" order by A.{nameof(RB_Order_Guest_Extend.Id)} desc");
var list= GetPage<RB_Order_Guest_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList(); var list= GetPage<RB_Order_Guest_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
if (list.Any()) if (list.Any())
{ {
//课程顾问 协助老师 负责人; 客户来源 来源关联人 //课程顾问 协助老师 负责人; 客户来源 来源关联人
...@@ -1054,6 +1057,7 @@ WHERE 1=1 AND A.Status=0 AND class.Status=0 AND class.ClassStatus <>4 AND b.Or ...@@ -1054,6 +1057,7 @@ WHERE 1=1 AND A.Status=0 AND class.Status=0 AND class.ClassStatus <>4 AND b.Or
/// <returns></returns> /// <returns></returns>
public List<RB_Order_Guest_Extend> GetAllStudentStaticRepository(RB_Order_Guest_Extend demodel) public List<RB_Order_Guest_Extend> GetAllStudentStaticRepository(RB_Order_Guest_Extend demodel)
{ {
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT a.GuestState,COUNT(1) AS StudentNum SELECT a.GuestState,COUNT(1) AS StudentNum
...@@ -1092,7 +1096,8 @@ WHERE 1=1 AND A.Status=0 AND class.Status=0 AND class.ClassStatus <>4 AND b.Or ...@@ -1092,7 +1096,8 @@ WHERE 1=1 AND A.Status=0 AND class.Status=0 AND class.ClassStatus <>4 AND b.Or
if (!string.IsNullOrEmpty(demodel.GuestName)) if (!string.IsNullOrEmpty(demodel.GuestName))
{ {
builder.AppendFormat($@" AND A.{nameof(RB_Order_Guest_Extend.GuestName)} like '%{demodel.GuestName}%'"); builder.AppendFormat($@" AND A.{nameof(RB_Order_Guest_Extend.GuestName)} like @GuestName ");
parameters.Add("GuestName", "%" + demodel.GuestName.Trim() + "%");
} }
if (demodel.GuestState > 0) if (demodel.GuestState > 0)
{ {
...@@ -1100,7 +1105,8 @@ WHERE 1=1 AND A.Status=0 AND class.Status=0 AND class.ClassStatus <>4 AND b.Or ...@@ -1100,7 +1105,8 @@ WHERE 1=1 AND A.Status=0 AND class.Status=0 AND class.ClassStatus <>4 AND b.Or
} }
if (!string.IsNullOrEmpty(demodel.ClassNo)) if (!string.IsNullOrEmpty(demodel.ClassNo))
{ {
builder.AppendFormat($@" AND class.{nameof(RB_Order_Guest_Extend.ClassNo)} like '%{demodel.ClassNo}%'"); builder.AppendFormat($@" AND class.{nameof(RB_Order_Guest_Extend.ClassNo)} like @ClassNo ");
parameters.Add("ClassNo", "%" + demodel.ClassNo.Trim() + "%");
} }
if (demodel.OrderId > 0) if (demodel.OrderId > 0)
{ {
...@@ -1165,7 +1171,7 @@ WHERE 1=1 AND A.Status=0 AND class.Status=0 AND class.ClassStatus <>4 AND b.Or ...@@ -1165,7 +1171,7 @@ WHERE 1=1 AND A.Status=0 AND class.Status=0 AND class.ClassStatus <>4 AND b.Or
builder.AppendFormat($@" AND st.StuSourceId ={demodel.StuSourceId}"); builder.AppendFormat($@" AND st.StuSourceId ={demodel.StuSourceId}");
} }
builder.AppendFormat($@" GROUP BY A.GuestState "); builder.AppendFormat($@" GROUP BY A.GuestState ");
return Get<RB_Order_Guest_Extend>(builder.ToString()).ToList(); return Get<RB_Order_Guest_Extend>(builder.ToString(),parameters).ToList();
} }
#endregion #endregion
......
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