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.

69 lines
1.9 KiB
C#

using SlnMesnac.Business.@base;
using SlnMesnac.Common;
using SlnMesnac.Plc;
using SlnMesnac.Repository;
using SlnMesnac.Repository.service;
using SlnMesnac.Serilog;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* (c) 2024 WenJY
* CLR4.0.30319.42000
* T14-GEN3-7895
* SlnMesnac.Business
* 43ede2ff-ca9f-4478-a169-af30b3bc8ec8
*
* WenJY
*
* 2024-11-08 14:35:44
* V1.0.0
*
*
*--------------------------------------------------------------------
*
*
*
*
* V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace SlnMesnac.Business
{
public class CabinetInfoBusiness
{
private readonly Ibase_cabinet_infoServices _cabinet_infoServices;
public CabinetInfoBusiness(Ibase_cabinet_infoServices cabinet_infoServices)
{
_cabinet_infoServices = cabinet_infoServices;
}
public void QueryCabinetInfo(int cabinetCode,string cabinetAlias,int? isChecked,out List<base_cabinet_info> infos)
{
Expression<Func<base_cabinet_info, bool>> exp = s1 => true;
if (cabinetCode > 0)
{
exp = exp.And(x => x.cabinetCode == cabinetCode);
}
if (!string.IsNullOrEmpty(cabinetAlias))
{
exp = exp.And(x => x.cabinetAlias == cabinetAlias);
}
if(isChecked != null)
{
exp = exp.And(x => x.isChecked == isChecked);
}
infos = _cabinet_infoServices.Query(exp);
}
}
}