一、可以在SQL中指定类型:

@Insert("insert into student values(#{name,jdbcType=NULL},#{age})")
    int addStudent(@Param("name")String name, @Param("age") int age);

二、可以进行全局配置(单独使用MyBatis时可如下配置)

MyBatis: 向oracle表中插入null字段的处理_数据库

如果不进行配置,将报错

MyBatis: 向oracle表中插入null字段的处理_oracle_02