Commit 9a71427a authored by 吴春's avatar 吴春

提交代码

parent 3c2eb35a
...@@ -4,6 +4,7 @@ using System.Linq; ...@@ -4,6 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using Mall.Model.Entity.TradePavilion; using Mall.Model.Entity.TradePavilion;
using Mall.Model.Extend.TradePavilion; using Mall.Model.Extend.TradePavilion;
using VT.FW.DB.Dapper;
namespace Mall.Repository.TradePavilion namespace Mall.Repository.TradePavilion
{ {
...@@ -25,6 +26,7 @@ namespace Mall.Repository.TradePavilion ...@@ -25,6 +26,7 @@ namespace Mall.Repository.TradePavilion
public List<RB_Prize_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Prize_Extend query) public List<RB_Prize_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Prize_Extend query)
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
DynamicParameters parameters = new DynamicParameters();
builder.Append($" SELECT a.*,(SELECT COUNT(*) from rb_brand where `Status`=0 and FIND_IN_SET(a.Id,SourceIds)) as TotalCount FROM rb_prize as a WHERE `Status`=0 "); builder.Append($" SELECT a.*,(SELECT COUNT(*) from rb_brand where `Status`=0 and FIND_IN_SET(a.Id,SourceIds)) as TotalCount FROM rb_prize as a WHERE `Status`=0 ");
if (query != null) if (query != null)
{ {
...@@ -37,9 +39,15 @@ namespace Mall.Repository.TradePavilion ...@@ -37,9 +39,15 @@ namespace Mall.Repository.TradePavilion
{ {
builder.Append($" AND a.{nameof(RB_Prize_Extend.MallBaseId)}={query.MallBaseId}"); builder.Append($" AND a.{nameof(RB_Prize_Extend.MallBaseId)}={query.MallBaseId}");
} }
if (!string.IsNullOrWhiteSpace(query.Name))
{
builder.AppendFormat(" AND a.{0} LIKE @Name ", nameof(RB_Prize_Extend.Name));
parameters.Add("Name", "%" + query.Name.Trim() + "%");
// builder.Append($" AND a.{nameof(RB_Prize_Extend.Name)}like '%{query.Name}%'");
}
} }
builder.Append($" order by Id desc"); builder.Append($" order by Id desc");
return GetPage<RB_Prize_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList(); return GetPage<RB_Prize_Extend>(pageIndex, pageSize, out rowCount, builder.ToString(), parameters).ToList();
} }
/// <summary> /// <summary>
......
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