|
|
@@ -0,0 +1,50 @@ |
|
|
|
using BPA.SAAS.Manage.Application.Device.Dtos.Device; |
|
|
|
using BPA.SAAS.Manage.Application.Device.Interface; |
|
|
|
using BPA.SAAS.Manage.Core.Base; |
|
|
|
using BPA.SAAS.Manage.Core.Device; |
|
|
|
using BPA.SAAS.Manage.Core.Product; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Text; |
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
namespace BPA.SAAS.Manage.Application.Device.Services |
|
|
|
{ |
|
|
|
public class TechnologyService : ITechnologyService, ITransient |
|
|
|
{ |
|
|
|
private readonly ISqlSugarClient _db; |
|
|
|
public TechnologyService(ISqlSugarClient db) |
|
|
|
{ |
|
|
|
_db=db; |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 分页查询 |
|
|
|
/// </summary> |
|
|
|
/// <param name="inputDto"></param> |
|
|
|
/// <returns></returns> |
|
|
|
public async Task<PageUtil> GetTechnologyPage(TechnologyQueryInputDto inputDto) |
|
|
|
{ |
|
|
|
var total = new RefAsync<int>(); |
|
|
|
var data = await _db.Queryable<BPA_ProductVesion,BPA_Technology, BPA_Product>((a, b,c) => new JoinQueryInfos( |
|
|
|
JoinType.Left, a.Id == b.DeviceVersionId, |
|
|
|
JoinType.Left, a.ProductId == c.Id |
|
|
|
)).Select((a, b, c) => new |
|
|
|
{ |
|
|
|
Id=b.Id, |
|
|
|
Vesion=a.Vesion, |
|
|
|
ProductName=c.Name, |
|
|
|
CreateAt=b.CreateAt, |
|
|
|
}) |
|
|
|
.OrderBy(x => x.CreateAt, OrderByType.Desc) |
|
|
|
.ToPageListAsync(inputDto.Current, inputDto.PageSize, total); |
|
|
|
|
|
|
|
return new PageUtil() |
|
|
|
{ |
|
|
|
Data = data, |
|
|
|
Total = total |
|
|
|
|
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
} |