using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using Domain;
using CommonEntity;

namespace Dao
{
    public interface IHostRepository : IRepository<Host>
    {
        IList<HostMappingData> LoadAllID_HostNumberMapping();
        IList<HostRoomNumberMapping> LoadAll_RoomNumberMapping();
        IList<Host> LoadAll(string order, string sort, IList<Group> groups, string roomNumber);

        IList<Host> LoadAll(IList<Group> groupList);

        IList<Host> LoadAll(int hotelID, string roomNumber = "");

        IList<Host> LoadAll(IList<Group> groupList, RoomStatus roomStatus, RoomType roomType);

        IQueryable<Host> LoadAllByPage(out long total, int page, int rows, string order, string sort, int groupId, int hotelID, string roomNumber, string mac, string roomType, int isSyncRoomNumber);

        DataTable LoadHostWithPage(out long total, int page, int rows, string order, string sort, int groupId, int hotelID, string roomNumber, string mac, string roomType);

        IList<Room> LoadRooms(out long total, int page, int rows, int? groupId, int lang, int hotelID);

        IList<Host> GetByHotelCode(string hotelcode);
        Host GetByHostNumber(string hostNumber, string code = "");

        //Host GetByRoomNumber(string roomNumber, string code);

        Host GetByMAC(string mac, int hotelID);
        /// <summary>
        /// 通过mac地址获取主机列表（只限C系列主机）
        /// </summary>
        /// <param name="mac"></param>
        /// <returns></returns>
        IList<Host> LoadByMac(string mac);

        Host GetByXiaoDuCUID(string cuid);

        Host GetByTianMaoCUID(string cuid);

        Host GetByTCLCUID(string cuid);

        Host GetByHuaWeiCUID(string cuid);
        Host GetByHiWeiCUID(string cuid);

        //Host GetByIP(string ip);

        IList<Host> GetByGroup(Group group);

        DataTable LoadRoomNumbers(Group group, int hotelID);

        /// <summary>
        /// 获取主机总数
        /// </summary>
        /// <returns></returns>
        int GetHostsCount();

        /// <summary>
        /// 返回与指定 host 连通的 Host，结果中不包含指定的host。
        /// </summary>
        /// <param name="host"></param>
        /// <returns></returns>
        //IList<Host> GetConnectRoomHosts(Host host);

        /// <summary>
        /// 设置主机基本信息（房态更新命令）
        /// </summary>
        /// <param name="host"></param>
        void SetHostInfo(Host host);
        /// <summary>
        /// 设置房卡：插卡同时插入新记录，拔卡同时更新拔卡时间
        /// </summary>
        /// <param name="host">主机</param>
        /// <param name="roomCard">房卡</param>
        void SetRoomCard(Host host, RoomCard roomCard);

        /// <summary>
        /// 设置主机温度
        /// </summary>
        /// <param name="host">主机</param>
        /// <param name="hostTemp">主机温度</param>
        void SetHostTemp(Host host, int hostTemp);

        /// <summary>
        /// 设置主机bool字段内容
        /// </summary>
        /// <param name="hostID"></param>
        /// <param name="field"></param>
        /// <param name="value"></param>
        void SetHostByField(int hostID, string field, bool value);
        /// <summary>
        /// 设置门锁状态
        /// </summary>
        /// <param name="host">主机</param>
        /// <param name="doorLockStatus">True/开，False/关</param>
        void SetDoorLockStatus(Host host, bool doorLockStatus);
        /// <summary>
        /// 设置微信锁
        /// </summary>
        /// <param name="host"></param>
        /// <param name="lockStatus"></param>
        void SetLockStatus(Host host, int lockStatus);

        /// <summary>
        /// 设置保险箱状态
        /// </summary>
        /// <param name="host">主机</param>
        /// <param name="safeBoxStatus">保险箱：0关，1开，2未接保险箱</param>
        void SetSafeBoxStatus(Host host, int safeBoxStatus);
        /// <summary>
        /// 设置是否已发布
        /// </summary>
        /// <param name="host"></param>
        /// <param name="isPublish"></param>
        void SetPublish(Host host, bool isPublish);

        /// <summary>
        /// 设置当前温度
        /// </summary>
        /// <param name="host">主机</param>
        /// <param name="currentTemp">当前温度</param>
        //void SetCurrentTemp(Host host, int currentTemp);

        /// <summary>
        /// 设置设定温度
        /// </summary>
        /// <param name="host">主机</param>
        /// <param name="settingTemp">设定温度</param>
        //void SetSettingTemp(Host host, int settingTemp);

        /// <summary>
        /// 设置风速
        /// </summary>
        /// <param name="host">主机</param>
        /// <param name="speed">风速</param>
        //void SetSpeed(Host host, int speed);

        /// <summary>
        /// 根据房型获取主机列表（C主机升级使用）
        /// </summary>
        /// <param name="hotelID"></param>
        /// <param name="roomTypeID"></param>
        /// <returns></returns>
        IList<Object> LoadHostByRoomType(int hotelID, int roomTypeID);
        /// <summary>
        /// 根据房型获取所有主机列表
        /// </summary>
        /// <param name="hotelID"></param>
        /// <param name="roomTypeID"></param>
        /// <returns></returns>
        IList<Object> LoadAllHostByRoomType(int hotelID, int roomTypeID);

        /// <summary>
        /// 新添加的
        /// </summary>
        /// <param name="hotelID"></param>
        /// <param name="roomTypeID"></param>
        /// <returns></returns>
        IList<Object> LoadHostByRoomTypeChengZiHao(int hotelID, int roomTypeID, string roomNumber);
        /// <summary>
        /// 设置升级状态
        /// </summary>
        /// <param name="host"></param>
        /// <param name="upgradeStatus"></param>
        void SetUpgradeStatus(Host host, int upgradeStatus, bool isReseet = false);
        /// <summary>
        /// 设置Model和Launcher
        /// </summary>
        /// <param name="host"></param>
        /// <param name="model"></param>
        /// <param name="launcher"></param>
        void SetModelAndLauncher(Host host,string ConfigVersion,string software_version, string lanIP, int lanPort, string model, string launcher, DateTime expireTime, DateTime setExpireTime);
    }
}
