fix 子查询补充过滤
This commit is contained in:
@@ -50,7 +50,7 @@ public class EFenceService : IEFenceService
|
||||
Name = x.Name,
|
||||
Description = x.Description,
|
||||
DirectionType = x.DirectionType,
|
||||
DeviceCount = SqlFunc.Subqueryable<EFenceDeviceRelationEntity>().Where(p => p.EFenceCode == x.Code).Count(),
|
||||
DeviceCount = SqlFunc.Subqueryable<EFenceDeviceRelationEntity>().Where(p => p.EFenceCode == x.Code).Where(p => p.IsDeleted == false).Count(),
|
||||
})
|
||||
.ToPageListAsync(request);
|
||||
|
||||
@@ -84,6 +84,7 @@ public class EFenceService : IEFenceService
|
||||
.Where(d => deviceCodes.Contains(d.Code))
|
||||
.Where(d => SqlFunc.Subqueryable<EFenceDeviceRelationEntity>()
|
||||
.Where(p => p.DeviceCode == d.Code)
|
||||
.Where(p => p.IsDeleted == false)
|
||||
.NotAny() //不可重复分配
|
||||
)
|
||||
.ToListAsync();
|
||||
|
||||
Reference in New Issue
Block a user