Commit 05ed8c82 authored by wujiang's avatar wujiang

升级tdengine

parent 2ecbea5a
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<dependency> <dependency>
<groupId>com.taosdata.jdbc</groupId> <groupId>com.taosdata.jdbc</groupId>
<artifactId>taos-jdbcdriver</artifactId> <artifactId>taos-jdbcdriver</artifactId>
<version>2.0.30</version> <version>3.2.4</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -47,7 +47,7 @@ public class TdHygfJpInverterWarnDto { ...@@ -47,7 +47,7 @@ public class TdHygfJpInverterWarnDto {
private String thirdCode; private String thirdCode;
@ApiModelProperty(value = "状态") @ApiModelProperty(value = "状态")
private int state; private String state;
@ApiModelProperty(value = "时间") @ApiModelProperty(value = "时间")
private Long time; private Long time;
......
...@@ -87,7 +87,7 @@ public class TdHygfJpInverterWarn { ...@@ -87,7 +87,7 @@ public class TdHygfJpInverterWarn {
* 状态 * 状态
*/ */
@TableField("state") @TableField("state")
private int state; private String state;
/** /**
* 时间 * 时间
......
...@@ -25,7 +25,7 @@ import java.util.Properties; ...@@ -25,7 +25,7 @@ import java.util.Properties;
* @createDate: 2023/9/19 * @createDate: 2023/9/19
*/ */
@Configuration @Configuration
@MapperScan(basePackages = "com.xiaotian.datatrans.mapper.tdenginemapper", sqlSessionTemplateRef = "tdengineSqlSessionTemplate") @MapperScan(basePackages = "com.yeejoin.amos.boot.module.hygf.api.tdenginemapper", sqlSessionTemplateRef = "tdengineSqlSessionTemplate")
public class TDengineServerConfig { public class TDengineServerConfig {
......
...@@ -5,10 +5,14 @@ import java.util.List; ...@@ -5,10 +5,14 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto; import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpCollector;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterWarn; import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterWarn;
import com.yeejoin.amos.boot.module.hygf.api.service.ITdHygfJpInverterWarnService; import com.yeejoin.amos.boot.module.hygf.api.service.ITdHygfJpInverterWarnService;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterWarnMapper; import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterWarnMapper;
...@@ -28,9 +32,22 @@ public class TdHygfJpInverterWarnServiceImpl ...@@ -28,9 +32,22 @@ public class TdHygfJpInverterWarnServiceImpl
*/ */
public Page<TdHygfJpInverterWarnDto> queryForTdHygfJpInverterWarnPage(Page<TdHygfJpInverterWarnDto> page, public Page<TdHygfJpInverterWarnDto> queryForTdHygfJpInverterWarnPage(Page<TdHygfJpInverterWarnDto> page,
TdHygfJpInverterWarnDto tdHygfJpInverterWarnDto) { TdHygfJpInverterWarnDto tdHygfJpInverterWarnDto) {
Map<String, Object> params = new HashMap<>(); Page<TdHygfJpInverterWarn> entiryPage = new Page<>(page.getCurrent(), page.getSize());
params.put("state", tdHygfJpInverterWarnDto.getState()); LambdaQueryWrapper<TdHygfJpInverterWarn> wrapper = new LambdaQueryWrapper<>();
return this.queryForPage(page, null, false, params); if (tdHygfJpInverterWarnDto.getState() != null) {
wrapper.eq(TdHygfJpInverterWarn::getState, tdHygfJpInverterWarnDto.getState());
}
entiryPage = (Page<TdHygfJpInverterWarn>) this.page(entiryPage, wrapper);
if (!ValidationUtil.isEmpty(entiryPage.getRecords())) {
page.setTotal(entiryPage.getTotal());
page.setPages(entiryPage.getPages());
page.setCurrent(entiryPage.getCurrent());
page.setSize(entiryPage.getSize());
if (!ValidationUtil.isEmpty(entiryPage.getRecords()))
page.setRecords(Bean.toModels(entiryPage.getRecords(), this.getModelClass()));
}
return page;
} }
/** /**
......
...@@ -22,8 +22,8 @@ spring.datasource.mysql-service.connection-timeout: 30000 ...@@ -22,8 +22,8 @@ spring.datasource.mysql-service.connection-timeout: 30000
spring.datasource.tdengine-service.driver-class-name=com.taosdata.jdbc.TSDBDriver spring.datasource.tdengine-service.driver-class-name=com.taosdata.jdbc.rs.RestfulDriver
spring.datasource.tdengine-service.jdbc-url=jdbc:TAOS://139.9.170.47:6041/house_pv_data?user=root&password=taosdata&timezone=GMT+8 spring.datasource.tdengine-service.jdbc-url=jdbc:TAOS-RS://139.9.170.47:6041/house_pv_data?user=root&password=taosdata&timezone=GMT+8
spring.datasource.tdengine-service.username=root spring.datasource.tdengine-service.username=root
spring.datasource.tdengine-service.password=taosdata spring.datasource.tdengine-service.password=taosdata
spring.datasource.tdengine-service.type=com.zaxxer.hikari.HikariDataSource spring.datasource.tdengine-service.type=com.zaxxer.hikari.HikariDataSource
......
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