Explorar el Código

TD数据查询接口V3

yuanchao hace 4 meses
padre
commit
e8b9148435

+ 1 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/TDDeviceMapper.java

@@ -23,7 +23,7 @@ public interface TDDeviceMapper extends BaseMapperX<TDDeviceDO> {
     @Select("SELECT * FROM iot_log.device_${deviceName} WHERE ts between #{ts} and #{ts1}")
     @DS("tdengine")
     @TenantIgnore
-    List<DeviceVO> selectBySpan(@Param("deviceName") String tableName, @Param("ts") Timestamp ts);
+    List<DeviceVO> selectBySpan(@Param("deviceName") String tableName, @Param("ts") Timestamp ts,@Param("ts1") Timestamp ts1);
 
     @Select("SELECT * FROM iot_log.device_${deviceName} WHERE ts = #{ts}")
     @DS("tdengine")

+ 1 - 2
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/DeviceServiceImpl.java

@@ -28,11 +28,10 @@ public class DeviceServiceImpl implements IDeviceService {
      * @param
      * @return 设备
      */
-    @Cacheable(value = "device", key = "#root.methodName + '_' + #deviceId", unless = "#result == null")
     // TODO 22--slaveId
     @Override
     public List<DeviceVO> selectBySpan(DeviceVO deviceVO) {
-        List<DeviceVO> device = deviceMapper.selectBySpan(deviceVO.getDeviceName(),deviceVO.getTs());
+        List<DeviceVO> device = deviceMapper.selectBySpan(deviceVO.getDeviceName(),deviceVO.getTs(),deviceVO.getTs1());
         return device;
     }