where+=string.Format(" AND a.{0}={1}",nameof(RB_Supplies_Inventory_Extend.Status),0);
where+=$@" and a.RB_Group_Id={dmodel.RB_Group_Id}";
if(dmodel.WarehouseId>0)
{
where+=" and a."+nameof(RB_Supplies_Inventory_Extend.WarehouseId)+$" ={dmodel.WarehouseId}";
}
if(dmodel.SuppliesId>0)
{
where+=" and a."+nameof(RB_Supplies_Inventory_Extend.SuppliesId)+$" ={dmodel.SuppliesId}";
}
if(!string.IsNullOrEmpty(dmodel.WarehouseIdStr))
{
where+=" and a."+nameof(RB_Supplies_Inventory_Extend.WarehouseId)+$" in({dmodel.WarehouseIdStr})";
}
if(!string.IsNullOrEmpty(dmodel.SuppliesIdStr))
{
where+=" and a."+nameof(RB_Supplies_Inventory_Extend.SuppliesId)+$" in({dmodel.SuppliesIdStr})";
}
stringsql=$@" select a.*,b.ReservedStock,b.`Name` as GoodsName,b.SpecificationName from RB_Supplies_Inventory as a LEFT JOIN rb_supplies_material as b on a.SuppliesId=b.Id {where} order by a.Id desc";