用mybatis自动生成的mapper配置文件,insert方法没有主键值。 所以主键如果不是自增类型,执行insert时因主键不能为空,会发生异常。 转载于:https://www.cnblogs.com/zhenmingliu/archive/2012/03/06/2381337.html