32 lines
994 B
C#
32 lines
994 B
C#
using Dlhis.Common.Request;
|
|
using Dlhis.Common.Response;
|
|
using Dlhis.Entity.Basic.Entity;
|
|
using Kurisu.AspNetCore.Utils.Extensions;
|
|
using Kurisu.Core.DataAccess.Dto;
|
|
using Kurisu.SqlSugar.Extensions;
|
|
using Kurisu.SqlSugar.Services;
|
|
|
|
namespace Dlhis.Common.Services.Implements
|
|
{
|
|
public class MealSupplementRecordService : IMealSupplementRecordService
|
|
{
|
|
|
|
private readonly IDbContext _dbContext;
|
|
|
|
public MealSupplementRecordService(IDbContext dbContext)
|
|
{
|
|
_dbContext = dbContext;
|
|
}
|
|
|
|
public async Task<Pagination<MealSupplementRecordResponse>> MealSupplementRecordPageAsync(MealSupplementRecordRequest request)
|
|
{
|
|
var page = await _dbContext.Queryable<MealSupplementRecordEntity>()
|
|
.WhereIF(request.Search.IsPresent(), x => x.Code.Contains(request.Search))
|
|
.Select<MealSupplementRecordResponse>()
|
|
.ToPageListAsync(request);
|
|
|
|
return page;
|
|
}
|
|
}
|
|
}
|