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

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

            RESTfulResult<List<MeterBaseHisTareData>> result = new RESTfulResult<List<MeterBaseHisTareData>>();
            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="strCarNo"></param>
        /// <returns></returns>
        public RESTfulResult<List<MeterBaseHisTareData>> doQueryCarWeight(string strCarNo)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<PageList<List<MeterBaseHisTareData>>> rm = db.doOption<PageList<List<MeterBaseHisTareData>>>("meterbasehistaredatas", "/", new object[] { strCarNo }, 0);

            RESTfulResult<List<MeterBaseHisTareData>> result = new RESTfulResult<List<MeterBaseHisTareData>>();
            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;
        }
    }
}
