mitao
2024-05-16 c369ea570f3d6fd628be962c0b40a17a711a5617
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.ruoyi.common.core.utils;
 
import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator;
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
 
/**
 * 描述: ID生成
 * 版权: Copyright (c) 2020
 * 公司: XXX
 * 作者: yanghj
 * 版本: 4.0
 * 创建日期: 2020/9/16 9:59
 */
public class IDhelper
{
    //用mybatis-plus生成Long ID
    public  static Long getNextId()
    {
        IdentifierGenerator identifierGenerator=new DefaultIdentifierGenerator();
        Number id=  identifierGenerator.nextId(new Object());
        Long nextid = Long.parseLong(id+"");
        return nextid;
    }
}