From f569a16f60d3139ea672260f0e9bf9070e6d6f2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9F=B3=E6=96=87=E7=BF=94?= <878130837@qq.com>
Date: Sat, 2 Mar 2024 10:44:24 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=80=89=E4=B8=AD=E9=A1=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/SJZY.Track.Domain/Dtos/Common/KeywordsInputVO.cs | 2 +-
.../Dtos/TrackTemplate/GetTrackTemplateContentPageInputVO.cs | 5 +++++
.../Repositories/TrackTemplateRepository.cs | 3 ++-
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/SJZY.Track.Domain/Dtos/Common/KeywordsInputVO.cs b/src/SJZY.Track.Domain/Dtos/Common/KeywordsInputVO.cs
index f46e3c41..8cbe4413 100644
--- a/src/SJZY.Track.Domain/Dtos/Common/KeywordsInputVO.cs
+++ b/src/SJZY.Track.Domain/Dtos/Common/KeywordsInputVO.cs
@@ -15,5 +15,5 @@ public class KeywordsInputVO : PageInfoInput
///
/// 选中项
///
- public List? SelectedId { get; set; }
+ public List? SelectedIds { get; set; }
}
\ No newline at end of file
diff --git a/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetTrackTemplateContentPageInputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetTrackTemplateContentPageInputVO.cs
index 09e8f51f..14b1f0ee 100644
--- a/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetTrackTemplateContentPageInputVO.cs
+++ b/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetTrackTemplateContentPageInputVO.cs
@@ -6,4 +6,9 @@ public class GetTrackTemplateContentPageInputVO : PageInfoInput
/// 轨迹模板id
///
public List TrackTemplateIds { get; set; }
+
+ ///
+ /// 选中项
+ ///
+ public List? SelectedIds { get; set; }
}
\ No newline at end of file
diff --git a/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs
index 21eef31e..0bcc56c2 100644
--- a/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs
+++ b/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs
@@ -85,7 +85,8 @@ public class TrackTemplateRepository : BasicRepository, ITr
templateContent.UpdateUserId == updateUser.Id && !updateUser.IsDeleted)
.Filter(null, true)
.Where(templateContent => input.TrackTemplateIds.Contains(templateContent.TrackTemplateId) && !templateContent.IsDeleted)
- .OrderByDescending(templateContent => templateContent.CreateTime)
+ .OrderByIF(input.SelectedIds.IsNullOrEmpty(), templateContent => templateContent.CreateTime, OrderByType.Desc)
+ .OrderByIF(!input.SelectedIds.IsNullOrEmpty(), templateContent => SqlFunc.IIF(input.SelectedIds.Contains(templateContent.TrackContentId), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), templateContent.CreateTime), OrderByType.Desc)
.Select((templateContent, trackContent, trackStatus, enumValue, trackFlag, createUser, updateUser) =>
new GetTrackTemplateContentPageOutputVO
{