where+=$@" and a.{nameof(RB_Goods_OrderDetail.TenantId)}={dmodel.TenantId}";
}
if(dmodel.MallBaseId>0)
{
where+=$@" and a.{nameof(RB_Goods_OrderDetail.MallBaseId)}={dmodel.MallBaseId}";
}
if(!string.IsNullOrEmpty(dmodel.OrderDetailIds))
{
where+=$@" and a.{nameof(RB_Goods_OrderDetail.Id)} in({dmodel.OrderDetailIds})";
}
if(dmodel.OrderId>0)
{
where+=$@" and a.{nameof(RB_Goods_OrderDetail.OrderId)}={dmodel.OrderId}";
}
if(dmodel.OrderType>0)
{
where+=$@" and a.{nameof(RB_Goods_OrderDetail.OrderType)}={(int)dmodel.OrderType}";
}
if(dmodel.IsComment>0)
{
where+=$@" and a.{nameof(RB_Goods_OrderDetail.IsComment)}={(int)dmodel.IsComment}";
}
if(!string.IsNullOrEmpty(dmodel.GoodsName))
{
where+=$@" and a.{nameof(RB_Goods_OrderDetail.GoodsName)} like '%{dmodel.GoodsName}%'";
}
if(!string.IsNullOrEmpty(dmodel.ProductCode))
{
where+=$@" and a.{nameof(RB_Goods_OrderDetail.ProductCode)} like '%{dmodel.ProductCode}%'";
}
if(!string.IsNullOrEmpty(dmodel.OrderIds))
{
where+=$@" and a.{nameof(RB_Goods_OrderDetail.OrderId)} in({dmodel.OrderIds})";
}
stringsql=$@"SELECT a.*,b.`Name` as SupplierName,e.`Name` as CarName,e.CarType as GuideCarType,e.CarClass,f.ColorName as CarColorName,cb.`Name` as CarBrandName,g.RideNum,gcg.Name as GuideName,gcg.GuidePhoto,gcg.WorkYears as GuideWorkYears,gcg.Score as GuideScore,gcg.Telephone as GuideTelephone FROM rb_goods_orderdetail as a
LEFT JOIN rb_supplier as b on a.SupplierId=b.ID
LEFT JOIN rb_guidecar_car as e on e.ID=a.CarId
LEFT JOIN rb_guidecar_carbrand as cb on e.CarBrandId=cb.ID
LEFT JOIN rb_guidecar_carcolor as f on f.ID=a.CarColorId
LEFT JOIN rb_guidecar_guide as gcg on gcg.ID=a.GuideId