@Primary
@Bean(name = "sysSqlSessionFactory")
public SqlSessionFactory setSqlSessionFactory(@Qualifier("sysDataSource") DataSource dataSource) throws Exception {
SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
bean.setDataSource(dataSource);
//设置为true 为null字段也会查询出来
bean.getObject().getConfiguration().setCallSettersOnNulls(true);
org.apache.ibatis.session.Configuration configuration = new org.apache.ibatis.session.Configuration();
configuration.setMapUnderscoreToCamelCase(true);
bean.setConfiguration(configuration);
bean.setMapperLocations(resolveMapperLocations());
bean.setConfigurationProperties(resolveMapperProperties());
return bean.getObject();
}