20230201_145_upperpc/InSituLaboratory.Service/Sensor/MEMSSPService.cs

49 lines
1.6 KiB
C#
Raw Normal View History

using InSituLaboratory.Entities.ExperimentalStationEntities;
using InSituLaboratory.Entities.Sensor;
using InSituLaboratory.Entities.SysData;
using InSituLaboratory.IService;
using InSituLaboratory.IService.Sensor;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace InSituLaboratory.Service.Sensor
{
/// <summary>
/// MEMS色谱仪服务层
/// </summary>
public class MEMSSPService : BaseService, IMEMSSPService
{
public MEMSSPService(DbContext context) : base(context) { }
/// <summary>
/// 获取MEMS色谱仪数据
/// </summary>
/// <returns></returns>
public IEnumerable<MEMSSpModel> GetMEMSSP()
{
return this.Query<MEMSSpModel>(m => true).OrderByDescending(n => n.CreateTime).AsNoTracking();
}
/// <summary>
/// 获取MEMS色谱仪数据
/// </summary>
/// <param name="key"></param>
/// <param name="pageSize"></param>
/// <param name="pageIndex"></param>
/// <param name="totalCount"></param>
/// <returns></returns>
public IEnumerable<MEMSSpModel> GetMemsSPData(string key, int pageSize, int pageIndex, out int totalCount)
{
var pResult = this.QueryPage<MEMSSpModel, string>(m => string.IsNullOrEmpty(key) || m.SamplingTime.ToString().Contains(key), pageSize, pageIndex, order => order.SamplingTime.ToString(), true);
totalCount = pResult.TotalCount;
return pResult.DataList;
}
}
}