添加查询条件
This commit is contained in:
@@ -9,14 +9,18 @@ namespace NX.ERP.U8
|
||||
{
|
||||
public class WarehouseDAL
|
||||
{
|
||||
public IEnumerable<Warehouse> GetList()
|
||||
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 WarehouseCode,cWhName as WarehouseName from Warehouse";
|
||||
return conn.Query<Warehouse>(sql, null);
|
||||
if (!string.IsNullOrEmpty(strWhere))
|
||||
{
|
||||
sql += $" where {strWhere}";
|
||||
}
|
||||
return conn.Query<Warehouse>(sql, Param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user