You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.5 KiB

using Entity.Ammeter;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Entity;
using Repository;
using Repository.Ammeter;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Service.Ammeter
{
[Scope("SingleInstance")]
public class EmeterMinutesEnergyChangeService : BaseServices<EmeterMinutesEnergyChange>
{
EmeterMinutesEnergyChangeRepository _emeterMinutesEnergyChangeRepository;
public EmeterMinutesEnergyChangeService(EmeterMinutesEnergyChangeRepository emeterMinutesEnergyChangeRepository)
{
this.BaseDal = emeterMinutesEnergyChangeRepository;
_emeterMinutesEnergyChangeRepository = emeterMinutesEnergyChangeRepository;
}
public async Task<PageResult<EmeterMinutesEnergyChange>> Page(AmmeterQueryPageModel queryPageModel)
{
QueryPageModel queryPageModel1 = new QueryPageModel
{
Page = queryPageModel.Page,
PageSize = queryPageModel.PageSize,
};
if (!string.IsNullOrEmpty(queryPageModel.Code))
return PageResult<EmeterMinutesEnergyChange>.ConvertPage(_emeterMinutesEnergyChangeRepository.QueryIPageByCause(queryPageModel1, u => u.Code == queryPageModel.Code));
else
return PageResult<EmeterMinutesEnergyChange>.ConvertPage(_emeterMinutesEnergyChangeRepository.QueryIPageByCause(queryPageModel1, null));
}
}
}