using com.hnshituo.core.webapp.vo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common
{
    public class MeterBaseOperationLogService
    {
          public RESTfulResult<List<MeterBaseOperationLog>> doQueryWf(MeterBaseOperationLog info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<PageList<List<MeterBaseOperationLog>>> rm = db.doOption<PageList<List<MeterBaseOperationLog>>>("meterbaseoperationlogs", "/", new object[] { info }, 0);

            RESTfulResult<List<MeterBaseOperationLog>> result = new RESTfulResult<List<MeterBaseOperationLog>>();
            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;
        }
        
        public RESTfulResult<List<MeterBaseOperationLog>> doQueryAndMultiple(CommonPage<MeterBaseOperationLog> info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<List<MeterBaseOperationLog>> rm = db.doOption<List<MeterBaseOperationLog>>("meterbaseoperationlogs", "doQueryAndMultiple", new object[] { info }, 1);
            return rm;
        }


        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<string> AddLog(MeterBaseOperationLog lt)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<string> rm = db.doOption<string>("meterbaseoperationlogs", "AddLog", new object[] { lt }, 1);
            return rm;
        }


      

    }
}
