You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.9 KiB
C#

#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* (c) 2025 WenJY
* CLR4.0.30319.42000
* Mr.Wen's MacBook Pro
* Sln.Imm.Daemon.Repository.service.Impl
* 4B5A8864-4B34-489E-986B-B4C698CED289
*
* WenJY
*
* 2025-09-05 11:26:11
* V1.0.0
*
*
*--------------------------------------------------------------------
*
*
*
*
* V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
using Sln.Imm.Daemon.Model.dao;
using Sln.Imm.Daemon.Repository.service.@base;
using SqlSugar;
namespace Sln.Imm.Daemon.Repository.service.Impl;
public class BaseDeviceInfoServiceImpl : BaseServiceImpl<BaseDeviceInfo>, IBaseDeviceInfoService
{
public BaseDeviceInfoServiceImpl(Repository<BaseDeviceInfo> rep) : base(rep)
{
}
/// <summary>
/// 通过导航查询方式获取设备信息及下属参数
/// </summary>
/// <returns></returns>
/// <exception cref="InvalidOperationException"></exception>
public List<BaseDeviceInfo> GetDeviceInfosByNavigate()
{
try
{
// return _rep.Context.Queryable<BaseDeviceInfo>().Includes(x => x.deviceParams.Where(x=>x.isFlag == 1).ToList())
// .Where(x => x.isFlag == 1)
// .ToList();
return _rep.Context.Queryable<BaseDeviceInfo>()
.Includes(x => x.deviceParams.Where(p => p.isFlag == 1).ToList())
.Where(x => SqlFunc.MappingColumn(x.isFlag, "IS_FLAG") == 1)
.ToList();
}
catch (Exception ex)
{
throw new InvalidOperationException($"通过导航查询方式获取设备信息及下属参数执行异常:{ex.Message}");
}
}
}