Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hnxtbaboot
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨亮
hnxtbaboot
Commits
2ed45685
Commit
2ed45685
authored
Jul 08, 2022
by
wuchengwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增查询数据源
parent
2064a3a0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
0 deletions
+59
-0
hnxtba-core/src/main/java/com/founder/config/DataSourceConfig.java
+14
-0
hnxtba-core/src/main/java/com/founder/config/MybatisXzxtcxDbConfig.java
+39
-0
hnxtba-core/src/main/resources/application-dev.properties
+6
-0
hnxtba-core/src/main/resources/templates/rygl/ryxxcxlist.html
+0
-0
No files found.
hnxtba-core/src/main/java/com/founder/config/DataSourceConfig.java
View file @
2ed45685
...
...
@@ -31,6 +31,20 @@ public class DataSourceConfig {
return
baseDbProperties
().
initializeDataSourceBuilder
().
build
();
}
@Bean
(
name
=
"xzxtcxdbProperties"
)
@Qualifier
(
"xzxtcxdb"
)
@ConfigurationProperties
(
prefix
=
"spring.datasource.xzxtcxdb"
)
public
DataSourceProperties
xzxtcxdbProperties
(){
return
new
DataSourceProperties
();
}
@Bean
(
name
=
"xzxtcxdb"
)
@Qualifier
(
"xzxtcxdb"
)
@ConfigurationProperties
(
prefix
=
"spring.datasource.xzxtcxdb"
)
public
DataSource
setxzxtcxdbDataSource
(){
return
xzxtcxdbProperties
().
initializeDataSourceBuilder
().
build
();
}
@Bean
(
name
=
"amsisdbProperties"
)
@Qualifier
(
"amsisdb"
)
@ConfigurationProperties
(
prefix
=
"spring.datasource.amsisdb"
)
...
...
hnxtba-core/src/main/java/com/founder/config/MybatisXzxtcxDbConfig.java
0 → 100644
View file @
2ed45685
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.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.io.support.PathMatchingResourcePatternResolver
;
import
javax.sql.DataSource
;
/**
* @author www
* @DateTime: 2020/6/9 3:14 下午
*/
@Configuration
@MapperScan
(
basePackages
=
{
"com.founder.xzxtcxDao"
},
sqlSessionFactoryRef
=
"xzxtcxSqlSessionFactory"
)
public
class
MybatisXzxtcxDbConfig
{
static
final
String
MAPPER_LOCATION
=
"classpath:mapper/*.xml"
;
@Autowired
@Qualifier
(
"xzxtcxdb"
)
private
DataSource
xzxtcxdb
;
@Bean
(
name
=
"xzxtcxSqlSessionFactory"
)
public
SqlSessionFactory
xzxtcxSqlSessionFactory
()
throws
Exception
{
SqlSessionFactoryBean
factoryBean
=
new
SqlSessionFactoryBean
();
factoryBean
.
setDataSource
(
xzxtcxdb
);
factoryBean
.
setMapperLocations
(
new
PathMatchingResourcePatternResolver
().
getResources
(
MAPPER_LOCATION
));
return
factoryBean
.
getObject
();
}
@Bean
(
name
=
"xzxtcxSqlSessionTemplate"
)
public
SqlSessionTemplate
xzxtcxSqlSessionTemplate
()
throws
Exception
{
return
new
SqlSessionTemplate
(
xzxtcxSqlSessionFactory
());
}
}
hnxtba-core/src/main/resources/application-dev.properties
View file @
2ed45685
...
...
@@ -23,6 +23,12 @@ spring.datasource.xzxtdb.username=XZXT
spring.datasource.xzxtdb.password
=
XZXT
spring.datasource.xzxtdb.driver-class-name
=
oracle.jdbc.driver.OracleDriver
spring.datasource.xzxtdb.type
:
com.alibaba.druid.pool.DruidDataSource
#协同查询配置
spring.datasource.xzxtcxdb.url
=
jdbc:oracle:thin:@127.0.0.1:1521:ORCL
spring.datasource.xzxtcxdb.username
=
XZXT
spring.datasource.xzxtcxdb.password
=
XZXT
spring.datasource.xzxtcxdb.driver-class-name
=
oracle.jdbc.driver.OracleDriver
spring.datasource.xzxtcxdb.type
:
com.alibaba.druid.pool.DruidDataSource
#指纹数据源配置
spring.datasource.amsisdb.url
=
jdbc:oracle:thin:@127.0.0.1:1521:ORCL
spring.datasource.amsisdb.username
=
XZXT
...
...
hnxtba-core/src/main/resources/templates/rygl/ryxxcxlist.html
0 → 100644
View file @
2ed45685
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment