|
|
@ -1765,7 +1765,7 @@ left join #Tempcccc cc on a.销售车辆号=cc.销售车辆号 |
|
|
left join #yjCheck1 ck on ck.routecode = a.routecode |
|
|
left join #yjCheck1 ck on ck.routecode = a.routecode |
|
|
left join ICSITEMROUTE2OPLot lot on b.itemcode = lot.ITEMCODE and dj.ROUTECODE = lot.ROUTECODE and lot.OPCODE = dj.opcode |
|
|
left join ICSITEMROUTE2OPLot lot on b.itemcode = lot.ITEMCODE and dj.ROUTECODE = lot.ROUTECODE and lot.OPCODE = dj.opcode |
|
|
left join ICSINVENTORY e on a.ITEMCODE = e.INVCODE |
|
|
left join ICSINVENTORY e on a.ITEMCODE = e.INVCODE |
|
|
where year(d.MTIME) = year(GETDATE()) and month(d.MTIME) = month(GETDATE()) and |
|
|
|
|
|
|
|
|
where year(d.MTIME) = year(GETDATE()) and month(d.MTIME) = month(GETDATE()) |
|
|
union All |
|
|
union All |
|
|
select distinct c.molotCode [销售车号] from |
|
|
select distinct c.molotCode [销售车号] from |
|
|
(select * from ICSITEMROUTE2OP where optionalop ='检验工序' and routecode in( |
|
|
(select * from ICSITEMROUTE2OP where optionalop ='检验工序' and routecode in( |
|
|
@ -1781,6 +1781,8 @@ left join #Tempcccc cc on a.销售车辆号=cc.销售车辆号 |
|
|
) jj |
|
|
) jj |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--1、已检验数据 已检车辆 |
|
|
--1、已检验数据 已检车辆 |
|
|
select count(1) Qty into #Tcustt_CKQty |
|
|
select count(1) Qty into #Tcustt_CKQty |
|
|
from ( |
|
|
from ( |
|
|
@ -1802,7 +1804,11 @@ left join #Tempcccc cc on a.销售车辆号=cc.销售车辆号 |
|
|
isnull((select Qty from #Tcustt_CKQty ),0) 已检车辆, |
|
|
isnull((select Qty from #Tcustt_CKQty ),0) 已检车辆, |
|
|
isnull((select count(1) from ICSZXCheck with(nolock) where checked='0'),0) 待整改, |
|
|
isnull((select count(1) from ICSZXCheck with(nolock) where checked='0'),0) 待整改, |
|
|
isnull((select count(1) from ICSZXCheck with(nolock) where checked='1' and month>= CONVERT(varchar(7), dateadd(mm,-1,getdate()), 21) +'-01' ),0) 已整改 |
|
|
isnull((select count(1) from ICSZXCheck with(nolock) where checked='1' and month>= CONVERT(varchar(7), dateadd(mm,-1,getdate()), 21) +'-01' ),0) 已整改 |
|
|
|
|
|
|
|
|
|
|
|
drop table #temp1 |
|
|
|
|
|
drop table #DJ |
|
|
|
|
|
drop table #yjCheck |
|
|
|
|
|
drop table #yjCheck1 |
|
|
|
|
|
drop table #filter |
|
|
|
|
|
|
|
|
if exists(select * from tempdb..sysobjects where id=object_id('tempdb..#Tcustttemp1')) |
|
|
if exists(select * from tempdb..sysobjects where id=object_id('tempdb..#Tcustttemp1')) |
|
|
drop table #Tcustttemp1 |
|
|
drop table #Tcustttemp1 |
|
|
|