From cb1ef1db082328f1273cff45ce8d0208f2c50c8e Mon Sep 17 00:00:00 2001 From: lihanbo Date: Fri, 18 Oct 2024 11:33:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E7=89=88=E6=9C=AC=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Repository/VersionManagementRepo.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/LFlow.VersionManagement/Repository/VersionManagementRepo.cs b/LFlow.VersionManagement/Repository/VersionManagementRepo.cs index 818baad..0e838dc 100644 --- a/LFlow.VersionManagement/Repository/VersionManagementRepo.cs +++ b/LFlow.VersionManagement/Repository/VersionManagementRepo.cs @@ -1,5 +1,6 @@ using LFlow.Base.Default; using LFlow.Base.Utils; +using LFlow.VersionManagement.Enums; using LFlow.VersionManagement.Model; using SqlSugar; @@ -20,4 +21,14 @@ public class VersionManagementRepo(ISqlSugarClient db) : DefaultCurdRepo x.ID) .ToList(); } + + public VersionModel GetLatestVersion(VersionType type, VersionChannel channel, UpgradeTargetType targetType) + { + return db.Queryable() + .Where(mt => type == mt.VersionType && channel == mt.VersionChannel && targetType == mt.UpgradeTargetType) + .GroupBy(mt => mt.CurrentVersion) + .OrderBy(mt => mt.LastPublishTime, OrderByType.Desc) + .First(); + + } }