where+=$@" and {nameof(RB_Goods_OrderDetail.TenantId)}={dmodel.TenantId}";
where+=$@" and a.{nameof(RB_Goods_OrderDetail.TenantId)}={dmodel.TenantId}";
}
if(dmodel.MallBaseId>0)
{
where+=$@" and {nameof(RB_Goods_OrderDetail.MallBaseId)}={dmodel.MallBaseId}";
where+=$@" and a.{nameof(RB_Goods_OrderDetail.MallBaseId)}={dmodel.MallBaseId}";
}
if(!string.IsNullOrEmpty(dmodel.OrderDetailIds))
{
where+=$@" and {nameof(RB_Goods_OrderDetail.Id)} in({dmodel.OrderDetailIds})";
where+=$@" and a.{nameof(RB_Goods_OrderDetail.Id)} in({dmodel.OrderDetailIds})";
}
if(dmodel.OrderId>0)
{
where+=$@" and {nameof(RB_Goods_OrderDetail.OrderId)}={dmodel.OrderId}";
where+=$@" and a.{nameof(RB_Goods_OrderDetail.OrderId)}={dmodel.OrderId}";
}
if(dmodel.OrderType>0)
{
where+=$@" and {nameof(RB_Goods_OrderDetail.OrderType)}={(int)dmodel.OrderType}";
where+=$@" and a.{nameof(RB_Goods_OrderDetail.OrderType)}={(int)dmodel.OrderType}";
}
if(dmodel.IsComment>0)
{
where+=$@" and {nameof(RB_Goods_OrderDetail.IsComment)}={(int)dmodel.IsComment}";
where+=$@" and a.{nameof(RB_Goods_OrderDetail.IsComment)}={(int)dmodel.IsComment}";
}
if(!string.IsNullOrEmpty(dmodel.GoodsName))
{
where+=$@" and {nameof(RB_Goods_OrderDetail.GoodsName)} like '%{dmodel.GoodsName}%'";
where+=$@" and a.{nameof(RB_Goods_OrderDetail.GoodsName)} like '%{dmodel.GoodsName}%'";
}
if(!string.IsNullOrEmpty(dmodel.ProductCode))
{
where+=$@" and {nameof(RB_Goods_OrderDetail.ProductCode)} like '%{dmodel.ProductCode}%'";
where+=$@" and a.{nameof(RB_Goods_OrderDetail.ProductCode)} like '%{dmodel.ProductCode}%'";
}
if(!string.IsNullOrEmpty(dmodel.OrderIds))
{
where+=$@" and {nameof(RB_Goods_OrderDetail.OrderId)} in({dmodel.OrderIds})";
where+=$@" and a.{nameof(RB_Goods_OrderDetail.OrderId)} in({dmodel.OrderIds})";
}
stringsql=$@"SELECT * FROM rb_goods_orderdetail where {where} order by Id asc";
stringsql=$@"SELECT a.*,b.`Name` as SupplierName FROM rb_goods_orderdetail as a LEFT JOIN rb_supplier as b on a.SupplierId=b.ID where {where} order by a.Id asc";