[성현모] TL 수정

This commit is contained in:
SHM
2026-02-11 12:05:56 +09:00
parent 122d84bc01
commit aaf0b9f0f7
3 changed files with 23 additions and 7 deletions

View File

@ -89,9 +89,24 @@ namespace SystemX.Product.CP.TRA.Extract
try
{
// 2. 실행할 쿼리 작성 (JOIN 포함)
string sql = $@"SELECT * FROM {config.SummaryTable} as Summary WITH(NOLOCK)
JOIN {config.ResultTable} as Result WITH(NOLOCK) ON Summary.No = Result.No
WHERE TestListFileNo = {tl.TestListFileNo} and StepVersion={tl.StepVersion}";
//string sql = $@"SELECT * FROM {config.SummaryTable} as Summary WITH(NOLOCK)
//JOIN {config.ResultTable} as Result WITH(NOLOCK) ON Summary.No = Result.No
//WHERE TestListFileNo = {tl.TestListFileNo} and StepVersion={tl.StepVersion}";
string sql = $@"SELECT
Summary.*,
Result.*,
TL.StepVersion AS Matched_StepVersion
FROM [{config.DataBase}].[dbo].[{config.SummaryTable}] AS Summary WITH(NOLOCK)
JOIN [{config.DataBase}].[dbo].[{config.ResultTable}] AS Result WITH(NOLOCK)
ON Summary.No = Result.No
OUTER APPLY (
SELECT TOP 1 *
FROM [CPXV2].[dbo].[VRFY_TestListFileRelease]
WHERE StepVersion <= Summary.StepVersion and TestListFileNo = {tl.TestListFileNo} and StepDesc = '{config.MO}'
ORDER BY StepVersion DESC
) AS TL
WHERE Summary.TestListFileNo = {tl.TestListFileNo} and StepVersion=TL.StepVersion";
//test code
if(string.IsNullOrEmpty(config.TestCode) == false)