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

namespace Common
{

    /// <summary>
    /// 皮带秤定时数据接口
    /// </summary>
    public class MeterWorkBeltTimingService
    {
        /// <summary>
        /// 数据查询：查询当天的数据
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<List<MeterWorkBeltTiminginfo>> doQueryWf(CommonPage<MeterWorkBeltTiminginfo> info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<List<MeterWorkBeltTiminginfo>> rm = db.doOption<List<MeterWorkBeltTiminginfo>>("meterworkbelttiminginfos", "doQueryWf", new object[] { info }, 1);
            return rm;
        }

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

            RESTfulResult<List<MeterWorkBeltActual>> result = new RESTfulResult<List<MeterWorkBeltActual>>();
            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> doAddWf(MeterWorkBeltTiminginfo info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<string> rm = db.doOption<string>("meterworkbelttiminginfos", "doAddWf", new object[] { info }, 1);
            return rm;
        }



    }
}
