From bb7f59a301a390e04443fa4745bd2afa1fa58e0f Mon Sep 17 00:00:00 2001
From: qiuyao <qiuyao@hnkhzn.com>
Date: 星期一, 28 四月 2025 16:38:30 +0800
Subject: [PATCH] 人脸识别离线SDK

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceTeamService.cs |   40 ++++++++++++++++++++++++++++++++++------
 1 files changed, 34 insertions(+), 6 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceTeamService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceTeamService.cs"
index ea14d42..44f9d69 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceTeamService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TelescopicService/MaintenanceTeamService.cs"
@@ -1,8 +1,10 @@
-锘縰sing System;
+锘縰sing SqlSugar;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEAWCS_Core;
 using WIDESEAWCS_Core.BaseRepository;
 using WIDESEAWCS_Core.BaseServices;
 using WIDESEAWCS_DTO.Telescopic;
@@ -13,15 +15,14 @@
     public class MaintenanceTeamService : ServiceBase<Dt_MaintenanceTeam, IRepository<Dt_MaintenanceTeam>>, IMaintenanceTeamService
     {
         public IRepository<Dt_MaintenanceTeam> Repository => BaseDal;
+        private readonly IRepository<Sys_User> _user;
 
-        public MaintenanceTeamService(IRepository<Dt_MaintenanceTeam> BaseDal) : base(BaseDal)
+        public MaintenanceTeamService(IRepository<Dt_MaintenanceTeam> BaseDal,IRepository<Sys_User> user) : base(BaseDal)
         {
-
+            _user = user;
         }
 
 
-<<<<<<< Updated upstream
-=======
         /// <summary>
         /// 妫�淇缃褰�
         /// </summary>
@@ -36,6 +37,8 @@
                 var sys = _user.Db.Queryable<Sys_User>();
                 var main = Db.Queryable<Dt_MaintenanceTeam>();
 
+
+                //妯$硦鏌ヨ
                 var query = sys.InnerJoin<Dt_MaintenanceTeam>((a, b) => a.UserTrueName == b.OperatorName);
                 if (!string .IsNullOrEmpty(pagination.searchKeyword))
                 {
@@ -46,10 +49,36 @@
                        b.Modifier.Contains(pagination.searchKeyword)
                    );
                 }
+                //鏃堕棿鏌ヨ
                 if (pagination.startDate.HasValue&&pagination.endDate.HasValue)
                 {
                     query = query.Where((a, b) => b.DistributionTime >= pagination.startDate && b.DistributionTime <= pagination.endDate);
                 }
+                //鎺掑簭
+                if (!string.IsNullOrEmpty(pagination.sortField))
+                {
+                    var isAsc = pagination.sortOrder?.ToLower() == "asc";
+                    query = pagination.sortField.ToLower() switch
+                    {
+                        //"OperatorName" => isAsc ? query.OrderBy((a, b) => b.OperatorName) : query.OrderByDescending((a, b) => b.OperatorName),
+
+                        //"TeamName" => isAsc ? query.OrderBy((a, b) => b.TeamName) : query.OrderByDescending((a, b) => b.TeamName),
+
+                        "distributiontime" => isAsc ? query.OrderBy((a, b) => b.DistributionTime) : query.OrderByDescending((a, b) => b.DistributionTime),
+
+                        //"Modifier" => isAsc ? query.OrderBy((a, b) => b.Modifier) : query.OrderByDescending((a, b) => b.Modifier),
+
+                        _ => query.OrderByDescending((a, b) => b.Creater), // 榛樿鎸夊垱寤烘椂闂撮檷搴�
+                    };
+
+                }
+                else
+                {
+                    //榛樿鎸夊垱寤烘椂闂撮檷搴忔帓搴�
+                    query = query.OrderByDescending((a, b) => b.Creater);
+                }
+
+                //杩斿洖缁撴灉
                 var result=query
                 .Select((a, b) => new
                 {
@@ -81,6 +110,5 @@
 
         }
 
->>>>>>> Stashed changes
     }
 }

--
Gitblit v1.9.3