diff --git a/DataBase/版本日志/HJGLDB_DS_2026-05-18_bwj.sql b/DataBase/版本日志/HJGLDB_DS_2026-05-18_bwj.sql index b634253..f27eae3 100644 --- a/DataBase/版本日志/HJGLDB_DS_2026-05-18_bwj.sql +++ b/DataBase/版本日志/HJGLDB_DS_2026-05-18_bwj.sql @@ -4,9 +4,10 @@ values('142E6B0B-530E-448B-84C5-1A93E0316E3B',' go + CREATE PROCEDURE [dbo].[HJGL_rpt_GoldMouthLedger] ( - @projectId NVARCHAR(50) = null + @projectId NVARCHAR(50) =null ) AS /**********»Æ½ð£¨ÅöÍ·£©º¸¿Ú²ÄÖʼ°¼ì²âÈ·Èϱí***************/ @@ -31,11 +32,17 @@ null as OldSteelCode,-- ELSE WeldReportMain.JOT_WeldDate END) AS JOT_WeldDate, --º¸½ÓÈÕÆÚ ndt.NDT_Code,--¼ì²â·½·¨ (case when jointInfo.RT_States is not null and jointInfo.RT_States!='´ýÖØ¼ì' then jointInfo.RT_States -else (case when jointInfo.PT_States is not null and jointInfo.PT_States!='´ýÖØ¼ì' then jointInfo.PT_States -else (case when jointInfo.MT_States is not null and jointInfo.MT_States!='´ýÖØ¼ì' then jointInfo.MT_States else (case when jointInfo.UT_States is not null and jointInfo.UT_States!='´ýÖØ¼ì' then jointInfo.UT_States -else null end)end) end) end) as TestStates,--¼ì²â״̬ -jointInfo.RTFeedbackDate as TestDate,--¼ì²âÈÕÆÚ +else (case when jointInfo.MT_States is not null and jointInfo.MT_States!='´ýÖØ¼ì' then jointInfo.MT_States +else (case when jointInfo.PT_States is not null and jointInfo.PT_States!='´ýÖØ¼ì' then jointInfo.PT_States +else (case when jointInfo.PAUT_States is not null and jointInfo.PAUT_States!='´ýÖØ¼ì' then jointInfo.PAUT_States +else null end) end)end) end) end) as TestStates,--¼ì²â״̬ +(case when jointInfo.RT_States is not null and jointInfo.RT_States='¼ì²âºÏ¸ñ' then jointInfo.RT_TrustDate +else (case when jointInfo.UT_States is not null and jointInfo.UT_States='¼ì²âºÏ¸ñ' then jointInfo.UT_TrustDate +else (case when jointInfo.MT_States is not null and jointInfo.MT_States='¼ì²âºÏ¸ñ' then jointInfo.MT_TrustDate +else (case when jointInfo.PT_States is not null and jointInfo.PT_States='¼ì²âºÏ¸ñ' then jointInfo.PT_TrustDate +else (case when jointInfo.PAUT_States is not null and jointInfo.PAUT_States='¼ì²âºÏ¸ñ' then jointInfo.PAUT_TrustDate +else null end) end)end) end) end) as TestDate,--¼ì²âÈÕÆÚ null as ConfirmMan,--È·ÈÏÈË jointType.JOTY_Group, jointInfo.Sort1, @@ -56,4 +63,5 @@ LEFT JOIN HJGL_BO_BatchDetail AS batchDetail on batchDetail.JOT_ID = jointInfo.J LEFT JOIN HJGL_BS_NDTType AS ndt ON ndt.NDT_ID = batchDetail.NDT WHERE IsGold=1 and (jointInfo.ProjectId=@projectId or @projectId is null) +order by isoInfo.ISO_IsoNo,jointType.JOTY_Group,jointInfo.Sort1,jointInfo.Sort2,jointInfo.Sort3,jointInfo.Sort4,jointInfo.Sort5 GO