package com.ai.da.mapper.primary;

import com.ai.da.mapper.primary.entity.BatchTaskSequence;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface BatchTaskSequenceMapper extends BaseMapper<BatchTaskSequence> {

    @Update("UPDATE t_batch_task_sequence SET current_sequence = LAST_INSERT_ID(current_sequence + 1) WHERE account_id = #{userId}")
    int incrementSequence(@Param("userId") Long userId);

    @Select("SELECT LAST_INSERT_ID()")
    Integer getLastInsertId();
}
