将应用自管表的 JdbcClient 数据访问迁移为实体、Mapper、构造器查询和必要的显式 SQL。 保留 AgentScope 自管表及原有业务语义,并补充事务、查询与数据库集成测试。
26 lines
967 B
Java
26 lines
967 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.ProjectPlanEntity;
|
|
|
|
/**
|
|
* 提供规划版本查询以及带条件的草稿写入、确认能力。
|
|
*/
|
|
public interface ProjectPlanMapper extends BaseMapper<ProjectPlanEntity> {
|
|
|
|
/** 插入项目下一版草稿并返回完整记录。 */
|
|
ProjectPlanEntity insertNextDraft(@Param("plan") ProjectPlanEntity plan);
|
|
|
|
/** 按“已确认优先、版本倒序”读取项目当前规划。 */
|
|
ProjectPlanEntity selectCurrent(@Param("projectId") UUID projectId);
|
|
|
|
/** 仅将仍处于 DRAFT 的指定版本确认,并返回确认后的记录。 */
|
|
ProjectPlanEntity confirmDraft(
|
|
@Param("projectId") UUID projectId,
|
|
@Param("planId") UUID planId,
|
|
@Param("planJson") String planJson,
|
|
@Param("userId") UUID userId);
|
|
}
|