Commit d86779fa by wang_jiaxing

身份核查接口返回值修改

parent 272ae0b4
package com.founder.config;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import javax.sql.DataSource;
/**
* Created by summer on 2016/11/25.
*/
@Configuration
@MapperScan(basePackages = "com.founder.*.mysqldao", sqlSessionTemplateRef = "xzxtMysqlSqlSessionTemplate")
public class DataSourceXzxtMysqlConfig {
@Bean(name = "xzxtMysqlDataSource")
@ConfigurationProperties(prefix = "spring.datasource.mysql")
public DataSource xzxtMysqlDataSource() {
return DataSourceBuilder.create().build();
}
@Bean(name = "xzxtMysqlSqlSessionFactory")
public SqlSessionFactory xzxtMysqlSqlSessionFactory(@Qualifier("xzxtMysqlDataSource") DataSource dataSource) throws Exception {
SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
bean.setDataSource(dataSource);
bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mybatis/mysqlMapper/*.xml"));
return bean.getObject();
}
@Bean(name = "xzxtMysqlSqlSessionTemplate")
public SqlSessionTemplate xzxtMysqlSqlSessionTemplate(@Qualifier("xzxtMysqlSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception {
return new SqlSessionTemplate(sqlSessionFactory);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment