Files
ManuAgent/server/src/main/java/tech/easyflow/manuagent/mapper/AgentEventMapper.java
Zhu Junhao e968a8ddc1 重构:使用 MyBatis-Flex 迁移应用 ORM
将应用自管表的 JdbcClient 数据访问迁移为实体、Mapper、构造器查询和必要的显式 SQL。

保留 AgentScope 自管表及原有业务语义,并补充事务、查询与数据库集成测试。
2026-08-31 12:13:06 +08:00

27 lines
965 B
Java

package tech.easyflow.manuagent.mapper;
import com.mybatisflex.core.BaseMapper;
import java.util.UUID;
import org.apache.ibatis.annotations.Param;
import tech.easyflow.manuagent.entity.AgentEventEntity;
/**
* 提供 Agent 事件写入、游标回放及运行恢复所需的持久化能力。
*/
public interface AgentEventMapper extends BaseMapper<AgentEventEntity> {
/**
* 插入事件并原子返回数据库生成的 BIGSERIAL 序号及创建时间。
*
* @param event 待写入事件
* @return 已持久化的完整事件
*/
AgentEventEntity insertReturning(@Param("event") AgentEventEntity event);
/** 查询指定 Run 最近一次 RUN_STARTED 事件中的业务阶段。 */
String selectLatestStartedPhase(@Param("runId") UUID runId);
/** 查询项目最近一次包含材料决策数组的 ASK_RESPONDED 事件负载。 */
String selectLatestMaterialResponseJson(@Param("projectId") UUID projectId);
}