fix 子查询补充过滤

This commit is contained in:
2025-12-17 11:04:56 +08:00
parent b409f6f375
commit 4bca8859ef
4 changed files with 55 additions and 44 deletions

View File

@@ -131,7 +131,11 @@ public class GainfoOutsourceService : IGainfoOutsourceService
{
var outsources = await _dbContext.Queryable<GainfoEntity>()
.Where(x => x.Type == GainfoUserTypeEnumType.Outsource)
.Where(x => SqlFunc.Subqueryable<OutsourceWhiteListEntity>().Where(p => p.UserCode == x.Code).NotAny())//不存在白名单中
.Where(x => SqlFunc.Subqueryable<OutsourceWhiteListEntity>()
.Where(p => p.UserCode == x.Code)
.Where(p => p.IsDeleted == false)
.NotAny()
)//不存在白名单中
.Select(x => new { x.Id, x.Code, x.Factory, x.CreateTime })
.ToListAsync();