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