|
@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import javax.annotation.security.PermitAll;
|
|
|
import javax.validation.Valid;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
@@ -32,7 +33,13 @@ public class DeviceController {
|
|
|
@Operation(summary = "获取一段时间内的设备数据")
|
|
|
@PermitAll
|
|
|
public CommonResult<List<DeviceVO>> getRunningSpanDataInfo(@Valid DeviceVO device) {
|
|
|
- return success(deviceService.selectBySpan(device));
|
|
|
+ List<DeviceVO> result = new ArrayList<>();
|
|
|
+ if(device.getTs()==null&&device.getTs1()==null){
|
|
|
+ result = deviceService.selectNew(device);
|
|
|
+ }else{
|
|
|
+ result = deviceService.selectBySpan(device);
|
|
|
+ }
|
|
|
+ return success(result);
|
|
|
}
|
|
|
|
|
|
/**
|