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

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

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