TASK: 批量生成 获取任务序号
This commit is contained in:
@@ -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();
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user