|
@ -103,6 +103,7 @@ and b1.code not like 'K10%' |
|
|
,case when a.ActualCompleteDate is null then '' |
|
|
,case when a.ActualCompleteDate is null then '' |
|
|
else Convert(varchar(10),a.ActualCompleteDate,120 ) end as ActualCompleteDate |
|
|
else Convert(varchar(10),a.ActualCompleteDate,120 ) end as ActualCompleteDate |
|
|
,a.IsFIClose |
|
|
,a.IsFIClose |
|
|
|
|
|
,e3.Name AlternateTypeName |
|
|
INTO #TempMO |
|
|
INTO #TempMO |
|
|
from {1}.dbo.MO_MO as A With(NoLock) |
|
|
from {1}.dbo.MO_MO as A With(NoLock) |
|
|
left join {1}.dbo.[MO_MOMemo] as A1 With(NoLock) on (A.[ID] = A1.[MO]) |
|
|
left join {1}.dbo.[MO_MOMemo] as A1 With(NoLock) on (A.[ID] = A1.[MO]) |
|
@ -116,6 +117,9 @@ else Convert(varchar(10),a.ActualCompleteDate,120 ) end as ActualCompleteDate |
|
|
left join {1}.dbo.[CBO_Department] as A13 With(NoLock) on (A.[Department] = A13.[ID]) |
|
|
left join {1}.dbo.[CBO_Department] as A13 With(NoLock) on (A.[Department] = A13.[ID]) |
|
|
left join {1}.dbo.[CBO_Department_Trl] as A14 With(NoLock) on (A14.SysMlFlag = 'zh-CN') and (A13.[ID] = A14.[ID]) |
|
|
left join {1}.dbo.[CBO_Department_Trl] as A14 With(NoLock) on (A14.SysMlFlag = 'zh-CN') and (A13.[ID] = A14.[ID]) |
|
|
LEFT JOIN {1}.dbo.[CBO_Wh] AS A22 With(NoLock) ON A22.ID=A.CompleteWh |
|
|
LEFT JOIN {1}.dbo.[CBO_Wh] AS A22 With(NoLock) ON A22.ID=A.CompleteWh |
|
|
|
|
|
left join {1}.dbo.UBF_Sys_ExtEnumType e1 on e1.Code = 'UFIDA.U9.CBO.MFG.Enums.AlternateTypesEnum' |
|
|
|
|
|
left join {1}.dbo.UBF_Sys_ExtEnumValue e2 on e1.ID=e2.ExtEnumType and e2.evalue=a.BOMAlternate |
|
|
|
|
|
left join {1}.dbo.UBF_Sys_ExtEnumValue_Trl e3 on e2.id=e3.ID and e3.SysMLFlag='zh-CN' |
|
|
where (A.DocState=2 OR A.DocState=3) and A.[BusinessType] != 50 and (A.[BusinessType] != 52) |
|
|
where (A.DocState=2 OR A.DocState=3) and A.[BusinessType] != 50 and (A.[BusinessType] != 52) |
|
|
and (A.[BusinessType] != 2417) and (A.[IsMultiRouting] != 1) and A.[ItemMaster] is not null --and (A.[IsStartMO] != 1) |
|
|
and (A.[BusinessType] != 2417) and (A.[IsMultiRouting] != 1) and A.[ItemMaster] is not null --and (A.[IsStartMO] != 1) |
|
|
and ISNULL(A.ModifiedOn,A.BusinessCreatedOn)>=@LastTime AND A12.id='{0}' |
|
|
and ISNULL(A.ModifiedOn,A.BusinessCreatedOn)>=@LastTime AND A12.id='{0}' |
|
@ -173,6 +177,7 @@ else Convert(varchar(10),a.ActualCompleteDate,120 ) end as ActualCompleteDate |
|
|
values.Add("Default3", "a.ActualCompleteDate"); |
|
|
values.Add("Default3", "a.ActualCompleteDate"); |
|
|
values.Add("Default5", "a.DocState"); |
|
|
values.Add("Default5", "a.DocState"); |
|
|
values.Add("Default6", "a.IsFIClose"); |
|
|
values.Add("Default6", "a.IsFIClose"); |
|
|
|
|
|
values.Add("Alternate", "a.AlternateTypeName"); |
|
|
|
|
|
|
|
|
//更新存在数据
|
|
|
//更新存在数据
|
|
|
sql += ICSHelper.UpdateSQL("b", values) |
|
|
sql += ICSHelper.UpdateSQL("b", values) |
|
|