using ProjectBase.Data.BaseDAL; using SIMDP.DAL.IDALSQL; using SIMDP.Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SIMDP.BLL { public class BlProductData : BaseBLL { private IDalProductData dalData; /// /// 构造函数 /// public BlProductData() : base() { base.Init(this.GetType().FullName, System.Reflection.Assembly.GetExecutingAssembly().GetName().Name); dalData = baseDal as IDalProductData; } /// /// 获取指定PLC下的数据点 /// /// /// public MoProductData FindByBatch(string batchId) { string sql = string.Format("SELECT TOP 1 * FROM product_data WHERE batchid = '{0}' order by data_id desc", batchId); var list = dalData.GetList(sql, null); if (list.Count > 0) return list[0]; else return null; } } }