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

namespace Common
{
    public class MeterWorkCompareSpotService
    {
        /// <summary>
        /// 基础信息查询
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<List<MeterWorkCompareSpot>> doQuery(MeterWorkCompareSpot info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<PageList<List<MeterWorkCompareSpot>>> rm = db.doOption<PageList<List<MeterWorkCompareSpot>>>("meterworkcomparespots", "/like/", new object[] { info }, 0);

            RESTfulResult<List<MeterWorkCompareSpot>> result = new RESTfulResult<List<MeterWorkCompareSpot>>();
            result.Succeed = rm.Succeed;
            result.Status = rm.Status;
            result.Message = rm.Message;
            result.ResultMessage = rm.ResultMessage;
            result.Code = rm.Code;

            if (rm.Succeed && 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> doAdd(Hashtable info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<string> rm = db.doOptionPut<string>("meterworkcomparespotscales", "/submitScaleResult", new object[] { info });

            
            return rm;
        }

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<string> doMofity(MeterWorkCompareSpot info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<string> rm = db.doOption<string>("meterworkcomparespots", "/updateModel", new object[] { info },1);

            return rm;
        }
    }
}
