using Entity.Ammeter;
using Entity.Dto.Req;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Entity;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Repository.Ammeter;
namespace Service.Ammeter
{
///
///
///
[Scope("SingleInstance")]
public class EmeterHourEnergyService: BaseServices
{
public EmeterHourEnergyService(EmeterHourEnergyRepository service)
{
this.BaseDal = service;
}
public async Task>> Page(PageAmmeterReq queryPageModel)
{
QueryPageModel queryPageModel1 = new QueryPageModel
{
PageNum = queryPageModel.PageNum,
PageSize = queryPageModel.PageSize,
};
if (!string.IsNullOrEmpty(queryPageModel.Code))
return Result>.Success(PageResult.ConvertPage(this.BaseDal.QueryIPageByCause(queryPageModel1, u => u.Code == queryPageModel.Code)));
else
return Result>.Success(PageResult.ConvertPage(this.BaseDal.QueryIPageByCause(queryPageModel1, null)));
}
}
}