update: 获取模板列表,增加【TemplateCode】轨迹模板代码参数参与过滤查询

This commit is contained in:
云龙 王 2024-12-03 15:50:23 +08:00
parent b6df543f0c
commit 29fbc093a3
3 changed files with 15 additions and 2 deletions

View File

@ -16,4 +16,9 @@ public class GetTrackTemplateListInput
/// 模版分类
/// </summary>
public int? TemplateType { get; set; }
/// <summary>
/// 模板code
/// </summary>
public string? TemplateCode { get; set; }
}

View File

@ -16,4 +16,9 @@ public class GetTrackTemplateListInputVo
/// 模版分类
/// </summary>
public int? TemplateType { get; set; }
/// <summary>
/// 模板code
/// </summary>
public string? TemplateCode { get; set; }
}

View File

@ -191,6 +191,7 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, 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<TrackTemplateEntity>, ITr
public async Task<List<string>> GetContentByTemplateCodes(string[] codes, int systemId)
{
var sql = @$"
select
distinct
@ -244,7 +244,10 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
";
var list = Context.Ado.SqlQuery<string>(sql, new {codes = codes}).ToList();
var list = Context.Ado.SqlQuery<string>(sql, new
{
codes = codes
}).ToList();
return list;
}