Commit 8de57b82 authored by caotao's avatar caotao

1.健康指数当前值的数据源由原来的es切换为从tdengine测点的最后一条固化值。

parent 323862c1
......@@ -54,11 +54,11 @@ import java.net.InetAddress;
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, DruidDataSourceAutoConfigure.class})
//@SpringBootApplication
public class AmosJxiopAnalyseApplication {
// @Autowired
// private EmqKeeper emqKeeper;
//
// @Autowired
// private SyncESDataToTdengineMqttListener syncESDataToTdengineMqttListener;
@Autowired
private EmqKeeper emqKeeper;
@Autowired
private SyncESDataToTdengineMqttListener syncESDataToTdengineMqttListener;
private static final Logger logger = LoggerFactory.getLogger(AmosJxiopAnalyseApplication.class);
......@@ -74,8 +74,9 @@ public class AmosJxiopAnalyseApplication {
+ path + "/doc.html\n" + "----------------------------------------------------------");
}
// @Bean
// public void initMqtt() throws Exception {
// emqKeeper.subscript("sync_esdata_to_tdengine_notice", 2,syncESDataToTdengineMqttListener );
// }
@Bean
public void initMqtt() throws Exception {
//订阅固化周期性数据成功的消息
emqKeeper.subscript("sync_esdata_to_tdengine_notice", 1,syncESDataToTdengineMqttListener );
}
}
......@@ -47,7 +47,7 @@ public interface IndicatorDataMapper extends BaseMapper<IndicatorData> {
@Select("select `value`, created_time from iot_data.indicator_data where id =#{id} and ts >= #{startTime} and ts <= #{endTime} ")
List<IndicatorData> selectDataByequipmentIndexNameAndtimeAndEquipmentNumber(@Param("id") String id, @Param("startTime") String startTime, @Param("endTime") String endTime);
@Select("select `value`,`value_f`, address, gateway_id from iot_data.indicator_data where ts >=NOW()-10m and gateway_id = #{gatewayId} and address in(#{addressIds})")
List<IndicatorData> selectDataByGatewayIdAndAddress(@Param("gatewayId") String gatewayId,@Param("addressIds") String addressIds);
@Select("select `value`,`value_f`, address, gateway_id from iot_data.indicator_data where ts > NOW()-10m and gateway_id = #{gatewayId}")
List<IndicatorData> selectDataByGatewayIdAndAddress(@Param("gatewayId") String gatewayId);
}
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