在mybatis里面获取自增长的id 在mybatis mapper文件里添加属性useGeneratedKeys 和keyProperty useGeneratedKeys 设置为true keyProperty 设置id 相关文章: