using com.hnshituo.core.webapp.vo;
using System.Collections.Generic;

namespace Common
{
    public class meterworkzeroalarmservice
    {
        /// <summary>
        /// 数据查询，平台默认方法
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<List<MeterWorkZeroAlarm>> doQuery(MeterWorkZeroAlarm info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<PageList<List<MeterWorkZeroAlarm>>> rm = db.doOption<PageList<List<MeterWorkZeroAlarm>>>("meterworkzeroalarms", "/", new object[] { info }, 0);

            RESTfulResult<List<MeterWorkZeroAlarm>> result = new RESTfulResult<List<MeterWorkZeroAlarm>>();
            result.Succeed = rm.Succeed;
            result.Status = rm.Status;
            result.Message = rm.Message;
            result.ResultMessage = rm.ResultMessage;
            result.Code = rm.Code;
            if (rm.Data != null && rm.Data.list != null && rm.Data.list.Count > 0)
            {
                result.Data = rm.Data.list;
            }
            return result;
        }

        /// <summary>
        /// 新增零点报警的数据
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<string> doInsertZeroAlarm(MeterWorkZeroAlarm info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<string> rm = db.doOption<string>("meterworkzeroalarms", "doInsertZeroAlarm", new object[] { info }, 1);
            return rm;
        }

        /// <summary>
        /// 更新零点报警的数据
        /// </summary>
        /// <param name="lt"></param>
        /// <returns></returns>
        public RESTfulResult<string> doUpdateWf(List<MeterWorkZeroAlarm> lt)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<string> rm = db.doOption<string>("meterworkzeroalarms", "doUpdateWf", new object[] { lt }, 1);
            return rm;
        }
    }
}