Commit cf2cd446 authored by 黄奎's avatar 黄奎

页面修改

parent 53b6f38c
...@@ -29,8 +29,8 @@ namespace Edu.Repository.Question ...@@ -29,8 +29,8 @@ namespace Edu.Repository.Question
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT A.*,IFNULL(B.QuestionCount,0) AS QuestionCount SELECT A.*,IFNULL(B.QuestionCount,0) AS QuestionCount
FROM RB_Question_Bank AS A LEFT JOIN( SELECT BankId,COUNT(1) AS QuestionCount FROM rb_question WHERE `Status`=0 GROUP BY BankId) AS B ON A.BankId=B.BankId FROM RB_Question_Bank AS A LEFT JOIN (SELECT BankId,COUNT(1) AS QuestionCount FROM rb_question WHERE `Status`=0 GROUP BY BankId) AS B ON A.BankId=B.BankId
WHERE 1=1"); WHERE 1=1 ");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Question_Bank_ViewModel.Status), (int)DateStateEnum.Normal); builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Question_Bank_ViewModel.Status), (int)DateStateEnum.Normal);
if (query == null) if (query == null)
{ {
...@@ -47,7 +47,7 @@ WHERE 1=1"); ...@@ -47,7 +47,7 @@ WHERE 1=1");
builder.AppendFormat(" AND A.{0} LIKE @BankName ", nameof(RB_Question_Bank_ViewModel.BankName)); builder.AppendFormat(" AND A.{0} LIKE @BankName ", nameof(RB_Question_Bank_ViewModel.BankName));
parameters.Add("BankName", "%" + query.BankName.Trim() + "%"); parameters.Add("BankName", "%" + query.BankName.Trim() + "%");
} }
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Question_ViewModel.QuestionId)); builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Question_Bank_ViewModel.BankId));
return GetPage<RB_Question_Bank_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList(); return GetPage<RB_Question_Bank_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).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