11
This commit is contained in:
@@ -8,17 +8,43 @@ using MyCode.Project.Domain.Model;
|
||||
using MyCode.Project.Domain.Repositories;
|
||||
using MyCode.Project.Infrastructure.Common;
|
||||
using MyCode.Project.Infrastructure.Search;
|
||||
using MyCode.Project.Infrastructure.Enumeration;
|
||||
using MyCode.Project.Infrastructure.Extensions;
|
||||
|
||||
namespace MyCode.Project.Repositories
|
||||
{
|
||||
public class SysWorkprocessRepository: Repository<SysWorkprocess>, ISysWorkprocessRepository
|
||||
public class SysWorkProcessRepository: Repository<SysWorkProcess>, ISysWorkProcessRepository
|
||||
{
|
||||
public SysWorkprocessRepository(MyCodeSqlSugarClient context) : base(context)
|
||||
public SysWorkProcessRepository(MyCodeSqlSugarClient context) : base(context)
|
||||
{ }
|
||||
|
||||
|
||||
|
||||
|
||||
#region Exists(是否存在调度)
|
||||
/// <summary>
|
||||
/// 是否存在调度
|
||||
/// </summary>
|
||||
/// <param name="funcType">执行类型</param>
|
||||
/// <param name="merchantId">商家ID</param>
|
||||
/// <param name="funcClass">执行类</param>
|
||||
/// <param name="funcMethod">执行方法名</param>
|
||||
/// <param name="paramInfo">参数信息</param>
|
||||
/// <returns></returns>
|
||||
public bool Exists(FuncType funcType, Guid merchantId, string funcClass, string funcMethod, string paramInfo)
|
||||
{
|
||||
var sql = @"select COUNT(1) from SysWorkProcess with(nolock)";
|
||||
SearchCondition where = new SearchCondition();
|
||||
where.AddCondition("MerchantID", merchantId, SqlOperator.Equal, true)
|
||||
.AddCondition("FuncType", funcType.Value(), SqlOperator.Equal, true)
|
||||
.AddCondition("FuncClass", funcClass, SqlOperator.Equal, true)
|
||||
.AddCondition("FuncMethod", funcMethod, SqlOperator.Equal, true)
|
||||
.AddCondition("ParamInfo", paramInfo, SqlOperator.Equal, true)
|
||||
.AddSqlCondition($@" FuncStatus = {FuncStatus.Running.Value()} or FuncStatus={FuncStatus.ExceptionStop.Value()} ", true);
|
||||
var result = this.SelectFirst<int>(sql, where);
|
||||
return result > 0;
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user