Commit c85b235e authored by caotao's avatar caotao

1.智能分析优化

parent ae2e105c
package com.yeejoin.amos.boot.module.jxiop.biz.controller; package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizC80c;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizHjev;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -14,15 +12,16 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper; ...@@ -14,15 +12,16 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author system_generator * @author system_generator
* @date 2023-08-11 * @date 2023-08-11
*/ */
@RestController @RestController
@Api(tags = "工况测点Controller") @Api(tags = "智能分析")
@RequestMapping(value = "/test") @RequestMapping(value = "/analyse")
public class TestController extends BaseController { public class AnalyseController extends BaseController {
@Autowired @Autowired
CommonServiceImpl commonServiceImpl; CommonServiceImpl commonServiceImpl;
...@@ -45,4 +44,11 @@ public class TestController extends BaseController { ...@@ -45,4 +44,11 @@ public class TestController extends BaseController {
public void getConditionVariablesByTimeAnalyse1(@RequestParam String startTime, @RequestParam String endTime) { public void getConditionVariablesByTimeAnalyse1(@RequestParam String startTime, @RequestParam String endTime) {
commonServiceImpl.getConditionVariablesByTimeAnalyse1(startTime, endTime); commonServiceImpl.getConditionVariablesByTimeAnalyse1(startTime, endTime);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "获取influxdb数据", notes = "获取influxdb数据")
@GetMapping(value = "/getInfluxdbDataByConditon")
public ResponseModel<List<Map<String, Object>>> getInfluxdbDataByConditon(@RequestParam String gateaway, @RequestParam String indictorName, @RequestParam String startTime, @RequestParam String endTime) {
return ResponseHelper.buildResponse(commonServiceImpl.getInfluxdbDataByConditon(gateaway,indictorName,startTime, endTime)) ;
}
} }
...@@ -388,7 +388,7 @@ public class CommonServiceImpl { ...@@ -388,7 +388,7 @@ public class CommonServiceImpl {
} }
public List<Map<String, Object>> getInfluxdbDataByConditon(String gateaway,String indictorName,String startTime,String endTime) { public List<Map<String, Object>> getInfluxdbDataByConditon(String gateaway,String indictorName,String startTime,String endTime) {
String sql = String.format("select * from iot_data_%s where indictorName='%s' and time > '%s' and time < 'endTime' )",gateaway,indictorName,startTime,endTime); String sql = String.format("select * from iot_data_%s where indictorName='%s' and time > '%s' and time < '%s' ;",gateaway,indictorName,startTime,endTime);
return influxdbUtil.query(sql); return influxdbUtil.query(sql);
} }
} }
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