获取自增主键的值

在mapper.xml中配置属性:useGeneratedKeys="true",将获取到的自增主键封装到对象的id属性:keyProperty="id",然后bean.getId()就可以得到自增后的主键的值了