package com.yaoai.domain.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yaoai.domain.entity.AgentRunPlan;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface AgentRunPlanMapper extends BaseMapper<AgentRunPlan> {

    default AgentRunPlan findByRunId(Long runId) {
        return selectOne(Wrappers.<AgentRunPlan>lambdaQuery()
                .eq(AgentRunPlan::getRunId, runId)
                .last("LIMIT 1"));
    }
}
