using SSWMS.Common;
using System.Collections;
using System.Collections.Generic;

namespace SSWMS.Server
{
    public class P_IO_CONTROL : P_Base_House<IO_CONTROL>
    {
        public IO_CONTROL GetModelByManageID(int iManageID)
        {
            return this._sqlMap.QueryForObject<IO_CONTROL>("IO_CONTROL_SELECT_BY_MANAGE_ID", iManageID);
        }

        public IList<IO_CONTROL> GetListByStatus(int iControlStatus)
        {
            return this._sqlMap.QueryForList<IO_CONTROL>("IO_CONTROL_SELECT_BY_STATUS", iControlStatus);
        }

        public IList<IO_CONTROL> GetListByDeviceCode(string sStartDeviceCode, string sEndDeviceCode)
        {
            return this._sqlMap.QueryForList<IO_CONTROL>("IO_CONTROL_SELECT_BY_DEVICE_CODE", new Hashtable()
            {
                { "START_DEVICE_CODE", sStartDeviceCode },
                { "END_DEVICE_CODE", sEndDeviceCode }
            });
        }

        public int DeleteByManageID(int iManageID)
        {
            return this._sqlMap.Delete("IO_CONTROL_DELETE_BY_MANAGE_ID", iManageID);
        }
    }
}