This commit is contained in:
2025-06-09 10:47:15 +08:00
parent e69dca6180
commit 83c5219f5b

View File

@@ -14,6 +14,7 @@ using Kurisu.AspNetCore.Utils.Extensions;
using Mapster; using Mapster;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using SqlSugar;
namespace Dlhis.Basic.Device.Services.Implements; namespace Dlhis.Basic.Device.Services.Implements;
@@ -41,7 +42,7 @@ public class DeviceService : IDeviceService
.Where((d, dt) => d.Type == request.Type) .Where((d, dt) => d.Type == request.Type)
.WhereIF(request.Enable.HasValue, (d, dt) => d.Enable == request.Enable) .WhereIF(request.Enable.HasValue, (d, dt) => d.Enable == request.Enable)
.WhereIF(request.Search.IsPresent(), d => d.UniqueNo == request.Search || d.DeployPlace.Contains(request.Search)) .WhereIF(request.Search.IsPresent(), d => d.UniqueNo == request.Search || d.DeployPlace.Contains(request.Search))
.WhereIF(request.Supplier.IsPresent(), d => d.Supplier.Contains(request.Search)) .WhereIF(request.Supplier.IsPresent(), d => !SqlFunc.IsNullOrEmpty(request.Search) && d.Supplier.Contains(request.Supplier))
.Select((d, dt, dr, bp) => new DevicePageResponse .Select((d, dt, dr, bp) => new DevicePageResponse
{ {
FuncsStr = d.Funcs.ToString(), FuncsStr = d.Funcs.ToString(),