SGGL_SHJ/DataBase/版本日志/SGGLDB_V2023-11-27.sql

62 lines
2.8 KiB
MySQL
Raw Normal View History

2023-11-27 12:13:21 +08:00
ALTER VIEW [dbo].[View_HJGL_Batch_PointBatchItem]
AS
/*************<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><EFBFBD>*************/
SELECT PointBatchItem.PointBatchItemId,
PointBatchItem.PointBatchId,
PointBatch.ProjectId,
PointBatch.UnitId,
PointBatch.DetectionTypeId,
PointBatch.DetectionRateId,
PointBatch.PointBatchCode,
Pipeline.UnitWorkId,
PointBatchItem.WeldJointId,
(CASE PointBatchItem.PointState WHEN '1' THEN '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' WHEN '2' THEN '<EFBFBD><EFBFBD>͸' END) AS PointState,
(CASE PointBatchItem.IsBuildTrust WHEN 1 THEN '<EFBFBD><EFBFBD>' ELSE '' END) AS IsBuildTrust,
(CASE WHEN PointBatchItem.IsAudit=1 THEN '<EFBFBD><EFBFBD>'
WHEN (PointBatchItem.IsAudit IS NULL OR PointBatchItem.IsAudit=0) AND PointBatchItem.PointState IS NOT NULL THEN '<EFBFBD><EFBFBD>'
WHEN (PointBatchItem.IsAudit IS NULL OR PointBatchItem.IsAudit=0) AND PointBatchItem.PointState IS NULL THEN '' END) AS PointIsAudit,
PointBatchItem.PointDate,--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
(CASE PointBatchItem.IsWelderFirst WHEN 1 THEN '<EFBFBD><EFBFBD>' ELSE '' END) AS IsWelderFirst,
PointBatchItem.RepairDate,--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
PointBatchItem.RepairRecordId,
PointBatchItem.CutDate,--<EFBFBD>г<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
PointBatchItem.PBackingWelderId,--<EFBFBD><EFBFBD><EFBFBD>޴<EFBFBD><EFBFBD>׺<EFBFBD><EFBFBD><EFBFBD>
PointBatchItem.PCoverWelderId,--<EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UnitWork.UnitWorkCode,--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
WeldJoint.WeldJointCode,--<EFBFBD><EFBFBD><EFBFBD>ں<EFBFBD>
WeldJoint.BackingWelderId AS WelderId, --<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID
BackingWelder.WelderCode AS BackingWelderCode,
CoverWelder.WelderCode AS CoverWelderCode,
WeldType.WeldTypeCode,
WeldJoint.JointAttribute,
WeldJoint.JointArea,--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
WeldJoint.Size,--ʵ<EFBFBD>ʴ
WeldingDaily.WeldingDate,--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
WeldJoint.PipelineId, --<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID
WeldJoint.Material1Id AS Mat, --<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
WeldJoint.Specification, --<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Pipeline.PipelineCode, --<EFBFBD><EFBFBD><EFBFBD>ߺ<EFBFBD>
PipingClass.PipingClassName , --<EFBFBD>ܵ<EFBFBD><EFBFBD>ȼ<EFBFBD>
WeldJoint.BackingWelderId,
WeldJoint.CoverWelderId
FROM dbo.HJGL_Batch_PointBatchItem AS PointBatchItem
LEFT JOIN dbo.HJGL_Batch_PointBatch AS PointBatch ON PointBatch.PointBatchId=PointBatchItem.PointBatchId
LEFT JOIN dbo.HJGL_WeldJoint AS WeldJoint ON WeldJoint.WeldJointId=PointBatchItem.WeldJointId
LEFT JOIN dbo.HJGL_Pipeline AS Pipeline ON Pipeline.PipelineId=WeldJoint.PipelineId
LEFT JOIN dbo.WBS_UnitWork AS UnitWork ON UnitWork.UnitWorkId=Pipeline.UnitWorkId
LEFT JOIN dbo.HJGL_WeldingDaily AS WeldingDaily ON WeldingDaily.WeldingDailyId=WeldJoint.WeldingDailyId
LEFT JOIN dbo.Base_PipingClass AS PipingClass ON PipingClass.PipingClassId=Pipeline.PipingClassId
LEFT JOIN SitePerson_Person AS BackingWelder ON BackingWelder.PersonId=WeldJoint.BackingWelderId
LEFT JOIN SitePerson_Person AS CoverWelder ON CoverWelder.PersonId=WeldJoint.CoverWelderId
LEFT JOIN Base_WeldType AS WeldType ON WeldType.WeldTypeId=WeldJoint.WeldTypeId
LEFT JOIN HJGL_Hard_TrustItem HardTrustItem ON HardTrustItem.WeldJointId=PointBatchItem.WeldJointId
where (WeldJoint.IsHotProess!=1 or WeldJoint.IsHotProess is null or (WeldJoint.IsHotProess=1 and HardTrustItem.IsPass=1))
and BackingWelder.ProjectId=Pipeline.ProjectId and CoverWelder.ProjectId=Pipeline.ProjectId
GO