推荐方法,在xml中加入 true表示返回主键 keyProperty为对应的属性名 useGeneratedKeys="true" keyProperty="id" 返回的主键回赋值到参数对象的id上