This commit is contained in:
2025-06-03 14:47:13 +08:00
parent b9e5ca1cc1
commit 69b31be1d5
3 changed files with 109 additions and 4 deletions

View File

@@ -126,14 +126,14 @@ FROM (
where aa.FDATE >= @begintime
AND aa.FDATE < @endtime
) YingShou
FULL JOIN
VHUB_t_Cust_Entry100007 t1
FULL JOIN
(select t1.* from VHUB_t_Cust_Entry100007 t1
INNER JOIN (select * from VHUB_t_Cust100008 tt3 where tt3.FYEARS = @FYear) t2 ON t1.FID = t2.FID) t1
ON t1.FCUSTOMERID=YingShou.FCUSTOMERID AND YingShou.FBMMATERIALGROUP=t1.FBMMATERIALGROUP
LEFT JOIN (select * from VHUB_t_Cust100008 tt3 where tt3.FYEARS = @FYear) t2 ON t1.FID = t2.FID
LEFT JOIN T_BD_CUSTOMER t3 ON isnull(YingShou.FCUSTOMERID,t1.FCUSTOMERID) = t3.FCUSTID
LEFT JOIN T_BD_CUSTOMER_L t4 ON t3.FCUSTID = t4.FCUSTID
INNER JOIN VHUB_BD_BMMaterialGroup t5 ON isnull(YingShou.FBMMATERIALGROUP,t1.FBMMATERIALGROUP)= t5.FID
WHERE 1=1
WHERE 1=1
'+@where2+@where3+'
) AS aaa';