Commit 5b9787b6 authored by 吴春's avatar 吴春
parents eef03f42 63a662a4
......@@ -4,6 +4,7 @@ using System.Text;
using Mall.Model.Entity.Product;
using Mall.Model.Extend.Product;
using System.Linq;
using VT.FW.DB.Dapper;
namespace Mall.Repository.Product
{
......@@ -23,6 +24,7 @@ namespace Mall.Repository.Product
/// <returns></returns>
public List<RB_Material_Info_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Material_Info_Extend dmodel)
{
var parameters = new DynamicParameters();
string where = $" 1=1 and {nameof(RB_Material_Info.Status)}=0";
if (dmodel.TenantId > 0)
......@@ -37,7 +39,8 @@ namespace Mall.Repository.Product
where += $@" and {nameof(RB_Material_Info.Id)}={dmodel.Id}";
}
if (!string.IsNullOrEmpty(dmodel.Name)) {
where += $@" and {nameof(RB_Material_Info.Name)} like '%{dmodel.Name}%'";
where += $@" and {nameof(RB_Material_Info.Name)} like @Name ";
parameters.Add("Name", "%" + dmodel.Name.Trim() + "%");
}
if (dmodel.Type > 0) {
where += $@" and {nameof(RB_Material_Info.Type)}={dmodel.Type}";
......@@ -51,7 +54,7 @@ namespace Mall.Repository.Product
}
string sql = $@"select * from RB_Material_Info where {where} order by Id desc";
return GetPage<RB_Material_Info_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
return GetPage<RB_Material_Info_Extend>(pageIndex, pageSize, out rowCount, sql, parameters).ToList();
}
/// <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