轨迹模版查询
This commit is contained in:
parent
c5b6d5e444
commit
333862e8f9
@ -8,6 +8,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SJZY.Track.Domain.TrackTemplateAggregate;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
using Volo.Abp.ObjectMapping;
|
||||
|
||||
|
||||
@ -0,0 +1,58 @@
|
||||
using SJZY.Track.Repository.TrackTemplate.Entitys;
|
||||
using SJZY.Track.Repository.TrackTemplate.ValueObjects;
|
||||
using SJZY.Track.Repository.VData.Entitys;
|
||||
|
||||
namespace SJZY.Track.Repository.TrackTemplate.Services
|
||||
{
|
||||
public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITrackTemplateRepository, IScopedDependency
|
||||
{
|
||||
public TrackTemplateRepository()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取轨迹模版明细
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<GetTrackTemplateDetailVO> GetDetailAsync(int id)
|
||||
{
|
||||
var detail = await Context.Queryable<TrackTemplateEntity>().LeftJoin<VSystemEntity>((a, b) => a.SubSystemId==b.Id)
|
||||
.Where((a, b) => a.Id==id)
|
||||
.Select((a, b) => new
|
||||
GetTrackTemplateDetailVO
|
||||
{
|
||||
Id = a.Id,
|
||||
Code = a.Code,
|
||||
Name = a.Name,
|
||||
SubSystemId = a.SubSystemId,
|
||||
SubSystem=b.CnName
|
||||
}).FirstAsync();
|
||||
|
||||
return detail;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 分页获取轨迹模版
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<UnifyPageResultDto<GetTrackTemplateListVO>> GetPageTrackTemplate(GetPageTrackTemplateVO input)
|
||||
{
|
||||
var pagedList = await Context.Queryable<TrackTemplateEntity>().LeftJoin<VSystemEntity>((a, b) => a.SubSystemId==b.Id)
|
||||
.WhereIF(input.SubSystemId>0, (a, b) => a.SubSystemId==input.SubSystemId)
|
||||
.WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (a, b) => a.Name.Contains(input.Keywords)|| a.Code.Contains(input.Keywords))
|
||||
.Select((a, b) => new GetTrackTemplateListVO
|
||||
{
|
||||
Id=a.Id,
|
||||
Code=a.Code,
|
||||
CreateTime= a.CreateTime,
|
||||
Name = a.Name,
|
||||
SubSystem = b.CnName
|
||||
})
|
||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||
return pagedList;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user