update: 获取模板列表,增加【TemplateCode】轨迹模板代码参数参与过滤查询
This commit is contained in:
parent
b6df543f0c
commit
29fbc093a3
@ -16,4 +16,9 @@ public class GetTrackTemplateListInput
|
|||||||
/// 模版分类
|
/// 模版分类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? TemplateType { get; set; }
|
public int? TemplateType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 模板code
|
||||||
|
/// </summary>
|
||||||
|
public string? TemplateCode { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,4 +16,9 @@ public class GetTrackTemplateListInputVo
|
|||||||
/// 模版分类
|
/// 模版分类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? TemplateType { get; set; }
|
public int? TemplateType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 模板code
|
||||||
|
/// </summary>
|
||||||
|
public string? TemplateCode { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -191,6 +191,7 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
|||||||
.Where(x => x.SubSystemId == input.SubSystemId)
|
.Where(x => x.SubSystemId == input.SubSystemId)
|
||||||
.WhereIF(input.CustomerId.HasValue, x => x.CustomerId == input.CustomerId)
|
.WhereIF(input.CustomerId.HasValue, x => x.CustomerId == input.CustomerId)
|
||||||
.WhereIF(input.TemplateType.HasValue, x => x.CategoryId == input.TemplateType)
|
.WhereIF(input.TemplateType.HasValue, x => x.CategoryId == input.TemplateType)
|
||||||
|
.WhereIF(!input.TemplateCode.IsNullOrWhiteSpace(), x => x.Code == input.TemplateCode)
|
||||||
.Select(x => new TrackTemplateOutputVo
|
.Select(x => new TrackTemplateOutputVo
|
||||||
{
|
{
|
||||||
Id = x.Id,
|
Id = x.Id,
|
||||||
@ -229,7 +230,6 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
|||||||
|
|
||||||
public async Task<List<string>> GetContentByTemplateCodes(string[] codes, int systemId)
|
public async Task<List<string>> GetContentByTemplateCodes(string[] codes, int systemId)
|
||||||
{
|
{
|
||||||
|
|
||||||
var sql = @$"
|
var sql = @$"
|
||||||
select
|
select
|
||||||
distinct
|
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;
|
return list;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user