|
@@ -2,10 +2,15 @@ package com.bizmatics.controller.web;
|
|
|
|
|
|
|
|
|
|
import com.bizmatics.common.core.bean.ApiResult;
|
|
import com.bizmatics.common.core.bean.ApiResult;
|
|
|
|
+import com.bizmatics.common.core.util.DateUtils;
|
|
import com.bizmatics.model.Device;
|
|
import com.bizmatics.model.Device;
|
|
|
|
+import com.bizmatics.model.HtAnalogData;
|
|
import com.bizmatics.persistence.mapper.DeviceMapper;
|
|
import com.bizmatics.persistence.mapper.DeviceMapper;
|
|
|
|
+import com.bizmatics.persistence.mapper.HtAnalogDataMapper;
|
|
import com.bizmatics.service.DeviceService;
|
|
import com.bizmatics.service.DeviceService;
|
|
import com.bizmatics.service.vo.DeviceCountVO;
|
|
import com.bizmatics.service.vo.DeviceCountVO;
|
|
|
|
+import lombok.Synchronized;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -23,6 +28,7 @@ import java.util.List;
|
|
* @author ya
|
|
* @author ya
|
|
* @since 2021-07-07
|
|
* @since 2021-07-07
|
|
*/
|
|
*/
|
|
|
|
+@Slf4j
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/device")
|
|
@RequestMapping("/device")
|
|
public class DeviceController {
|
|
public class DeviceController {
|
|
@@ -32,6 +38,9 @@ public class DeviceController {
|
|
@Autowired
|
|
@Autowired
|
|
private DeviceMapper deviceMapper;
|
|
private DeviceMapper deviceMapper;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private HtAnalogDataMapper htAnalogDataMapper;
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* 查询设备总数
|
|
* 查询设备总数
|
|
@@ -60,7 +69,10 @@ public class DeviceController {
|
|
List<Device> list = deviceMapper.list(1, null, null, null, null, null);
|
|
List<Device> list = deviceMapper.list(1, null, null, null, null, null);
|
|
List<String> list1 = new ArrayList<>();
|
|
List<String> list1 = new ArrayList<>();
|
|
for (Device device:list) {
|
|
for (Device device:list) {
|
|
- list1.add(device.getDeviceCode());
|
|
|
|
|
|
+ long l = System.currentTimeMillis();
|
|
|
|
+ List<HtAnalogData> list2 = htAnalogDataMapper.list(DateUtils.addYears(new Date(), -10), new Date(), device.getDeviceCode());
|
|
|
|
+ long e = System.currentTimeMillis();
|
|
|
|
+ log.info("一个站点的数据获取时间"+(e-l));
|
|
}
|
|
}
|
|
return list1;
|
|
return list1;
|
|
}
|
|
}
|