Merge branch 'yuecheng-project' of http://192.168.2.237:3000/root/kangarooDataCenterV3 into yuecheng-project
This commit is contained in:
commit
aa1b93d053
|
@ -5,22 +5,29 @@ logging:
|
||||||
root: info
|
root: info
|
||||||
encodings: UTF-8
|
encodings: UTF-8
|
||||||
file:
|
file:
|
||||||
# 日志保存路径
|
# 日志保存路径
|
||||||
path: /Users/apple/Desktop/log/local
|
path: /Users/apple/Desktop/log/local
|
||||||
spring:
|
spring:
|
||||||
|
flyway:
|
||||||
|
# 启动flyway migration, 默认为true
|
||||||
|
enabled: false
|
||||||
datasource:
|
datasource:
|
||||||
dynamic:
|
dynamic:
|
||||||
|
druid:
|
||||||
|
filters: stat,log4j2
|
||||||
datasource:
|
datasource:
|
||||||
master:
|
master:
|
||||||
# url: jdbc:mysql://hzya.ufyct.com:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle
|
||||||
# url: jdbc:mysql://hzya.ufyct.com:9096/businesscenterauto?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
username: hzyazt
|
||||||
# username: root
|
|
||||||
# password: bd993088e8a7c3dc5f44441617f9b4bf
|
|
||||||
# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
|
||||||
url: jdbc:mysql://hzya.ufyct.com:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
|
||||||
username: root
|
|
||||||
password: 62e4295b615a30dbf3b8ee96f41c820b
|
password: 62e4295b615a30dbf3b8ee96f41c820b
|
||||||
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
driver-class-name: dm.jdbc.driver.DmDriver
|
||||||
|
# type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
# url: jdbc:mysql://hzya.ufyct.com:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||||
|
# username: root
|
||||||
|
# password: 62e4295b615a30dbf3b8ee96f41c820b
|
||||||
|
# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
||||||
|
# url: jdbc:dm://hzya.ufyct.com:9040/businesscenter?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
|
||||||
|
|
||||||
savefile:
|
savefile:
|
||||||
# 文件保存路径
|
# 文件保存路径
|
||||||
path: /Users/apple/Desktop/log/local
|
path: /Users/apple/Desktop/log/local
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#######################dev环境#######################
|
|
||||||
logging:
|
logging:
|
||||||
#日志级别 指定目录级别
|
#日志级别 指定目录级别
|
||||||
level:
|
level:
|
||||||
|
@ -6,16 +5,23 @@ logging:
|
||||||
encodings: UTF-8
|
encodings: UTF-8
|
||||||
file:
|
file:
|
||||||
# 日志保存路径
|
# 日志保存路径
|
||||||
path: E:\yongansystem\log
|
path: /Users/apple/Desktop/log/local
|
||||||
spring:
|
spring:
|
||||||
|
flyway:
|
||||||
|
# 启动flyway migration, 默认为true
|
||||||
|
enabled: false
|
||||||
datasource:
|
datasource:
|
||||||
dynamic:
|
dynamic:
|
||||||
|
druid:
|
||||||
|
filters: stat,log4j2
|
||||||
datasource:
|
datasource:
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://hzya.ufyct.com:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle
|
||||||
username: root
|
username: hzyazt
|
||||||
password: 62e4295b615a30dbf3b8ee96f41c820b
|
password: 62e4295b615a30dbf3b8ee96f41c820b
|
||||||
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
driver-class-name: dm.jdbc.driver.DmDriver
|
||||||
savefile:
|
savefile:
|
||||||
# 文件保存路径
|
# 文件保存路径
|
||||||
path: E:/yongansystem/webservice/zt/file
|
path: /Users/apple/Desktop/log/local
|
||||||
|
ax:
|
||||||
|
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
|
File diff suppressed because one or more lines are too long
|
@ -1,3 +0,0 @@
|
||||||
ALTER TABLE sys_data_source ADD COLUMN data_state char(1) DEFAULT NULL COMMENT '数据源状态 0校验失败 1校验成功';
|
|
||||||
UPDATE sys_data_source SET data_state = '1';
|
|
||||||
COMMIT;
|
|
|
@ -11,6 +11,7 @@ import org.apache.ibatis.session.SqlSessionFactory;
|
||||||
import org.mybatis.spring.SqlSessionFactoryBean;
|
import org.mybatis.spring.SqlSessionFactoryBean;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
@ -26,103 +27,10 @@ import java.util.Properties;
|
||||||
* @Date: 2020/3/31 10:25
|
* @Date: 2020/3/31 10:25
|
||||||
* 数据源工具类
|
* 数据源工具类
|
||||||
*/
|
*/
|
||||||
//@Component
|
@Component
|
||||||
//@Lazy(value = false)
|
|
||||||
public class DataSourceUtil {
|
public class DataSourceUtil {
|
||||||
//DATASOURCECODE
|
@Bean
|
||||||
public static final ThreadLocal<BaseEntity> myContextThreadLocal = new ThreadLocal<>();
|
public DatabaseIdProvider getDatabaseIdProvider() {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(DataSourceUtil.class);
|
|
||||||
//SqlSessionFactory容器
|
|
||||||
private static final Map<String, SqlSessionFactory> SQLSESSIONFACTORYMAP = new HashMap<>();
|
|
||||||
//dataSource容器
|
|
||||||
private final Map<String, DruidDataSource> DATASOURCEMAP = new HashMap<>();
|
|
||||||
// 通过依赖注入获取 DynamicRoutingDataSource 对象
|
|
||||||
@Resource
|
|
||||||
private DynamicRoutingDataSource ds;
|
|
||||||
/****
|
|
||||||
* 根据dataSourceKey 打开 SqlSession ,如果获取不到SqlSessionFactory 会抛出异常
|
|
||||||
* @content:
|
|
||||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
|
||||||
* @date 2024-02-22 14:50
|
|
||||||
* @param
|
|
||||||
* @return org.apache.ibatis.session.SqlSession
|
|
||||||
**/
|
|
||||||
|
|
||||||
public synchronized static SqlSession getSqlSession() {
|
|
||||||
String dsKey = "master"; // 根据业务逻辑确定要使用的数据源名称
|
|
||||||
BaseEntity entity = DataSourceUtil.myContextThreadLocal.get();
|
|
||||||
if(null != entity ){
|
|
||||||
dsKey = entity.getDataSourceCode();
|
|
||||||
}
|
|
||||||
// 通过 DynamicRoutingDataSource 获取当前数据源
|
|
||||||
// ds.getDataSource(dsKey);
|
|
||||||
|
|
||||||
SqlSessionFactory factory = getSqlSessionFactoryByCache(dsKey);
|
|
||||||
if (null == factory) {
|
|
||||||
throw new BaseSystemException("根据dataSourceKey获取SqlSessionFactory 失败!请联系管理员");
|
|
||||||
} else {
|
|
||||||
return factory.openSession();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/****
|
|
||||||
* 根据dataSourceKey获取缓存内的SqlSessionFactory,如果获取不到会抛出异常信息
|
|
||||||
* @content:
|
|
||||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
|
||||||
* @date 2024-02-22 14:44
|
|
||||||
* @param
|
|
||||||
* @return org.apache.ibatis.session.SqlSessionFactory
|
|
||||||
**/
|
|
||||||
public static SqlSessionFactory getSqlSessionFactoryByCache(String dataSourceKey) {
|
|
||||||
SqlSessionFactory sqlSessionFactory = SQLSESSIONFACTORYMAP.get(dataSourceKey);
|
|
||||||
if (null == sqlSessionFactory) {
|
|
||||||
throw new BaseSystemException("根据当前dataSourceKey获取SqlSessionFactory失败,请联系系统管理员!dataSourceKey:" + dataSourceKey);
|
|
||||||
}
|
|
||||||
return sqlSessionFactory;
|
|
||||||
}
|
|
||||||
|
|
||||||
/****
|
|
||||||
* 根据 dataSource 创建SqlSessionFactory,并放入map缓存 dataSourceKey
|
|
||||||
* @content:
|
|
||||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
|
||||||
* @date 2024-02-22 14:38
|
|
||||||
* @param
|
|
||||||
* @return org.apache.ibatis.session.SqlSessionFactory
|
|
||||||
**/
|
|
||||||
public static SqlSessionFactory createSqlSessionFactoryToCache(String dataSourceKey, DataSource dataSource) {
|
|
||||||
SqlSessionFactory sqlSessionFactory = createSqlSessionFactory(dataSource);
|
|
||||||
SQLSESSIONFACTORYMAP.put(dataSourceKey, sqlSessionFactory);
|
|
||||||
return sqlSessionFactory;
|
|
||||||
}
|
|
||||||
|
|
||||||
//创建sqlSessionFactory
|
|
||||||
public static SqlSessionFactory createSqlSessionFactory(DataSource dataSource) throws BaseSystemException {
|
|
||||||
try {
|
|
||||||
if (null != dataSource) {
|
|
||||||
SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
|
|
||||||
//数据源
|
|
||||||
sqlSessionFactoryBean.setDataSource(dataSource);
|
|
||||||
//mybatis的config文件
|
|
||||||
PathMatchingResourcePatternResolver configLocationResolver = new PathMatchingResourcePatternResolver();
|
|
||||||
sqlSessionFactoryBean.setConfigLocation(configLocationResolver.getResource("classpath:mybatis/mybatis-config.xml"));
|
|
||||||
//xml
|
|
||||||
PathMatchingResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver();
|
|
||||||
sqlSessionFactoryBean.setMapperLocations(resourcePatternResolver.getResources("classpath*:com/hzya/**/*.xml"));
|
|
||||||
sqlSessionFactoryBean.setDatabaseIdProvider(getDatabaseIdProvider());
|
|
||||||
|
|
||||||
return sqlSessionFactoryBean.getObject();
|
|
||||||
} else {
|
|
||||||
logger.info("======================创建sqlSessionFactory失败===========================");
|
|
||||||
throw new BaseSystemException("创建sqlSessionFactory失败");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.info("======================创建sqlSessionFactory失败===========================");
|
|
||||||
throw new BaseSystemException("创建sqlSessionFactory失败" + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static DatabaseIdProvider getDatabaseIdProvider() {
|
|
||||||
//DBMS 后缀
|
//DBMS 后缀
|
||||||
//Oracle oracle
|
//Oracle oracle
|
||||||
//DB2 db2
|
//DB2 db2
|
||||||
|
@ -144,9 +52,4 @@ public class DataSourceUtil {
|
||||||
dbProvider.setProperties(setPro);
|
dbProvider.setProperties(setPro);
|
||||||
return dbProvider;
|
return dbProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, DruidDataSource> getDataSourceMap() {
|
|
||||||
return DATASOURCEMAP;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
13
pom.xml
13
pom.xml
|
@ -29,7 +29,7 @@
|
||||||
<gson.version>2.8.5</gson.version>
|
<gson.version>2.8.5</gson.version>
|
||||||
<zxing.version>3.3.0</zxing.version>
|
<zxing.version>3.3.0</zxing.version>
|
||||||
<hutool.version>5.8.19</hutool.version>
|
<hutool.version>5.8.19</hutool.version>
|
||||||
<druid.version>1.1.22</druid.version>
|
<druid.version>1.2.0</druid.version>
|
||||||
<!-- <mybatis-spring-boot-starter.version>2.2.2</mybatis-spring-boot-starter.version>-->
|
<!-- <mybatis-spring-boot-starter.version>2.2.2</mybatis-spring-boot-starter.version>-->
|
||||||
<mybatis-plus-boot-starter.version>3.5.6</mybatis-plus-boot-starter.version>
|
<mybatis-plus-boot-starter.version>3.5.6</mybatis-plus-boot-starter.version>
|
||||||
<!-- <mysql-connector-j.version>8.0.33</mysql-connector-j.version>-->
|
<!-- <mysql-connector-j.version>8.0.33</mysql-connector-j.version>-->
|
||||||
|
@ -235,7 +235,8 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>druid-spring-boot-starter</artifactId>
|
<artifactId>druid-spring-boot-starter</artifactId>
|
||||||
<version>${druid-spring-boot-starter.version}</version>
|
<version>1.2.23</version>
|
||||||
|
<!-- <version>${druid-spring-boot-starter.version}</version>-->
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
@ -245,6 +246,12 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 添加dm8 jdbc jar 包依赖-->
|
<!-- 添加dm8 jdbc jar 包依赖-->
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>com.dameng</groupId>-->
|
||||||
|
<!-- <artifactId>DmJdbcDriver18</artifactId>-->
|
||||||
|
<!-- <version>8.1.1.193</version>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.dameng</groupId>
|
<groupId>com.dameng</groupId>
|
||||||
<artifactId>Dm8JdbcDriver18</artifactId>
|
<artifactId>Dm8JdbcDriver18</artifactId>
|
||||||
|
@ -252,6 +259,7 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-beanutils</groupId>
|
<groupId>commons-beanutils</groupId>
|
||||||
<artifactId>commons-beanutils</artifactId>
|
<artifactId>commons-beanutils</artifactId>
|
||||||
|
@ -383,6 +391,7 @@
|
||||||
<artifactId>flyway-mysql</artifactId>
|
<artifactId>flyway-mysql</artifactId>
|
||||||
<version>8.5.13</version>
|
<version>8.5.13</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -74,7 +74,7 @@ WHERE
|
||||||
|
|
||||||
|
|
||||||
<!-- 查询 采用==查询 -->
|
<!-- 查询 采用==查询 -->
|
||||||
<select id="sevenerrornum" resultType="com.hzya.frame.home.entity.HomeEntity" parameterType="com.hzya.frame.home.entity.HomeEntity">
|
<select id="sevenerrornum" databaseId="mysql" resultType="com.hzya.frame.home.entity.HomeEntity" parameterType="com.hzya.frame.home.entity.HomeEntity">
|
||||||
SELECT
|
SELECT
|
||||||
count( id ) as abnormalNum,
|
count( id ) as abnormalNum,
|
||||||
DATE_FORMAT( create_time, '%Y-%m-%d' ) as name
|
DATE_FORMAT( create_time, '%Y-%m-%d' ) as name
|
||||||
|
@ -90,7 +90,23 @@ WHERE
|
||||||
'%Y-%m-%d')
|
'%Y-%m-%d')
|
||||||
</select>
|
</select>
|
||||||
<!-- 查询 采用==查询 -->
|
<!-- 查询 采用==查询 -->
|
||||||
<select id="sevensuccessnum" resultType="com.hzya.frame.home.entity.HomeEntity" parameterType="com.hzya.frame.home.entity.HomeEntity">
|
<select id="sevenerrornum" databaseId="oracle" resultType="com.hzya.frame.home.entity.HomeEntity" parameterType="com.hzya.frame.home.entity.HomeEntity">
|
||||||
|
SELECT
|
||||||
|
count( id ) as abnormalNum,
|
||||||
|
DATE_FORMAT( create_time, '%Y-%m-%d' ) as name
|
||||||
|
FROM
|
||||||
|
sys_message_manage_log
|
||||||
|
WHERE sts = 'Y' and status = '4' and
|
||||||
|
create_time between add_days( NOW(), -6 ) AND NOW()
|
||||||
|
GROUP BY
|
||||||
|
DATE_FORMAT( create_time, '%Y-%m-%d' )
|
||||||
|
ORDER BY
|
||||||
|
DATE_FORMAT(
|
||||||
|
create_time,
|
||||||
|
'%Y-%m-%d')
|
||||||
|
</select>
|
||||||
|
<!-- 查询 采用==查询 -->
|
||||||
|
<select id="sevensuccessnum" databaseId="mysql" resultType="com.hzya.frame.home.entity.HomeEntity" parameterType="com.hzya.frame.home.entity.HomeEntity">
|
||||||
SELECT
|
SELECT
|
||||||
count( id ) as normalNum,
|
count( id ) as normalNum,
|
||||||
DATE_FORMAT( create_time, '%Y-%m-%d' ) as name
|
DATE_FORMAT( create_time, '%Y-%m-%d' ) as name
|
||||||
|
@ -105,5 +121,21 @@ WHERE
|
||||||
create_time,
|
create_time,
|
||||||
'%Y-%m-%d')
|
'%Y-%m-%d')
|
||||||
</select>
|
</select>
|
||||||
|
<!-- 查询 采用==查询 -->
|
||||||
|
<select id="sevensuccessnum" databaseId="oracle" resultType="com.hzya.frame.home.entity.HomeEntity" parameterType="com.hzya.frame.home.entity.HomeEntity">
|
||||||
|
SELECT
|
||||||
|
count( id ) as normalNum,
|
||||||
|
DATE_FORMAT( create_time, '%Y-%m-%d' ) as name
|
||||||
|
FROM
|
||||||
|
sys_message_manage_log_success
|
||||||
|
WHERE sts = 'Y' and status = '3' and
|
||||||
|
create_time between add_days( NOW(), -6 ) AND NOW()
|
||||||
|
GROUP BY
|
||||||
|
DATE_FORMAT( create_time, '%Y-%m-%d' )
|
||||||
|
ORDER BY
|
||||||
|
DATE_FORMAT(
|
||||||
|
create_time,
|
||||||
|
'%Y-%m-%d')
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@ import com.hzya.frame.sysnew.userRoles.entity.SysUserRolesEntity;
|
||||||
import com.hzya.frame.util.AESUtil;
|
import com.hzya.frame.util.AESUtil;
|
||||||
import com.hzya.frame.web.entity.BaseResult;
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import dm.jdbc.d.U;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
<include refid="FileDownloadEntity_Base_Column_List" />
|
<include refid="FileDownloadEntity_Base_Column_List" />
|
||||||
from sys_file
|
from sys_file
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="id != null ">id=#{id}</if>
|
<if test="id != null and id !='' ">id=#{id}</if>
|
||||||
<if test="filename != null and filename !='' "> and filename = #{filename}</if>
|
<if test="filename != null and filename !='' "> and filename = #{filename}</if>
|
||||||
<if test="filesavename != null and filesavename !='' "> and filesavename = #{filesavename}</if>
|
<if test="filesavename != null and filesavename !='' "> and filesavename = #{filesavename}</if>
|
||||||
<if test="type != null and type !='' "> and type = #{type}</if>
|
<if test="type != null and type !='' "> and type = #{type}</if>
|
||||||
|
|
|
@ -702,7 +702,7 @@ where id = #{id}
|
||||||
<!-- </trim>-->
|
<!-- </trim>-->
|
||||||
<!-- order by a.sorts asc-->
|
<!-- order by a.sorts asc-->
|
||||||
<!-- </select>-->
|
<!-- </select>-->
|
||||||
<select id="queryVoList" resultType="com.hzya.frame.sysnew.application.api.entity.SysApplicationApiVo" parameterType="com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity">
|
<select id="queryVoList" databaseId="mysql" resultType="com.hzya.frame.sysnew.application.api.entity.SysApplicationApiVo" parameterType="com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity">
|
||||||
select
|
select
|
||||||
a.id,
|
a.id,
|
||||||
a.catalogue_id AS catalogueId,
|
a.catalogue_id AS catalogueId,
|
||||||
|
@ -744,6 +744,48 @@ where id = #{id}
|
||||||
</trim>
|
</trim>
|
||||||
order by a.sorts asc
|
order by a.sorts asc
|
||||||
</select>
|
</select>
|
||||||
|
<select id="queryVoList" databaseId="oracle" resultType="com.hzya.frame.sysnew.application.api.entity.SysApplicationApiVo" parameterType="com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity">
|
||||||
|
select
|
||||||
|
a.id,
|
||||||
|
a.catalogue_id AS catalogueId,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
b.NAME
|
||||||
|
FROM
|
||||||
|
sys_application_api_type b
|
||||||
|
WHERE
|
||||||
|
b.sts = 'Y'
|
||||||
|
AND b.id = a.catalogue_id
|
||||||
|
) AS catalogueName,
|
||||||
|
a.api_name AS apiName,
|
||||||
|
a.api_code AS apiCode,
|
||||||
|
a.api_path AS apiPath,
|
||||||
|
a.destination_address AS destinationAddress,
|
||||||
|
a.api_remark AS apiRemark,
|
||||||
|
0 AS errorCount,
|
||||||
|
a.api_status AS apiStatus,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
WM_CONCAT( d.tripartite_system_id )
|
||||||
|
FROM
|
||||||
|
sys_application_api_auth_detail d
|
||||||
|
WHERE
|
||||||
|
d.app_id = a.app_id
|
||||||
|
AND d.api_id = a.id
|
||||||
|
and d.sts = 'Y'
|
||||||
|
) as authDetail
|
||||||
|
FROM
|
||||||
|
sys_application_api a
|
||||||
|
<trim prefix="where" prefixOverrides="and">
|
||||||
|
<if test="appId != null and appId != ''">and a.app_id = #{appId}</if>
|
||||||
|
<if test="catalogueId != null and catalogueId != ''">and a.catalogue_id = #{catalogueId}</if>
|
||||||
|
<if test="nameOrRemark != null and nameOrRemark != ''">and (a.api_name like concat('%',#{nameOrRemark},'%')
|
||||||
|
or a.api_remark like concat('%',#{nameOrRemark},'%') )
|
||||||
|
</if>
|
||||||
|
and a.sts='Y'
|
||||||
|
</trim>
|
||||||
|
order by a.sorts asc
|
||||||
|
</select>
|
||||||
|
|
||||||
<!-- 查询 采用==查询 -->
|
<!-- 查询 采用==查询 -->
|
||||||
<select id="queryBaseName" resultMap="get-SysApplicationApiEntity-result"
|
<select id="queryBaseName" resultMap="get-SysApplicationApiEntity-result"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
package com.hzya.frame.webapp.web.init;
|
package com.hzya.frame.webapp.web.init;
|
||||||
|
import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
|
||||||
import com.hzya.frame.util.AESUtil;
|
import com.hzya.frame.util.AESUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.flywaydb.core.Flyway;
|
import org.flywaydb.core.Flyway;
|
||||||
|
@ -7,10 +8,12 @@ import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
@Configuration
|
//@Configuration
|
||||||
@RequiredArgsConstructor
|
//@RequiredArgsConstructor
|
||||||
@EnableTransactionManagement
|
//@EnableTransactionManagement
|
||||||
public class FlywayConfig {
|
public class FlywayConfig {
|
||||||
|
|
||||||
@Value("${spring.flyway.enabled}")
|
@Value("${spring.flyway.enabled}")
|
||||||
|
@ -39,13 +42,21 @@ public class FlywayConfig {
|
||||||
private String username;
|
private String username;
|
||||||
@Value("${spring.datasource.dynamic.datasource.master.password}")
|
@Value("${spring.datasource.dynamic.datasource.master.password}")
|
||||||
private String password;
|
private String password;
|
||||||
|
@Resource
|
||||||
|
private DataSource dataSource;
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
|
//@PostConstruct
|
||||||
public void migrateOrder() {
|
public void migrateOrder() {
|
||||||
String pwd = AESUtil.decrypt(password);
|
String pwd = AESUtil.decrypt(password);
|
||||||
|
DynamicRoutingDataSource ds = (DynamicRoutingDataSource) dataSource;
|
||||||
|
DataSource dsDatasource = null;
|
||||||
|
|
||||||
|
dsDatasource = ds.getDataSource("master");
|
||||||
// 将路径转换
|
// 将路径转换
|
||||||
Flyway flyway = Flyway.configure()
|
Flyway flyway = Flyway.configure()
|
||||||
.dataSource(url,username,pwd)
|
//.dataSource(url,username,pwd)
|
||||||
|
.dataSource(dsDatasource)
|
||||||
.cleanDisabled(cleanDisabled)
|
.cleanDisabled(cleanDisabled)
|
||||||
.locations(locations)
|
.locations(locations)
|
||||||
.table(table)
|
.table(table)
|
||||||
|
|
Loading…
Reference in New Issue