添加基础信息查询的接口
This commit is contained in:
@@ -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}%"
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user