EquipmentVisualService.cs 1.63 KB
using Hh.Mes.Common.Request;
using Hh.Mes.POJO.Entity;
using Hh.Mes.POJO.Response;
using Hh.Mes.Service.Repository;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;

namespace Hh.Mes.Service.WebService.Equipment
{
    /// <summary>
    /// 设备可视化参数
    /// </summary>
    public class BaseEquipmentService : RepositorySqlSugar<base_equipment>
    {
        /// <summary>
        /// //获取列表
        /// </summary>
        public Response GetEquipmentFileListById(base_equipment equipment)
        {
            var result = new Response();
            var stringBuilder = new StringBuilder();

            stringBuilder.AppendLine($@" select  
                                              t1.* , t2.lineName,
                                              t4.workCenterName
                                         from base_equipment t1  with(nolock)
                                         left join base_line t2   with(nolock) on  t1.lineCode = t2.lineCode
                                         left join base_work_center_station_rel t3 on t3.workStationCode =t1.workStationCode 
                                         left join base_work_center t4 on t4.workCenterCode = t3.workCenterCode ");

             
            var dt = base.Context.Ado.GetDataTable(stringBuilder.ToString(), new List<SugarParameter>(){  });
            //result.Result = ds.Tables[0];

            
            result.Result = dt;
            result.Count = dt.Rows.Count;//model.Exel ? (int)result.Result.Rows.Count : (int)ds.Tables[1].Rows[0]["rowTotal"];
            return result;
        }
    }
}