using Model;
using Model.Entity;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Service.Interface
{
    /// <summary>
    /// 监测数值记录服务接口
    /// </summary>
    public interface IMonitorValueService : IBaseService<MonitorValueEntity>
    {
        /// <summary>
        /// 批量插入监测数据（工控高频采样推荐使用，性能远高于单条循环插入）
        /// </summary>
        /// <param name="entities">实体集合</param>
        /// <returns>返回操作是否成功的 Result</returns>
        Task<Result<bool>> InsertRangeAsync(List<MonitorValueEntity> entities);

        /// <summary>
        /// 根据监测通道名称，分页查询历史记录
        /// </summary>
        /// <param name="monitorName">通道名称（例如：台架1.读取主轴温度）</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">每页大小</param>
        /// <param name="total">总条数输出</param>
        /// <returns>分页数据结果</returns>
        Task<Result<List<MonitorValueEntity>>> GetPagedByNameAsync(string monitorName, int pageIndex, int pageSize, RefAsync<int> total);
    }
}