From 29fbc093a31bd156e27344a57a664d353cfa354e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E9=BE=99=20=E7=8E=8B?= Date: Tue, 3 Dec 2024 15:50:23 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E8=8E=B7=E5=8F=96=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=8C=E5=A2=9E=E5=8A=A0=E3=80=90TemplateC?= =?UTF-8?q?ode=E3=80=91=E8=BD=A8=E8=BF=B9=E6=A8=A1=E6=9D=BF=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=8F=82=E6=95=B0=E5=8F=82=E4=B8=8E=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/ProvideServices/GetTrackTemplateListInput.cs | 5 +++++ .../Dtos/TrackTemplate/GetTrackTemplateListInputVo.cs | 5 +++++ .../Repositories/TrackTemplateRepository.cs | 7 +++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetTrackTemplateListInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetTrackTemplateListInput.cs index 269a1a0e..e1c04282 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetTrackTemplateListInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetTrackTemplateListInput.cs @@ -16,4 +16,9 @@ public class GetTrackTemplateListInput /// 模版分类 /// public int? TemplateType { get; set; } + + /// + /// 模板code + /// + public string? TemplateCode { get; set; } } diff --git a/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetTrackTemplateListInputVo.cs b/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetTrackTemplateListInputVo.cs index 7e0abd82..a2f111a7 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetTrackTemplateListInputVo.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackTemplate/GetTrackTemplateListInputVo.cs @@ -16,4 +16,9 @@ public class GetTrackTemplateListInputVo /// 模版分类 /// public int? TemplateType { get; set; } + + /// + /// 模板code + /// + public string? TemplateCode { get; set; } } diff --git a/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs index 9f28d8fc..24bdc7ea 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackTemplateRepository.cs @@ -191,6 +191,7 @@ public class TrackTemplateRepository : BasicRepository, ITr .Where(x => x.SubSystemId == input.SubSystemId) .WhereIF(input.CustomerId.HasValue, x => x.CustomerId == input.CustomerId) .WhereIF(input.TemplateType.HasValue, x => x.CategoryId == input.TemplateType) + .WhereIF(!input.TemplateCode.IsNullOrWhiteSpace(), x => x.Code == input.TemplateCode) .Select(x => new TrackTemplateOutputVo { Id = x.Id, @@ -229,7 +230,6 @@ public class TrackTemplateRepository : BasicRepository, ITr public async Task> GetContentByTemplateCodes(string[] codes, int systemId) { - var sql = @$" select distinct @@ -244,7 +244,10 @@ public class TrackTemplateRepository : BasicRepository, ITr "; - var list = Context.Ado.SqlQuery(sql, new {codes = codes}).ToList(); + var list = Context.Ado.SqlQuery(sql, new + { + codes = codes + }).ToList(); return list; }