using Masuit.Tools.Models;
using Masuit.Tools;
using PVDEMCS.Common;
using PVDEMCS.Common.DI;
using PVDEMCS.Services.Repositories.Entities;
using PVDEMCS.Services.Models;

namespace PVDEMCS.Services.Repositories
{
    /// <summary>
    /// PLC控制器 数据层 接口
    /// </summary>
    public interface IDeviceRepository : IDependency
    {
        #region PLC控制器

        /// <summary>
        /// 获取PLC控制器分页列表
        /// </summary>
        /// <param name="deviceCode">控制器编号</param>
        /// <param name="deviceName">控制器名称</param>
        /// <param name="activated">是否启用</param>
        /// <param name="page">当前页</param>
        /// <param name="size">页大小</param>
        /// <returns></returns>
        Result<PagedList<DeviceInfo>> GetDevicePageList(string deviceCode, string deviceName, bool? activated, int page, int size);

        /// <summary>
        /// 获取PLC控制器列表
        /// </summary>
        /// <param name="deviceCode">控制器编号</param>
        /// <param name="deviceName">控制器名称</param>
        /// <param name="activated">是否启用</param>
        /// <returns></returns>
        Result<List<DeviceInfo>> GetDeviceInfoList(string deviceCode, string deviceName, bool? activated = false);

        /// <summary>
        /// 获取PLC控制器明细
        /// </summary>
        /// <param name="id">主键Id</param>
        /// <returns></returns>
        Result<DeviceInfoEntity> GetDeviceDetail(string id);

        /// <summary>
        /// 添加PLC控制器
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Result<string> AddDevice(DeviceInfoEntity entity);

        /// <summary>
        /// 更新PLC控制器
        /// </summary>
        /// <param name="entity"></param>

        Result UpdateDevice(DeviceInfoEntity entity);
        /// <summary>
        /// 删除PLC控制器
        /// </summary>
        /// <param name="id"></param>
        Result DeleteDevice(string id);

        #endregion

        #region PLC点位

        /// <summary>
        /// 获取PLC控制器点位分页列表
        /// </summary>
        /// <param name="deviceId">控制器Id</param>
        /// <param name="deviceCode">控制器编号</param>
        /// <param name="deviceName">控制器名称</param>
        /// <param name="equipmentName">设备名称</param>
        /// <param name="equipmentCode">设备编号</param>
        /// <param name="equipmentType">设备类型</param>
        /// <param name="pointCode">点位编号</param>
        /// <param name="pointName">点位列表</param>
        /// <param name="activated">是否启用</param>
        /// <param name="page">当前页</param>
        /// <param name="size">页大小</param>
        /// <returns></returns>
        Result<PagedList<DevicePoint>> GetDevicePointPageList(string deviceId, string deviceName, string deviceCode, string equipmentName, string equipmentCode, string equipmentType, string pointCode, string pointName, bool? activated, int page, int size);

        /// <summary>
        /// 获取PLC控制器点位列表
        /// </summary>
        /// <param name="deviceId">控制器Id</param>
        /// <param name="deviceCode">控制器编号</param>
        /// <param name="deviceName">控制器名称</param>
        /// <param name="equipmentName">设备名称</param>
        /// <param name="equipmentCode">设备编号</param>
        /// <param name="equipmentType">设备类型</param>
        /// <param name="pointCode">点位编号</param>
        /// <param name="pointName">点位列表</param>
        /// <param name="activated">是否启用</param>
        /// <returns></returns>
        Result<List<DevicePoint>> GetDevicePointList(string deviceId, string deviceName, string deviceCode, string equipmentName, string equipmentCode, string equipmentType, string pointCode, string pointName, bool? activated);

        /// <summary>
        /// 获取PLC控制器点位明细
        /// </summary>
        /// <param name="id">Id</param>
        /// <returns></returns>
        Result<DevicePointEntity> GetDevicePointDetail(string id);

        /// <summary>
        /// 添加PLC控制器点位
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Result<string> AddDevicePoint(DevicePointEntity entity);

        /// <summary>
        /// 更新PLC控制器点位
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Result UpdateDevicePoint(DevicePointEntity entity);

        /// <summary>
        /// 删除PLC控制器点位
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Result DeleteDevicePoint(string id);

        #endregion
    }
}
