Commit fd6430b7 authored by chenzhao's avatar chenzhao

修改代码

parent 6549746f
......@@ -15,6 +15,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
/**
*
......@@ -93,12 +94,15 @@ public class IdxBizFanWarningRuleSetController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
public ResponseModel<Page<IdxBizFanWarningRuleSetDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
public ResponseModel<Page<Map<String,Object>>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<IdxBizFanWarningRuleSetDto> page = new Page<IdxBizFanWarningRuleSetDto>();
Page<Map<String,Object>> page = new Page<Map<String,Object>>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(idxBizFanWarningRuleSetServiceImpl.queryForIdxBizFanWarningRuleSetPage(page));
List<Map<String,Object>> data = idxBizFanWarningRuleSetServiceImpl.queryList(current,current*size);
int i = idxBizFanWarningRuleSetServiceImpl.queryListCount();
page.setTotal(i);
return ResponseHelper.buildResponse(page);
}
/**
......
......@@ -3,6 +3,9 @@ package com.yeejoin.amos.boot.module.jxiop.biz.mapper2;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRuleSet;
import java.util.List;
import java.util.Map;
/**
* Mapper 接口
*
......@@ -11,4 +14,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRuleSet;
*/
public interface IdxBizFanWarningRuleSetMapper extends BaseMapper<IdxBizFanWarningRuleSet> {
List<Map<String,Object>> queryList(int current,int size);
int queryListCount();
}
......@@ -975,7 +975,7 @@ public class CommonServiceImpl {
return s;
}
@Scheduled(cron = "0 0/10 * * * ?")
@Scheduled(cron = "0 0/5 * * * ?")
public void healthWarningMinuteByFJ() {
Date time = new Date();
List<IdxBizFanPointProcessVariableClassificationDto> data = idxBizFanPointProcessVariableClassificationMapper.getInfluxDBData();
......@@ -1085,6 +1085,7 @@ public class CommonServiceImpl {
IdxBizFanHealthLevel idxBizFanHealthLevel = idxBizFanHealthLevelMapper.selectOne(query);
idxBizFanHealthIndex.setHealthLevel(idxBizFanHealthLevel.getHealthLevel());
idxBizFanHealthIndex.setAnalysisType("按时刻");
idxBizFanHealthIndex.setAnalysisObjType("测点");
idxBizFanHealthIndex.setANOMALY(object.getDouble("scoreValue"));
idxBizFanHealthIndexs.add(idxBizFanHealthIndex);
}
......@@ -1209,6 +1210,7 @@ public class CommonServiceImpl {
IdxBizPvHealthLevel idxBizFanHealthLevel = idxBizPvHealthLevelMapper.selectOne(query);
idxBizFanHealthIndex.setHealthLevel(idxBizFanHealthLevel.getHealthLevel());
idxBizFanHealthIndex.setAnalysisType("按时刻");
idxBizFanHealthIndex.setAnalysisObjType("测点");
idxBizFanHealthIndex.setANOMALY(object.getDouble("scoreValue"));
idxBizPvHealthIndexs.add(idxBizFanHealthIndex);
}
......
......@@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
import java.util.Map;
/**
* 服务实现类
......@@ -31,4 +32,12 @@ public class IdxBizFanWarningRuleSetServiceImpl extends BaseService<IdxBizFanWar
public List<IdxBizFanWarningRuleSetDto> queryForIdxBizFanWarningRuleSetList() {
return this.queryForList("" , false);
}
public List<Map<String,Object>> queryList(int current,int size) {
return this.getBaseMapper().queryList( current, size);
}
public int queryListCount() {
return this.getBaseMapper().queryListCount();
}
}
\ No newline at end of file
......@@ -2,4 +2,31 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanWarningRuleSetMapper">
<select id="queryList" resultType="map">
SELECT *,
(
SELECT zy.WARNING_IF
FROM `idx_biz_fan_warning_rule_set` zy
WHERE zy.WARNING_NAME = '注意'
LIMIT 1 ) AS WARNING_ZY,
(
SELECT zy.WARNING_IF
FROM `idx_biz_fan_warning_rule_set` zy
WHERE zy.WARNING_NAME = '危险'
LIMIT 1) AS WARNING_WX
FROM
`idx_biz_fan_warning_rule_set`
WHERE
WARNING_NAME = '警告'
Limit #{current},#{size}
</select>
<select id="queryListCount" resultType="INT">
SELECT count(1)
FROM
`idx_biz_fan_warning_rule_set` WHERE
WARNING_NAME = '警告'
</select>
</mapper>
......@@ -5,8 +5,8 @@
<select id="timingTemporarysSorageData" resultType="map">
SELECT
avg(value) as value ,
SELECT FORMAT( avg(value),2)as value ,
created_time as createdTime ,
equipmentIndexName
FROM
......
......@@ -590,8 +590,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public void schedAddAlarmEventData(String gatewayId, String stationId, String stationName, long currentsort) {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
queryCondtion.put(CommonConstans.QueryStringSystemType, Arrays.asList("光字牌"));
queryCondtion.put(CommonConstans.QueryStringValue, Arrays.asList("false"));
queryCondtion.put(CommonConstans.QueryStringSystemTypeKeyword, Arrays.asList("光字牌"));
queryCondtion.put(CommonConstans.QueryStringValueKeyword, Arrays.asList("false"));
List<ESEquipments> indicatorsDtoList = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
List<AlarmEvent> newAlarmEvents = new ArrayList<>();
List<String> alarmsNames = new ArrayList<>();
......
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