@@ -61,16 +57,21 @@ LEFT JOIN rb_warehouseout_goods as d on a.ID=d.ApplyId
}
if(!string.IsNullOrWhiteSpace(query.GoodsName))
{
builder.Append($" AND d.{nameof(RB_WarehouseOut_Goods.GoodsName)} like '%{query.GoodsName}%'");
goodsWhere+=$" AND ({nameof(RB_WarehouseOut_Goods.GoodsName)} like '%{query.GoodsName}%' or {nameof(RB_WarehouseOut_Goods.NewGoodsName)} like '%{query.GoodsName}%')";
}
if(!string.IsNullOrWhiteSpace(query.OrderNo))
{
builder.Append($" AND d.{nameof(RB_WarehouseOut_Goods.OrderNo)} like '%{query.OrderNo}%'");
goodsWhere+=$" AND {nameof(RB_WarehouseOut_Goods.OrderNo)} like '%{query.OrderNo}%'";
}
}
builder.Append($" order by a.{nameof(RB_WarehouseOut_Apply_Extend.ID)} desc");
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";
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";