Files
jinko.yikatong/Src/Dlhis.Common/Services/Implements/MealSupplementRecordService.cs
2024-03-20 15:27:37 +08:00

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;
}
}
}