自增id问题

This commit is contained in:
liuhanqing
2025-05-20 10:59:48 +08:00
parent 00b4f8ea54
commit 007976b284
20 changed files with 6 additions and 24 deletions

View File

@@ -204,7 +204,6 @@ public class SysJobServiceImpl implements ISysJobService
public int insertJob(SysJob job) throws SchedulerException, TaskException
{
job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
job.setJobId(IdUtil.getSnowflakeNextId());
int rows = jobMapper.insertJob(job);
if (rows > 0)
{

View File

@@ -80,7 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where job_id = #{jobId}
</update>
<insert id="insertJob" parameterType="SysJob" >
<insert id="insertJob" parameterType="SysJob" useGeneratedKeys="true" keyProperty="jobId" >
insert into sys_job(
<if test="jobId != null and jobId != 0">job_id,</if>
<if test="jobName != null and jobName != ''">job_name,</if>