You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varstart=2023;varend=2023;varres=awaitDb.Value.Select<MemberCoiHistoryModel>().Where(x =>x.Date>=start&&x.Date<end&&x.Type==CoiType.New&&x.State==CoiState.平稳).GroupBy(x =>x.MemberId).WithTempQuery(x =>new{MemberId=x.Key,ScanSum=Db.Value.Select<MemberActionDayCountModel>().Where(y =>y.MemberId==x.Key&&y.Date>=start&&y.Date<end).Sum(y =>y.ScanCode)}).ToAggregateAsync(x =>new{MemberCount=x.Count(),ScanSum=x.Sum(x.Key.ScanSum)});生成的sql如下:
参数:@exp_0=2023
参数:@exp_1=2023
参数:@exp_2=1
参数:@exp_3=平稳
SELECT count(1) as1,sum(a.[ScanSum]) as2
FROM (SELECTa.[MemberId],isnull((SELECTsum(y.[ScanCode])FROM[scrm_member_action_day_count]yWith(NoLock)
WHERE (y.[MemberId]=a.[MemberId]AND y.[Date]>=@exp_4 AND y.[Date]<@exp_5)),0)[ScanSum]
FROM [scrm_member_coi_history] a With(NoLock)
WHERE (a.[Date]>=@exp_0 AND a.[Date]<@exp_1 AND a.[Type]=@exp_2 AND a.[State]=@exp_3)
GROUP BY a.[MemberId]) a
数据库版本
FreeSql.Provider.SqlServer 3.5.103
安装的Nuget包
FreeSql.Provider.SqlServer
.net framework/. net core? 及具体版本
.net 8
The text was updated successfully, but these errors were encountered:
问题描述及重现代码:
WithTempQuery中使用Select时无法带入变量的BUG,@exp_4和@exp_5不能带进去。
数据库版本
FreeSql.Provider.SqlServer 3.5.103
安装的Nuget包
FreeSql.Provider.SqlServer
.net framework/. net core? 及具体版本
.net 8
The text was updated successfully, but these errors were encountered: