Commit 556ddc02 authored by zhangsen's avatar zhangsen

时序图

parent ef34eeda
package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvPointProcessVariableClassification;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -114,4 +116,12 @@ public class AnalyseController extends BaseController {
}
return ResponseHelper.buildResponse(commonServiceImpl.getInfluxdbDataByConditon(stationType,pointId,startTime, endTime)) ;
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "根据测点查单位信息", notes = "根据测点查单位信息")
@GetMapping(value = "/getUnitByIndexAddress")
public ResponseModel<Map<String, String>> getUnitByIndexAddress(@RequestParam String stationType, @RequestParam String pointId) {
return ResponseHelper.buildResponse(commonServiceImpl.getUnitByIndexAddress(stationType, pointId));
}
}
......@@ -1258,4 +1258,17 @@ public class CommonServiceImpl {
}
public Map<String, String> getUnitByIndexAddress(String stationType, String pointId) {
IndicatorData indicatorData = new IndicatorData();
if ("FD".equals(stationType)) {
IdxBizFanPointProcessVariableClassification indexAddress = idxBizFanPointProcessVariableClassificationMapper.selectOne(new QueryWrapper<IdxBizFanPointProcessVariableClassification>().eq("INDEX_ADDRESS", pointId));
indicatorData = indicatorDataMapper.selectUnitByAddressAndGatewayId(indexAddress.getIndexAddress(), indexAddress.getGatewayId());
} else {
IdxBizPvPointProcessVariableClassification indexAddress = idxBizPvPointProcessVariableClassificationMapper.selectOne(new QueryWrapper<IdxBizPvPointProcessVariableClassification>().eq("INDEX_ADDRESS", pointId));
indicatorData = indicatorDataMapper.selectUnitByAddressAndGatewayId(indexAddress.getIndexAddress(), indexAddress.getGatewayId());
}
HashMap<String, String> resultMap = new HashMap<>();
resultMap.put("title", indicatorData.getUnit());
return resultMap;
}
}
......@@ -14,4 +14,8 @@ public interface IndicatorDataMapper extends BaseMapper<IndicatorData> {
@Select("select `value`, created_time as createdTime, `value_f` as valueF from iot_data.indicator_data where address=#{address} and created_time >= #{startTime} and created_time <= #{endTime} and gateway_id =#{gatewayId}")
List<IndicatorData> selectDataByAddressAndtime(@Param("address")String address,@Param("startTime") String startTime, @Param("endTime")String endTime, @Param("gatewayId")String gatewayId);
@Select("select `unit` from iot_data.indicator_data where address=#{address} and gateway_id =#{gatewayId} limit 1")
IndicatorData selectUnitByAddressAndGatewayId(@Param("address")String address, @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