11
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
-- 管线焊工 增加是否 PMI处理
|
||||
alter table Pipeline_WeldJoint add isPMI bit NULL
|
||||
GO
|
||||
update Pipeline_WeldJoint set isPMI=0
|
||||
GO
|
||||
|
||||
ALTER VIEW [dbo].[View_Pipeline_WeldJoint]
|
||||
AS
|
||||
@@ -202,7 +207,6 @@ FROM Pipeline_WeldJoint AS weldJoint
|
||||
|
||||
GO
|
||||
|
||||
|
||||
UPDATE dbo.Template_Files SET title=REPLACE(title,cast(sortindex as nvarchar(50))+'-','')
|
||||
GO
|
||||
|
||||
@@ -223,6 +227,7 @@ create table PMI_Delegation
|
||||
InstallationId nvarchar(50),
|
||||
UnitId nvarchar(50),
|
||||
DetectionStandard nvarchar(50),
|
||||
Tabler nvarchar(50),
|
||||
Remark nvarchar(255),
|
||||
CreatedTime datetime default getdate()
|
||||
)
|
||||
@@ -240,43 +245,45 @@ create table PMI_DelegationDetails
|
||||
)
|
||||
go
|
||||
|
||||
-- 管线焊工 增加是否 PMI处理
|
||||
alter table Pipeline_WeldJoint add isPMI bit null
|
||||
update Pipeline_WeldJoint set isPMI=0
|
||||
|
||||
-- 插入PMI委托菜单
|
||||
insert into Sys_Menu values('A6FB44C3-0920-4F77-862F-D814FD5E5D23','PMI检测管理','PMI detection management','',21,0,3,NUll,1)
|
||||
insert into Sys_Menu values(NEWID(),'PMI委托','PMI delegation','/WeldingProcess/PMI/PMIDelegation.aspx',0,'A6FB44C3-0920-4F77-862F-D814FD5E5D23',3,NULL,1)
|
||||
insert into Sys_Menu values(NEWID(),'PMI检测录入','PMI detection entry','/WeldingProcess/PMI/PMIDetectionEntry.aspx',0,'A6FB44C3-0920-4F77-862F-D814FD5E5D23',3,NULL,1)
|
||||
insert into Sys_Menu values(NEWID(),'PMI委托','PMI delegation','/WeldingProcess/PMI/PMIDelegation.aspx',1,'A6FB44C3-0920-4F77-862F-D814FD5E5D23',3,NULL,1)
|
||||
insert into Sys_Menu values(NEWID(),'PMI检测录入','PMI detection entry','/WeldingProcess/PMI/PMIDetectionEntry.aspx',2,'A6FB44C3-0920-4F77-862F-D814FD5E5D23',3,NULL,1)
|
||||
GO
|
||||
|
||||
|
||||
/*******PMI委托明细视图***********/
|
||||
CREATE VIEW [dbo].[View_PMI_DelegationDetails]
|
||||
|
||||
ALTER VIEW [dbo].[View_PMI_DelegationDetails]
|
||||
AS
|
||||
|
||||
/********热处理明细********/
|
||||
SELECT
|
||||
B.PMIId,
|
||||
B.JointId,
|
||||
B.QualityNo,
|
||||
B.Acceptance,
|
||||
B.CreatedTime,
|
||||
B.status,
|
||||
Pipeline.PipelineCode,
|
||||
TrustItem.Id,
|
||||
TrustItem.Acceptance,
|
||||
TrustItem.CreatedTime,
|
||||
TrustItem.JointId as WeldJointId,
|
||||
TrustItem.status,
|
||||
TrustItem.QualityNo,
|
||||
TrustItem.PMIId,
|
||||
Trust.ProjectId,
|
||||
Trust.DelegationNo,
|
||||
Trust.DelegationDate,
|
||||
WeldJoint.WeldJointCode,
|
||||
Pipeline.PipelineCode,
|
||||
WeldJoint.Specification,
|
||||
WeldJoint.Remark,
|
||||
Pipeline.SingleNumber,
|
||||
(CASE WHEN WeldJoint.CoverWelderCode IS NOT NULL AND WeldJoint.BackingWelderCode IS NOT NULL
|
||||
THEN WeldJoint.CoverWelderCode + '/' + WeldJoint.BackingWelderCode
|
||||
ELSE (ISNULL(WeldJoint.CoverWelderCode,'') + ISNULL(WeldJoint.BackingWelderCode,'')) END) AS WelderCode, --焊工
|
||||
(CASE WHEN WeldJoint.Material1Code IS NOT NULL AND WeldJoint.Material2Code IS NOT NULL
|
||||
THEN WeldJoint.Material1Code + '/' + WeldJoint.Material2Code
|
||||
ELSE (ISNULL(WeldJoint.Material1Code,'') + ISNULL(WeldJoint.Material2Code,'')) END) AS MaterialCode --材质
|
||||
FROM PMI_Delegation AS A INNER JOIN
|
||||
PMI_DelegationDetails AS B ON A.Id=B.PMIId
|
||||
LEFT JOIN View_Pipeline_WeldJoint AS WeldJoint ON WeldJoint.WeldJointId=B.JointId
|
||||
Material.MaterialCode,
|
||||
Pipeline.WorkAreaId
|
||||
FROM PMI_DelegationDetails AS TrustItem
|
||||
LEFT JOIN PMI_Delegation AS Trust ON Trust.Id=TrustItem.PMIId
|
||||
LEFT JOIN Pipeline_WeldJoint AS WeldJoint ON WeldJoint.WeldJointId=TrustItem.JointId
|
||||
LEFT JOIN Pipeline_Pipeline AS Pipeline ON Pipeline.PipelineId=WeldJoint.PipelineId
|
||||
|
||||
LEFT JOIN Base_Material AS Material ON Material.MaterialId=WeldJoint.Material1Id
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user