|
|
@ -69,7 +69,7 @@ DROP TABLE #tempSyncMoHour_Rhyton |
|
|
|
select |
|
|
|
a.* |
|
|
|
,(a.PTime+cast( a.ManualTime as decimal(18,6) )) as MachiningTotalTime |
|
|
|
,case when (a.EqpCalcType='1'and a.ResQty>0) then (a.PTime+cast( a.ManualTime as decimal(18,6) ))/a.ResQty |
|
|
|
,case when (a.EqpCalcType='True'and a.ResQty>0) then (a.PTime+cast( a.ManualTime as decimal(18,6) ))/a.ResQty |
|
|
|
else 0 end as EqpTotalTime |
|
|
|
,(a.PTime+cast( a.ManualTime as decimal(18,6) )-a.TotalTime) as HourDiff |
|
|
|
into #tempSyncMoHour_Rhyton |
|
|
@ -146,7 +146,7 @@ and a.MoStatus='mostatus_close' |
|
|
|
and a.Default6='0' |
|
|
|
and a.TenantId='{0}' |
|
|
|
and e.OpControl='10000000' |
|
|
|
and (h2.Status='No' or h2.Id is null ) |
|
|
|
and (h2.AlterTime is null or h2.Id is null ) |
|
|
|
) a |
|
|
|
where 1=1 |
|
|
|
) a |
|
|
@ -209,10 +209,13 @@ set STime=a.STime |
|
|
|
,EqpTotalTime=a.EqpTotalTime |
|
|
|
,ResQty=a.ResQty |
|
|
|
,HourDiff=a.HourDiff |
|
|
|
,LastModificationTime=GETDATE() |
|
|
|
,LastModifierUserId='job' |
|
|
|
,LastModifierUserName='job' |
|
|
|
from #tempSyncMoHour_Rhyton a |
|
|
|
join IcsMoHourData b on a.MoCode=b.MoCode and a.OpCode=b.OpCode |
|
|
|
where 1=1 |
|
|
|
and b.Status='No' |
|
|
|
and b.AlterTime is null |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|