|
|
|
|
using Entity.Api.Req;
|
|
|
|
|
using Entity.Api.Resp;
|
|
|
|
|
using Entity.DbModel.Station;
|
|
|
|
|
using HybirdFrameworkCore.Autofac.Attribute;
|
|
|
|
|
using HybirdFrameworkCore.Entity;
|
|
|
|
|
using Repository.Station;
|
|
|
|
|
using SqlSugar;
|
|
|
|
|
using System.Linq.Expressions;
|
|
|
|
|
|
|
|
|
|
namespace Service.Station;
|
|
|
|
|
|
|
|
|
|
[Scope("SingleInstance")]
|
|
|
|
|
public class SwapOrderStepService : BaseServices<SwapOrderStep>
|
|
|
|
|
{
|
|
|
|
|
SwapOrderStepRepository _swapOrderStepRepository;
|
|
|
|
|
public SwapOrderStepService(SwapOrderStepRepository dal)
|
|
|
|
|
{
|
|
|
|
|
_swapOrderStepRepository = dal;
|
|
|
|
|
BaseDal = dal;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD>粽<EFBFBD><E7B2BD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ҳ
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="swapOrderStep"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public PageResult<SwapOrderStepResp> QueryEqmFaultInfo(QuerySwapOrderStepReq swapOrderStep)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>յı<D5B5><C4B1><EFBFBD>ʽ<EFBFBD><CABD>
|
|
|
|
|
Expression<Func<SwapOrderStep, bool>> where = null;
|
|
|
|
|
//// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ
|
|
|
|
|
ParameterExpression parameter = Expression.Parameter(typeof(SwapOrderStep), "u");
|
|
|
|
|
|
|
|
|
|
if (swapOrderStep.Id!=0)
|
|
|
|
|
{
|
|
|
|
|
Expression<Func<SwapOrderStep, bool>> condition1Expr = u => u.Id == swapOrderStep.Id;
|
|
|
|
|
where = condition1Expr;
|
|
|
|
|
}
|
|
|
|
|
if (swapOrderStep.Step != 0)
|
|
|
|
|
{
|
|
|
|
|
Expression<Func<SwapOrderStep, bool>> condition2Expr = u => u.Step == swapOrderStep.Step;
|
|
|
|
|
where = where == null ? condition2Expr : Expression.Lambda<Func<SwapOrderStep, bool>>(Expression.AndAlso(where.Body, condition2Expr.Body), parameter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(swapOrderStep.SwapOrderSn))
|
|
|
|
|
{
|
|
|
|
|
Expression<Func<SwapOrderStep, bool>> condition2Expr = u => u.SwapOrderSn == swapOrderStep.SwapOrderSn;
|
|
|
|
|
where = where == null ? condition2Expr : Expression.Lambda<Func<SwapOrderStep, bool>>(Expression.AndAlso(where.Body, condition2Expr.Body), parameter);
|
|
|
|
|
}
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>
|
|
|
|
|
if (!string.IsNullOrEmpty(swapOrderStep.StepName))
|
|
|
|
|
{
|
|
|
|
|
Expression<Func<SwapOrderStep, bool>> condition2Expr = u => u.StepName == swapOrderStep.StepName;
|
|
|
|
|
where = where == null ? condition2Expr : Expression.Lambda<Func<SwapOrderStep, bool>>(Expression.AndAlso(where.Body, condition2Expr.Body), parameter);
|
|
|
|
|
}
|
|
|
|
|
//<2F><>ѯ
|
|
|
|
|
return PageResult<SwapOrderStepResp>.ConvertPage(_swapOrderStepRepository.QueryIPageByCause(swapOrderStep, where));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|