fix 访客查询优化

This commit is contained in:
2024-11-29 12:04:51 +08:00
parent 88f0a9ac9c
commit 441a061f78

View File

@@ -216,7 +216,9 @@ public class AppointmentService : IAppointmentService
)
.Where(x => x.IsEnterDoorArea)
.WhereIF(status.HasValue, x => x.DoorStatus == status)
.Where(x => x.DoorStart >= start && x.DoorEnd <= end)
.WhereIF(status.HasValue && status == VisitorAppointmentDetailStatusEnumType.Wait, x => x.DoorStart >= start && x.DoorStart <= end)
.WhereIF(status.HasValue && status == VisitorAppointmentDetailStatusEnumType.Arrived, x => x.DoorStart >= start && x.DoorStart <= end)
.WhereIF(!status.HasValue, x => x.DoorStart >= start && x.DoorEnd <= end)
.WhereIF(search.IsPresent(), x => x.Name.Contains(search) || x.No == search || x.IdNo == search)
.Select(x => new AppointmentDetailResponse
{