return Db.Queryable<Dt_CachePoint>().Where(a => a.Depth == 1 && a.AreaId == areaId && a.PointStatus == locationAStatus.ObjToInt() && a.PointStatus == locationAStatus.ObjToInt()).InnerJoin(Db.Queryable<Dt_CachePoint>().Where(b => b.Depth == 2 && b.AreaId == areaId && b.PointStatus == locationBStatus.ObjToInt() && b.PointStatus == locationBStatus.ObjToInt()), (a, b) => a.Column == b.Column && a.AreaId == b.AreaId && a.Row != b.Row && SqlFunc.Abs(a.Row - b.Row) == 1).Select((a, b) => new CachePointGroupDTO { DepthA = a.Depth, DepthB = b.Depth, EnableStatusA = a.EnableStatus, EnableStatusB = b.EnableStatus, IdA = a.Id, IdB = b.Id, PointCodeA = a.PointCode, PointCodeB = b.PointCode, PointStatusA = a.PointStatus, PointStatusB = b.PointStatus, PointTypeA = a.PointType, PointTypeB = b.PointType }).ToList();
|