paiban/NPP.SmartSchedue.Api.Contracts/Domain/Time/IShiftRuleMappingRepository.cs
Asoka.Wang 21f044712c 1
2025-08-27 18:39:19 +08:00

31 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using NPP.SmartSchedue.Api.Contracts.Domain.Time;
using ZhonTai.Admin.Core.Repositories;
namespace NPP.SmartSchedue.Api.Contracts;
/// <summary>
/// 班次规则关联仓储接口
/// </summary>
public interface IShiftRuleMappingRepository : IRepositoryBase<ShiftRuleMappingEntity>
{
/// <summary>
/// 根据班次ID获取有效的班次规则列表
/// 深度业务思考:通过映射表关联,获取班次对应的所有有效规则
/// </summary>
/// <param name="shiftId">班次ID</param>
/// <param name="targetDate">目标日期(用于生效时间判断)</param>
/// <returns>有效的班次规则列表</returns>
Task<List<ShiftRuleEntity>> GetEffectiveShiftRulesAsync(long shiftId, DateTime? targetDate = null);
/// <summary>
/// 批量获取多个班次的规则映射
/// 深度业务思考批量查询优化避免N+1查询问题
/// </summary>
/// <param name="shiftIds">班次ID列表</param>
/// <param name="targetDate">目标日期(用于生效时间判断)</param>
/// <returns>班次ID到规则列表的映射</returns>
Task<Dictionary<long, List<ShiftRuleEntity>>> GetBatchShiftRulesAsync(List<long> shiftIds, DateTime? targetDate = null);
}