- 修复 FromQueryMulti 多表重载可能出现的 null 对象报错;(合并 FromQuery 和 FromQueryMulti 代码)

This commit is contained in:
2881099
2023-03-15 22:54:22 +08:00
parent 357e52a59f
commit a157f8a0cc
7 changed files with 27 additions and 61 deletions

View File

@ -78,7 +78,8 @@ WHERE (a.[RN] < 2)", sql);
});
Assert.Equal(@"SELECT a.[CkassIfCation] as1, b.[DeliveryInstractionStatus] as2, b.[UpTime] as3, 1 as4, c.[RunNo] as5
FROM [UnitLog] a
INNER JOIN (SELECT a.[LoadNo], a.[SeqNoLog], c.[DeliveryInstractionStatus], c.[UpTime], row_number() over( partition by a.[UnitId] order by a.[SeqNoLog] desc) [RN]
INNER JOIN (
SELECT a.[LoadNo], a.[SeqNoLog], c.[DeliveryInstractionStatus], c.[UpTime], row_number() over( partition by a.[UnitId] order by a.[SeqNoLog] desc) [RN]
FROM [UnitLog] a
INNER JOIN [LoadPlan] b ON a.[LoadNo] = b.[LoadNo] AND a.[UnitTransactionType] = N'TO'
INNER JOIN [Instruction] c ON b.[InstructionNo] = c.[InstructionNo] ) b ON a.[SeqNoLog] = b.[SeqNoLog]