BaoKai_202508-Wcs-Jingwang..../WCSIce/Business/Dao/PlcDao.cs

47 lines
1.1 KiB
C#
Raw Permalink Normal View History

2025-08-24 12:51:29 +08:00
using System;
using System.Collections.Generic;
using WCS.Business.Dto;
namespace WCS.Business.Dao
{
public class PlcDao
{
public PlcDao() { }
private static PlcDao _instance;
public static PlcDao Instance()
{
if (_instance == null)
{
_instance = new PlcDao();
}
return _instance;
}
/// <summary>
/// 获取PLC信息
/// </summary>
/// <returns></returns>
public List<PlcDto> GetLotInfo()
{
try
{
List<PlcDto> plcs = DataCommon.DBServer.Queryable<PlcDto>().ToList();
return plcs;
//第二种 SQL语句的方式
//string sql = $"select * FROM t_plc ";
//var sqlFunc = DataCommon.DBServer.SqlQueryable<PlcDto>(sql);
//return sqlFunc.ToList();
}
catch (Exception ex)
{
_ = ex;
return new List<PlcDto>();
}
}
}
}