112 lines
4.5 KiB
C#
112 lines
4.5 KiB
C#
using SJZY.Track.Domain.Aggregates.WarningAggregate.Complete;
|
||
using SJZY.Track.Domain.Aggregates.WarningAggregate.Return;
|
||
using SJZY.Track.Domain.Aggregates.WarningAggregate.Transport;
|
||
using SJZY.Track.Domain.Enums;
|
||
|
||
namespace SJZY.Track.Domain.Aggregates.WarningAggregate;
|
||
|
||
/// <summary>
|
||
/// 预警规则仓储
|
||
/// </summary>
|
||
public interface IWarningRuleRepository : IBasicRepository<WarningRuleEntity>
|
||
{
|
||
#region 规则主体
|
||
|
||
// 检查名称是否重复
|
||
Task<bool> CheckNameDuplicateAsync(int id, int subsystemId, int customId, string name, WarningRuleType warningType);
|
||
|
||
// 检查是同一【子系统+客户+类型】是否有多个启用的预警规则主体
|
||
Task<bool> CheckEnableDuplicateAsync(int warningId, int subsystemId, int customId, WarningRuleType warningType);
|
||
|
||
// 新增/更新预警规则主体,并返回id
|
||
Task<int> UpsertReturnIdAsync(WarningRuleEntity entity);
|
||
|
||
// 更新版本号
|
||
Task<string> UpdateVersionAsync(WarningRuleEntity entity);
|
||
|
||
// 模糊查询预警规则主体
|
||
Task<List<WarningRuleEntity>> GetWarningRuleListAsync(int? subsystemId, int? customId, string? kpiname, bool? isEnabled, int? warningType);
|
||
|
||
// 获取启用的预警规则主体
|
||
Task<WarningRuleEntity?> GetWarningRuleForEnabledAsync(int subSystemId, int customId, WarningRuleType warningType);
|
||
|
||
// 获取预警规则主体根据id
|
||
Task<WarningRuleEntity?> GetWarningRuleByIdAsync(int id, WarningRuleType? warningType = null);
|
||
|
||
#endregion
|
||
|
||
#region 运输时效预警规则
|
||
|
||
// 获取运输预警场景列表
|
||
Task<List<TransportWarningSceneEntity>> GetTransportSceneAsync(int warningId);
|
||
|
||
// 获取运输预警场景列表
|
||
Task<List<TransportWarningSceneEntity>> GetTransportSceneAsync(Expression<Func<TransportWarningSceneEntity, bool>> whereExpression);
|
||
|
||
// 获取运输预警场景列表
|
||
Task<TransportWarningSceneEntity?> GetTransportSceneAsync(int warningId, int sceneId);
|
||
|
||
// 全量获取的运输时效场景规则项目
|
||
Task<List<TransportWarningSceneRuleItemEntity>> GetTransportSceneRuleItemsAsync(int warningId, int sceneId);
|
||
|
||
// 获取运输预警场景规则项目
|
||
Task<List<TResult>> GetTransportSceneRuleItemsAsync<TResult>(
|
||
Expression<Func<TransportWarningSceneRuleItemEntity, bool>> whereExpression,
|
||
Expression<Func<TransportWarningSceneRuleItemEntity, TResult>> resultExpression);
|
||
|
||
// 新增/更新 运输预警场景
|
||
Task<int> UpsertTransportSceneReturnIdAsync(TransportWarningSceneEntity entity);
|
||
|
||
// 批量更新运输时效场景规则项目
|
||
Task<int> BulkUpdateTransportSceneRuleItemsAsync(List<TransportWarningSceneRuleItemEntity> entities);
|
||
|
||
// 批量新增运输时效场景规则项目
|
||
Task<int> BulkInsertTransportSceneRuleItemsAsync(List<TransportWarningSceneRuleItemEntity> entities);
|
||
|
||
// 删除运输预警场景规则项目
|
||
Task<int> DeleteTransportSceneRuleItemsAsync(HashSet<int> ruleItemIds);
|
||
|
||
// 删除运输预警场景,并返回删除的规则项目id
|
||
Task<bool> DeleteTransportSceneAsync(int warningId, int sceneId);
|
||
|
||
#endregion
|
||
|
||
#region 回传时效预警规则
|
||
|
||
// 获取全量回传预警规则规则项目
|
||
Task<List<ReturnWarningRuleItemEntity>> GetReturnRuleItemsAsync(int warningId);
|
||
|
||
// 按规则项目id获取预警规则
|
||
Task<List<ReturnWarningRuleItemEntity>> GetReturnRuleItemsAsync(HashSet<int> ruleItemIds);
|
||
|
||
// 批量新增回传时效场景规则项目
|
||
Task<int> BulkInsertReturnRuleItemsAsync(List<ReturnWarningRuleItemEntity> entities);
|
||
|
||
// 批量更新回传预警规则规则项目
|
||
Task<int> BulkUpdateReturnRuleItemsAsync(List<ReturnWarningRuleItemEntity> entities);
|
||
|
||
// 删除回传预警规则项目
|
||
Task<int> DeleteReturnRuleItemsAsync(HashSet<int> ruleItemIds);
|
||
|
||
#endregion
|
||
|
||
#region 完整预警规则
|
||
|
||
// 获取全量预警规则规则项目
|
||
Task<List<CompleteWarningRuleItemEntity>> GetCompleteRuleItemsAsync(int warningId);
|
||
|
||
// 按规则项目id获取预警规则
|
||
Task<List<CompleteWarningRuleItemEntity>> GetCompleteRuleItemsAsync(HashSet<int> ruleItemIds);
|
||
|
||
// 批量更新预警规则规则项目
|
||
Task<int> BulkUpdateCompleteRuleItemsAsync(List<CompleteWarningRuleItemEntity> entities);
|
||
|
||
// 批量新增完整时效规则项目
|
||
Task<int> BulkInsertCompleteRuleItemsAsync(List<CompleteWarningRuleItemEntity> entities);
|
||
|
||
// 删除完整预警场景规则项目
|
||
Task<int> DeleteCompleteRuleItemsAsync(HashSet<int> ruleItemIds);
|
||
|
||
#endregion
|
||
}
|