where+=string.Format(" AND a.{0}={1}",nameof(RB_Supplies_Inventory_Extend.Status),0);
where+=$@" and b.RB_Group_Id={dmodel.RB_Group_Id}";
if(dmodel.WarehouseId>0)
{
where+=" and b."+nameof(RB_Supplies_Inventory_Extend.WarehouseId)+$" ={dmodel.WarehouseId}";
}
if(dmodel.SuppliesId>0)
{
where+=" and b."+nameof(RB_Supplies_Inventory_Extend.SuppliesId)+$" ={dmodel.SuppliesId}";
}
if(!string.IsNullOrEmpty(dmodel.StartTime))
{
where+=" and a."+nameof(RB_Supplies_InventoryDetail_Extend.CreateDate)+" >='"+dmodel.StartTime+"'";
}
if(!string.IsNullOrEmpty(dmodel.EndTime))
{
where+=" and a."+nameof(RB_Supplies_InventoryDetail_Extend.CreateDate)+" <='"+dmodel.EndTime+"'";
}
stringsql=$@" select b.*,a.Number as DetailNum,a.Type,a.CreateBy as DetailBy,a.CreateDate as DetailDate from rb_supplies_inventorydetail as a LEFT JOIN RB_Supplies_Inventory as b on a.InventoryId=b.Id {where} order by a.Id desc";