package com.ruoyi.generator.mapper.front;

import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.generator.domain.front.AiGenerationTask;

public interface AiGenerationTaskMapper
{
    public AiGenerationTask selectAiGenerationTaskById(Long taskId);
    public AiGenerationTask selectTaskForUser(@Param("userId") Long userId, @Param("projectId") Long projectId, @Param("taskId") Long taskId);
    public AiGenerationTask selectActiveTaskByRequestHash(@Param("userId") Long userId, @Param("projectId") Long projectId, @Param("requestHash") String requestHash);
    public List<AiGenerationTask> selectTasksByProjectId(@Param("userId") Long userId, @Param("projectId") Long projectId);
    public List<AiGenerationTask> selectClaimableTasks(@Param("limit") Integer limit);
    public int insertAiGenerationTask(AiGenerationTask aiGenerationTask);
    public int updateAiGenerationTask(AiGenerationTask aiGenerationTask);
    public int claimTask(@Param("taskId") Long taskId, @Param("lockedBy") String lockedBy);
}
