25 changed files with 533 additions and 566 deletions
@ -1,4 +1,4 @@ |
|||
package com.huaxing.data.storage.service.abstracts; |
|||
package com.huaxing.dolphindb.abstracts; |
|||
|
|||
import java.util.Map; |
|||
|
@ -1,6 +1,6 @@ |
|||
package com.huaxing.data.storage.service.base; |
|||
package com.huaxing.dolphindb.base; |
|||
|
|||
import com.huaxing.data.storage.service.abstracts.SqlConverterStatement; |
|||
import com.huaxing.dolphindb.abstracts.SqlConverterStatement; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
@ -1,4 +1,4 @@ |
|||
package com.huaxing.data.dolphindb.config; |
|||
package com.huaxing.dolphindb.config; |
|||
|
|||
import com.xxdb.*; |
|||
import lombok.Getter; |
@ -1,4 +1,4 @@ |
|||
package com.huaxing.data.dolphindb.config; |
|||
package com.huaxing.dolphindb.config; |
|||
|
|||
import com.xxdb.*; |
|||
import lombok.extern.slf4j.Slf4j; |
@ -1,4 +1,4 @@ |
|||
package com.huaxing.data.dolphindb.connection; |
|||
package com.huaxing.dolphindb.connection; |
|||
|
|||
import com.xxdb.DBConnection; |
|||
import lombok.experimental.Accessors; |
@ -1,11 +1,12 @@ |
|||
package com.huaxing.data.dolphindb.connection; |
|||
package com.huaxing.dolphindb.connection; |
|||
|
|||
import com.huaxing.data.dolphindb.config.DolphinDbConfiguration; |
|||
import com.huaxing.data.dolphindb.config.DolphinDbPoolConfiguration; |
|||
import com.huaxing.dolphindb.config.DolphinDbConfiguration; |
|||
import com.huaxing.dolphindb.config.DolphinDbPoolConfiguration; |
|||
import com.xxdb.DBConnection; |
|||
import jakarta.annotation.PostConstruct; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import javax.annotation.PostConstruct; |
|||
|
|||
/** |
|||
* @ProjectName: iot-data-bridge |
|||
* @Package: com.huaxing.data.dolphindb.connection |
@ -1,31 +0,0 @@ |
|||
package com.huaxing.data.dolphindb; |
|||
|
|||
import org.apache.ibatis.session.SqlSessionFactory; |
|||
import org.mybatis.spring.SqlSessionFactoryBean; |
|||
import org.mybatis.spring.SqlSessionTemplate; |
|||
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 org.springframework.core.io.support.ResourcePatternResolver; |
|||
import javax.sql.DataSource; |
|||
|
|||
|
|||
@Configuration |
|||
public class MyBatisConfig { |
|||
@Bean |
|||
public SqlSessionFactory sqlSessionFactory(@Qualifier(value = "dataSource") DataSource dataSource) throws Exception { |
|||
SqlSessionFactoryBean bean = new SqlSessionFactoryBean(); |
|||
bean.setDataSource(dataSource); |
|||
// 设置 Mapper 的 XML 文件位置
|
|||
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); |
|||
bean.setMapperLocations(resolver.getResources("classpath:com/huaxing/data/storage/mapper/*.xml")); |
|||
return bean.getObject(); |
|||
} |
|||
|
|||
|
|||
@Bean |
|||
public SqlSessionTemplate sqlSessionTemplate(SqlSessionFactory sqlSessionFactory) { |
|||
return new SqlSessionTemplate(sqlSessionFactory); |
|||
} |
|||
} |
@ -1,19 +0,0 @@ |
|||
package com.huaxing.data.storage.service.base; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author 孟剑 |
|||
* @date 2025-01-16 16:54 |
|||
*/ |
|||
public interface IDbSqlFactory { |
|||
|
|||
// 生成插入流式语句
|
|||
String generateInsertStreamStatement(String tableName, Map<String, Object> map); |
|||
|
|||
// 生成Stream表查询语句
|
|||
String generateSelectStreamStatement(String tableName, Map<String, Object> map); |
|||
|
|||
// 生成Dfs表查询语句
|
|||
String generateSelectDfsStatement(String tableName, Map<String, Object> map); |
|||
} |
Loading…
Reference in new issue