TASK: 批量生成 获取任务序号

This commit is contained in:
2025-06-30 15:11:31 +08:00
parent 68311e1d8b
commit 9a25e8ce4a
5 changed files with 85 additions and 34 deletions

View File

@@ -0,0 +1,16 @@
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();
}

View File

@@ -0,0 +1,16 @@
package com.ai.da.mapper.primary.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
@TableName("t_batch_task_sequence")
@Data
public class BatchTaskSequence extends BaseEntity{
private Long accountId;
private Integer currentSequence;
}