40 lines
1.4 KiB
Transact-SQL
40 lines
1.4 KiB
Transact-SQL
UPDATE dbo.Batch_PointBatchItem SET PointState=NULL,PointDate=NULL,
|
|
JLAudit=NULL,GLGSAudit=NULL,QTAudit=NULL
|
|
WHERE PointState='1' AND
|
|
PointBatchItemId NOT IN(SELECT PointBatchItemId FROM dbo.Batch_BatchTrustItem)
|
|
GO
|
|
|
|
UPDATE dbo.Batch_PointBatchItem SET IsCompletedPoint=1
|
|
GO
|
|
|
|
alter table PTP_PipelineList add WorkAreaId nvarchar(50)
|
|
alter table PTP_PipelineList add isAll bit
|
|
alter table PTP_PipelineList add WeldJonintCode nvarchar(max)
|
|
GO
|
|
|
|
CREATE VIEW [dbo].[View_TrustBathcIn]
|
|
AS
|
|
/*用于导入数据时,查询焊口信息*/
|
|
SELECT
|
|
pitem.PointBatchItemId,pitem.PointBatchId,jot.ProjectId
|
|
,pipeline.InstallationId,ins.InstallationCode
|
|
,pipeline.WorkAreaId,workArea.WorkAreaCode
|
|
,jot.PipelineId,pipeline.PipelineCode
|
|
,pitem.WeldJointId,jot.WeldJointCode
|
|
,point.DetectionTypeId,nde.DetectionTypeCode
|
|
,pitem.IsWelderFirst,trust.TrustBatchItemId
|
|
FROM dbo.Batch_PointBatchItem AS pitem
|
|
LEFT JOIN dbo.Batch_PointBatch point ON point.PointBatchId = pitem.PointBatchId
|
|
LEFT JOIN Pipeline_WeldJoint jot ON jot.WeldJointId = pitem.WeldJointId
|
|
LEFT JOIN Pipeline_Pipeline AS pipeline ON jot.PipelineId = pipeline.PipelineId
|
|
LEFT JOIN dbo.Project_WorkArea AS workArea ON workArea.WorkAreaId=pipeline.WorkAreaId
|
|
LEFT JOIN dbo.Project_Installation ins ON ins.InstallationId = workArea.InstallationId
|
|
LEFT JOIN dbo.Base_DetectionType nde ON nde.DetectionTypeId = point.DetectionTypeId
|
|
LEFT JOIN dbo.Batch_BatchTrustItem trust ON trust.PointBatchItemId = pitem.PointBatchItemId
|
|
|
|
|
|
|
|
GO
|
|
|
|
|