添加基础信息查询的接口

This commit is contained in:
admin
2021-01-19 10:19:10 +08:00
parent caae14f652
commit 7f130871c6
19 changed files with 368 additions and 45 deletions

View File

@@ -12,10 +12,10 @@ namespace NX.ERP.U8
public IEnumerable<Warehouse> GetList(string strWhere = "", object Param = null)
{
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
{
var sql = "select cWhCode as Code,cWhName as Name from Warehouse";
var sql = "select cWhCode as WarehouseCode,cWhName as WarehouseName from Warehouse";
if (!string.IsNullOrEmpty(strWhere))
{
sql += $" where {strWhere}";
@@ -23,5 +23,33 @@ namespace NX.ERP.U8
return conn.Query<Warehouse>(sql, Param);
}
}
public IEnumerable<Warehouse> GetList(NX.ERP.Model.Request.Warehouse Params)
{
List<string> where = new List<string>();
if (!string.IsNullOrEmpty(Params.WarehouseCode))
{
where.Add(" cWhCode like @WarehouseCode");
}
if (!string.IsNullOrEmpty(Params.WarehouseName))
{
where.Add(" cWhName like @WarehouseName");
}
return this.GetList(string.Join(" and ", where.ToArray()), new
{
WarehouseCode = $"%{Params.WarehouseCode}%",
WarehouseName = $"%{Params.WarehouseName}%"
});
}
}
}