Springboot里mybatis在数据库中插入数据后,自动生成i

108 阅读1分钟

##在配置文件中写(yml)

#开启自动生成id
mybatis:
  configuration:
    use-generated-keys: true

##在mapper.xml中写,加上keyProperty="id" image.png