fix 人脸检测问题,数据查询

This commit is contained in:
2024-08-27 16:23:05 +08:00
parent 00238dd781
commit 1e855c3ec9
2 changed files with 11 additions and 2 deletions

View File

@@ -81,7 +81,8 @@ public class GainfoService : IGainfoService
ISugarQueryable<GainfoPageResponse> queryable = request.IsSearchAll
? _gainfoStore.Queryable(request.Status)
.WhereIF(request.DepartmentSelections?.Any() == true, where)
.WhereIF(request.DepartmentSelections?.Any() == false, gainfo => factories.Contains(gainfo.Factory))
.WhereIF(request.DepartmentSelections?.Any() == false, gainfo => factories.Contains(gainfo.Factory) ||
SqlFunc.Subqueryable<BusinessTripEntity>().Where(p => p.Code == gainfo.Code && factories.Contains(p.Destination) && SqlFunc.DateIsSame(p.BeginDate, today)).Any())
.LeftJoin<DepartmentEntity>((gainfo, department) => gainfo.DepartmentNo == department.No)
.LeftJoin<BasicTypeEntity>((gainfo, department, type) => type.Code == SqlFunc.ToString(gainfo.CardType) && type.Type == "timeperiod")
.WhereIF(request.Search.IsPresent(), gainfo =>