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 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); }