声明-版本3.4
1.加个配置bean
@Bean
public IKeyGenerator keygenerator(){
return new OracleKeyGenerator();
}
2.添加生成策略
2.1全局配置
mybatis-plus.global-config.db-config.id-type: ASSIGN_ID
2.2局部配置
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CIopNotice {
@TableId(value = "notice_id",type = IdType.ASSIGN_ID)
private String noticeId;
ASSIGN_ID为雪花算法生成的id,支持string类型