package com.ruoyi.system.mapper; import com.ruoyi.system.domain.NotifyTask; import org.apache.ibatis.annotations.Param; import java.util.List; /** * 通知任务Mapper接口 * * @author ruoyi * @date 2025-12-07 */ public interface NotifyTaskMapper { /** * 查询通知任务 * * @param id 主键ID * @return 通知任务 */ NotifyTask selectNotifyTaskById(Long id); /** * 查询通知任务列表 * * @param notifyTask 查询条件 * @return 通知任务列表 */ List selectNotifyTaskList(NotifyTask notifyTask); /** * 查询待处理的通知任务 * * @param limit 查询数量限制 * @return 待处理的通知任务列表 */ List selectPendingNotifyTasks(int limit); /** * 检查通知任务是否已存在 * * @param taskId 业务任务ID * @param userId 用户ID * @param notifyType 通知类型 * @return 数量 */ int countByTaskUserType(@Param("taskId") Long taskId, @Param("userId") Long userId, @Param("notifyType") String notifyType); /** * 新增通知任务 * * @param notifyTask 通知任务 * @return 影响行数 */ int insertNotifyTask(NotifyTask notifyTask); /** * 修改通知任务 * * @param notifyTask 通知任务 * @return 影响行数 */ int updateNotifyTask(NotifyTask notifyTask); /** * 更新通知任务状态 * * @param id 主键ID * @param status 状态 * @param errorMsg 错误信息 * @return 影响行数 */ int updateNotifyTaskStatus(@Param("id") Long id, @Param("status") String status, @Param("errorMsg") String errorMsg); /** * 增加重试次数 * * @param id 主键ID * @return 影响行数 */ int incrementRetryCount(Long id); /** * 删除通知任务 * * @param id 主键ID * @return 影响行数 */ int deleteNotifyTaskById(Long id); /** * 批量删除通知任务 * * @param ids 主键ID数组 * @return 影响行数 */ int deleteNotifyTaskByIds(Long[] ids); }