stringwhere=$" 1=1 and g.{nameof(RB_Goods_Extend.Status)}=0 and g.GoodsClassify=1 and g.{nameof(RB_Goods_Extend.GoodsStatus)}=1";
stringwhere=$" 1=1 and g.{nameof(RB_Goods_Extend.Status)}=0 and gcg.Status=0 and c.Status=0 and d.Status=0 and f.Status=0 and b.IsReserve=1 and a.AdvanceDay<=datediff(b.Date,NOW()) and g.GoodsClassify=1 and g.{nameof(RB_Goods_Extend.GoodsStatus)}=1";
if(dmodel.TenantId>0)
{
where+=$@" and g.{nameof(RB_Goods_Extend.TenantId)}={dmodel.TenantId}";
...
...
@@ -849,11 +849,17 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
where+=$@" and g.{nameof(RB_Goods_Extend.Id)} in({dmodel.GoodsIds})";
...
...
@@ -902,12 +903,12 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
}
if(!string.IsNullOrEmpty(dmodel.StartTime))
{
where+=$@" and g.{nameof(RB_Goods_Extend.CreateDate)} >='{dmodel.StartTime}'";
}
if(!string.IsNullOrEmpty(dmodel.EndTime))
{
where+=$@" and g.{nameof(RB_Goods_Extend.CreateDate)} <='{dmodel.EndTime+" 23:59:59"}'";
where+=$@" and b.Date >='{dmodel.StartTime}'";
}
//if (!string.IsNullOrEmpty(dmodel.EndTime))
//{
// where += $@" and b.Date <='{dmodel.EndTime + " 23:59:59"}'";
//}
if(dmodel.IsProcurement>0)
{
where+=$@" and g.{nameof(RB_Goods_Extend.IsProcurement)}={dmodel.IsProcurement}";
...
...
@@ -920,7 +921,6 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
{
where+=$@" and g.{nameof(RB_Goods_Extend.SupplierId)}={dmodel.SupplierId}";
}
stringorderBy=" g.Sort desc";
if(dmodel.OrderBy==1)
{
...
...
@@ -962,17 +962,13 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
//最新降序
orderBy=" g.CreateDate desc";
}
// e.CarClass = 1
//and g.CarType = 1 and g.LineName like'%川藏%' and g.LineDescription like'%成都%'
//and g.UseDay = 2 and g.IsSpell = 1 and(g.RideNum - b.ReserveNum) >= 4 and d.RegionId in(4)
stringsql=$@"SELECT g.*,c.SiteName,e.`Name` as CarName from rb_goods as g
stringsql=$@"SELECT g.*,c.SiteName,e.`Name` as CarName,e.CarType as GuideCarType,f.ColorName as CarColorName,gcg.Name as GuideName,gcg.WorkYears as GuideWorkYears,gcg.Score as GuideScore,gcg.Telephone as GuideTelephone from rb_goods as g
LEFT JOIN rb_goods_targetdate as b on g.Id=b.GoodsId
LEFT JOIN rb_guidecar_site as c on g.SiteId=c.ID
LEFT JOIN rb_guidecar_car as e on e.ID=g.CarId
LEFT JOIN rb_guidecar_siteregion d on d.SiteId=g.SiteId
LEFT JOIN rb_guidecar_siteregion as d on d.SiteId=g.SiteId
LEFT JOIN rb_guidecar_carcolor as f on f.ID=g.CarColorId
LEFT JOIN rb_guidecar_guide as gcg on gcg.ID=g.GuideId