Mybatis 开启CallSettersOnNulls
@Bean
public SqlSessionFactory sqlSessionFactoryBean() throws Exception
{
SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
sqlSessionFactoryBean.setDataSource(dataSource());
Configuration configuration = new .Configuration();
configuration.setCallSettersOnNulls(true);//map返回空字段消失问题
PageInterceptor pagePlugin = new PageInterceptor();
JalorResultSetInterceptor jalorResultSetPlugin = new JalorResultSetInterceptor();
ProgramInterceptor programPlugin = new ProgramInterceptor();
//添加插件
sqlSessionFactoryBean.setPlugins(new Interceptor[] {pagePlugin, jalorResultSetPlugin, programPlugin});
sqlSessionFactoryBean.setConfiguration(configuration);
return sqlSessionFactoryBean.getObject();
}