Commit f2aacfb2 authored by tangwei's avatar tangwei

解决冲突

parents 79288489 3c58a8bb
......@@ -5,6 +5,7 @@ import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
......@@ -15,11 +16,10 @@ import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallDataDTO;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallInfoDTO;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.*;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthIndexMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthLevelMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanWarningRecordMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.*;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRuleSetServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvWarningRuleSetServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
......@@ -72,6 +72,13 @@ public class BigScreenAnalyseController extends BaseController {
@Autowired
RiskWarningFeign riskWarningFeign;
@Autowired
private IdxBizFanWarningRuleSetServiceImpl idxBizFanWarningRuleSetService;
@Autowired
private IdxBizPvWarningRuleSetServiceImpl idxBizPvWarningRuleSetService;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "场站设备健康状态指数与趋势 - 仪表盘", notes = "场站设备健康状态指数与趋势 - 仪表盘")
@GetMapping(value = "/getHealthScoreInfo")
......@@ -1019,4 +1026,87 @@ public class BigScreenAnalyseController extends BaseController {
return ResponseHelper.buildResponse(map);
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "修改业务事实表的一条数据")
@PutMapping("/updateRowAndManyTable")
public ResponseModel<Boolean> updateRowAndManyTable(@RequestBody Map<String, Object> kv) {
if ("安全".equals(kv.get("HEALTH_LEVEL").toString())
&& (!"100.0".equals(kv.get("GROUP_UPPER_LIMIT").toString())
&& !"100".equals(kv.get("GROUP_UPPER_LIMIT").toString()))) {
throw new RuntimeException("安全的分数上限只能是100");
}
if ("危险".equals(kv.get("HEALTH_LEVEL").toString())
&& (!"0.0".equals(kv.get("GROUP_LOWER_LIMIT").toString())
&& !"0".equals(kv.get("GROUP_LOWER_LIMIT").toString()))) {
throw new RuntimeException("危险的分数下限只能是0");
}
idxBizFanHealthLevelMapper.updateByInfo(
"idx_biz_pv_health_level",
kv.get("GROUP_UPPER_LIMIT").toString(),
kv.get("GROUP_LOWER_LIMIT").toString(),
kv.get("ANALYSIS_OBJ_TYPE").toString(),
kv.get("HEALTH_LEVEL").toString());
idxBizFanHealthLevelMapper.updateByInfo(
"idx_biz_fan_health_level",
kv.get("GROUP_UPPER_LIMIT").toString(),
kv.get("GROUP_LOWER_LIMIT").toString(),
kv.get("ANALYSIS_OBJ_TYPE").toString(),
kv.get("HEALTH_LEVEL").toString());
if ("安全".equals(kv.get("HEALTH_LEVEL").toString())) {
idxBizFanHealthLevelMapper.updateByInfoIsNull(
"idx_biz_fan_health_level",
kv.get("GROUP_LOWER_LIMIT").toString(),
null,
kv.get("ANALYSIS_OBJ_TYPE").toString(),
"注意");
idxBizFanHealthLevelMapper.updateByInfoIsNull(
"idx_biz_pv_health_level",
kv.get("GROUP_LOWER_LIMIT").toString(),
null,
kv.get("ANALYSIS_OBJ_TYPE").toString(),
"注意");
} else if ("注意".equals(kv.get("HEALTH_LEVEL").toString())) {
idxBizFanHealthLevelMapper.updateByInfoIsNull(
"idx_biz_fan_health_level",
kv.get("GROUP_LOWER_LIMIT").toString(),
null,
kv.get("ANALYSIS_OBJ_TYPE").toString(),
"警告");
idxBizFanHealthLevelMapper.updateByInfoIsNull(
"idx_biz_pv_health_level",
kv.get("GROUP_LOWER_LIMIT").toString(),
null,
kv.get("ANALYSIS_OBJ_TYPE").toString(),
"警告");
} else if ("警告".equals(kv.get("HEALTH_LEVEL").toString())) {
idxBizFanHealthLevelMapper.updateByInfoIsNull(
"idx_biz_fan_health_level",
kv.get("GROUP_LOWER_LIMIT").toString(),
null,
kv.get("ANALYSIS_OBJ_TYPE").toString(),
"危险");
idxBizFanHealthLevelMapper.updateByInfoIsNull(
"idx_biz_pv_health_level",
kv.get("GROUP_LOWER_LIMIT").toString(),
null,
kv.get("ANALYSIS_OBJ_TYPE").toString(),
"危险");
}
if ("测点".equals(kv.get("ANALYSIS_OBJ_TYPE").toString())) {
LambdaUpdateWrapper<IdxBizFanWarningRuleSet> lambda1 = new LambdaUpdateWrapper<>();
lambda1.set(IdxBizFanWarningRuleSet::getWarningIf, "<=" + kv.get("GROUP_UPPER_LIMIT").toString());
lambda1.eq(IdxBizFanWarningRuleSet::getWarningName, kv.get("HEALTH_LEVEL").toString());
idxBizFanWarningRuleSetService.update(lambda1);
LambdaUpdateWrapper<IdxBizPvWarningRuleSet> lambda2 = new LambdaUpdateWrapper<>();
lambda2.set(IdxBizPvWarningRuleSet::getWarningIf, "<=" + kv.get("GROUP_UPPER_LIMIT").toString());
lambda2.eq(IdxBizPvWarningRuleSet::getWarningName, kv.get("HEALTH_LEVEL").toString());
idxBizPvWarningRuleSetService.update(lambda2);
}
return ResponseHelper.buildResponse(true);
}
}
......@@ -2,6 +2,7 @@ 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.IdxBizFanHealthLevel;
import org.apache.ibatis.annotations.Param;
/**
* Mapper 接口
......@@ -11,4 +12,18 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthLevel;
*/
public interface IdxBizFanHealthLevelMapper extends BaseMapper<IdxBizFanHealthLevel> {
int updateByInfo(@Param("tableName") String tableName,
@Param("groupUpperLimit") String groupUpperLimit,
@Param("groupLowerLimit") String groupLowerLimit,
@Param("analysisObjType") String analysisObjType,
@Param("healthLevel") String healthLevel);
/**
* 可以为空的情况
*/
int updateByInfoIsNull(@Param("tableName") String tableName,
@Param("groupUpperLimit") String groupUpperLimit,
@Param("groupLowerLimit") String groupLowerLimit,
@Param("analysisObjType") String analysisObjType,
@Param("healthLevel") String healthLevel);
}
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import cn.hutool.http.HttpUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
......@@ -15,6 +18,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvPointProcessVariableCl
import com.yeejoin.amos.boot.module.jxiop.biz.entity.*;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.*;
import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper;
import javafx.scene.control.Tab;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
......@@ -35,7 +39,11 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.DateTimeUtil;
import tech.tablesaw.api.DoubleColumn;
import tech.tablesaw.api.StringColumn;
import tech.tablesaw.api.Table;
import java.io.File;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -1499,6 +1507,21 @@ public class CommonServiceImpl {
}
while (totle == 0){
try {
SearchHits<ESEquipments> searchHits = elasticsearchTemplate.search(queryBuilder.build(), ESEquipments.class);
for (SearchHit searchHit : searchHits.getSearchHits()) {
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(searchHit.getContent());
ESEquipments eSAlertCalled = JSONObject.toJavaObject(jsonObject, ESEquipments.class);
equipments.add(eSAlertCalled);
}
totle = searchHits.getTotalHits();
} catch (Exception e) {
// TODO: handle exception
}
}
for (IdxBizFanPointProcessVariableClassificationDto datum : data) {
for (ESEquipments equipment : equipments) {
if (equipment.getAddress().equals(datum.getIndexAddress()) && equipment.getGatewayId().equals(datum.getGatewayId())) {
......@@ -1514,6 +1537,20 @@ public class CommonServiceImpl {
ArrayList<Object> stdDevList = new ArrayList<>();
ArrayList<Object> centerValueList = new ArrayList<>();
ArrayList<Object> analysisVariableIdList = new ArrayList<>();
List<Double> analysisVariable = new ArrayList<>();
List<Double> stdDev = new ArrayList<>();
List<Double> centerValue = new ArrayList<>();
List<String> analysisVariableId = new ArrayList<>();
List<Double> ProcessPoint1= new ArrayList<>();
List<Double> ProcessPoint2 = new ArrayList<>();
List<Double> ProcessPoint3 = new ArrayList<>();
List<String> ProcessPoint1Id = new ArrayList<>();
List<String> ProcessPoint2Id = new ArrayList<>();
List<String> ProcessPoint3Id = new ArrayList<>();
List<String> analysisVariableIds = new ArrayList<>();
for (IdxBizFanPointVarCentralValue idxBizUhef : idxBizUhefs) {
double value1 = 0.00;
double value2 = 0.00;
......@@ -1540,9 +1577,25 @@ public class CommonServiceImpl {
&&(null == idxBizUhef.getProcess3Min() || idxBizUhef.getProcess3Min() <= value3 ) && (null ==idxBizUhef.getProcess3Max() || value3 <= idxBizUhef.getProcess3Max())) {
if (!analysisVariableIdList.contains(idxBizUhef.getAnalysisPointId())){
analysisVariableList.add(value4);
analysisVariable.add(value4);
ProcessPoint1Id.add(idxBizUhef.getProcessPoint1Id());
ProcessPoint2Id.add(idxBizUhef.getProcessPoint2Id());
ProcessPoint3Id.add(idxBizUhef.getProcessPoint3Id());
analysisVariableIds.add(idxBizUhef.getAnalysisPointId());
ProcessPoint1.add(value1);
ProcessPoint2.add(value2);
ProcessPoint3.add(value3);
stdDevList.add(idxBizUhef.getAnalysisStdDev());
stdDev.add(idxBizUhef.getAnalysisStdDev());
centerValueList.add(idxBizUhef.getAnalysisCenterValue());
centerValue.add(idxBizUhef.getAnalysisCenterValue());
analysisVariableIdList.add(idxBizUhef.getAnalysisPointId());
analysisVariableId.add(idxBizUhef.getAnalysisPointId());
}
}
}
......@@ -1552,6 +1605,17 @@ public class CommonServiceImpl {
requestMap.put("centerValue", centerValueList);
requestMap.put("analysisVariableId", analysisVariableIdList);
Table healthData = Table.create("healthData");
healthData.addColumns(DoubleColumn.create("analysisVariable",analysisVariable),
DoubleColumn.create("stdDev",stdDev),
DoubleColumn.create("centerValue",centerValue),
StringColumn.create("ProcessPoint1Id",ProcessPoint1Id),
DoubleColumn.create("ProcessPoint1",ProcessPoint1),
StringColumn.create("ProcessPoint2Id",ProcessPoint2Id),
DoubleColumn.create("ProcessPoint2",ProcessPoint2),
StringColumn.create("ProcessPoint3Id",ProcessPoint3Id),
DoubleColumn.create("ProcessPoint3",ProcessPoint3),
StringColumn.create("analysisVariableId",analysisVariableIds));
logger.info("------------------------------------------开始调用健康指数计算算法开始----------------------------------------");
String response = HttpUtil.createPost(baseUrlZSFX).body(JSON.toJSONString(requestMap)).execute().body();
......@@ -1562,6 +1626,19 @@ public class CommonServiceImpl {
JSONArray scoreValueArray = jsonObject.getJSONArray("scoreValue");
JSONArray analysisVariableIdArray = jsonObject.getJSONArray("analysisVariableId");
List<String> jsonArrayToStringList = JSONObject.parseArray(analysisVariableIdArray.toJSONString(),String.class);
List<Double> scoreValue = JSONObject.parseArray(scoreValueArray.toJSONString(),Double.class);
List<Double> indexValue = JSONObject.parseArray(indexValueArray.toJSONString(),Double.class);
// Table resultTable = Table.create("healthData");
healthData.addColumns( StringColumn.create("analysisVariableIdResult",jsonArrayToStringList),
DoubleColumn.create("indexValue",indexValue), DoubleColumn.create("scoreValue",scoreValue));
System.out.println(healthData.print());
try {
healthData.write().csv(new Date().getTime()+"fj.csv");
}catch (Exception e){
e.printStackTrace();
}
LambdaQueryWrapper<IdxBizFanPointProcessVariableClassification> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(IdxBizFanPointProcessVariableClassification::getSequenceNbr, jsonArrayToStringList);
List<IdxBizFanPointProcessVariableClassification> list = idxBizFanPointProcessVariableClassificationMapper.selectList(queryWrapper);
......@@ -1579,7 +1656,7 @@ public class CommonServiceImpl {
if (analysisVariableIdArray.get(i).toString().equals(obj.getSequenceNbr())){
IdxBizFanHealthIndex idxBizFanHealthIndex = new IdxBizFanHealthIndex();
BeanUtils.copyProperties(obj, idxBizFanHealthIndex,"sequenceNbr");
idxBizFanHealthIndex.setHealthIndex(indexValueArray.getDoubleValue(i)< 0 ? 0 : indexValueArray.getDoubleValue(i));
idxBizFanHealthIndex.setHealthIndex(indexValueArray.getDoubleValue(i)< 0 ? Math.abs(indexValueArray.getDoubleValue(i)) : indexValueArray.getDoubleValue(i));
idxBizFanHealthIndex.setAnalysisObjSeq(obj.getSequenceNbr());
idxBizFanHealthIndex.setRecDate(time);
// idxBizFanHealthIndex.setSequenceNbr(null);
......@@ -1674,6 +1751,20 @@ public class CommonServiceImpl {
ArrayList<Object> stdDevList = new ArrayList<>();
ArrayList<Object> centerValueList = new ArrayList<>();
ArrayList<Object> analysisVariableIdList = new ArrayList<>();
List<Double> analysisVariable = new ArrayList<>();
List<Double> stdDev = new ArrayList<>();
List<Double> centerValue = new ArrayList<>();
List<String> analysisVariableId = new ArrayList<>();
List<Double> ProcessPoint1= new ArrayList<>();
List<Double> ProcessPoint2 = new ArrayList<>();
List<Double> ProcessPoint3 = new ArrayList<>();
List<String> ProcessPoint1Id = new ArrayList<>();
List<String> ProcessPoint2Id = new ArrayList<>();
List<String> ProcessPoint3Id = new ArrayList<>();
List<String> analysisVariableIds = new ArrayList<>();
for (IdxBizPvPointVarCentralValue idxBizUhef : idxBizUhefs) {
double value1 = 0.00;
double value2 = 0.00;
......@@ -1698,9 +1789,26 @@ public class CommonServiceImpl {
&&(null == idxBizUhef.getProcess3Min() || idxBizUhef.getProcess3Min() <= value3 ) && (null ==idxBizUhef.getProcess3Max() || value3 <= idxBizUhef.getProcess3Max())) {
if (!analysisVariableIdList.contains(idxBizUhef.getAnalysisPointId())){
analysisVariableList.add(value4);
analysisVariable.add(value4);
ProcessPoint1Id.add(idxBizUhef.getProcessPoint1Id());
ProcessPoint2Id.add(idxBizUhef.getProcessPoint2Id());
ProcessPoint3Id.add(idxBizUhef.getProcessPoint3Id());
analysisVariableIds.add(idxBizUhef.getAnalysisPointId());
ProcessPoint1.add(value1);
ProcessPoint2.add(value2);
ProcessPoint3.add(value3);
stdDevList.add(idxBizUhef.getAnalysisStdDev());
stdDev.add(idxBizUhef.getAnalysisStdDev());
centerValueList.add(idxBizUhef.getAnalysisCenterValue());
centerValue.add(idxBizUhef.getAnalysisCenterValue());
analysisVariableIdList.add(idxBizUhef.getAnalysisPointId());
analysisVariableId.add(idxBizUhef.getAnalysisPointId());
}
}
}
......@@ -1708,6 +1816,18 @@ public class CommonServiceImpl {
requestMap.put("stdDev", stdDevList);
requestMap.put("centerValue", centerValueList);
requestMap.put("analysisVariableId", analysisVariableIdList);
Table healthData = Table.create("healthData");
healthData.addColumns(DoubleColumn.create("analysisVariable",analysisVariable),
DoubleColumn.create("stdDev",stdDev),
DoubleColumn.create("centerValue",centerValue),
StringColumn.create("ProcessPoint1Id",ProcessPoint1Id),
DoubleColumn.create("ProcessPoint1",ProcessPoint1),
StringColumn.create("ProcessPoint2Id",ProcessPoint2Id),
DoubleColumn.create("ProcessPoint2",ProcessPoint2),
StringColumn.create("ProcessPoint3Id",ProcessPoint3Id),
DoubleColumn.create("ProcessPoint3",ProcessPoint3),
StringColumn.create("analysisVariableId",analysisVariableIds));
logger.info("------------------------------------------开始调用健康指数计算算法开始----------------------------------------");
String response = HttpUtil.createPost(baseUrlZSFX).body(JSON.toJSONString(requestMap)).execute().body();
JSONObject jsonObject = JSON.parseObject(response);
......@@ -1716,6 +1836,19 @@ public class CommonServiceImpl {
JSONArray scoreValueArray = jsonObject.getJSONArray("scoreValue");
JSONArray analysisVariableIdArray = jsonObject.getJSONArray("analysisVariableId");
List<String> jsonArrayToStringList = JSONObject.parseArray(analysisVariableIdArray.toJSONString(),String.class);
List<Double> scoreValue = JSONObject.parseArray(scoreValueArray.toJSONString(),Double.class);
List<Double> indexValue = JSONObject.parseArray(indexValueArray.toJSONString(),Double.class);
// Table resultTable = Table.create("healthData");
healthData.addColumns( StringColumn.create("analysisVariableIdResult",jsonArrayToStringList),
DoubleColumn.create("indexValue",indexValue), DoubleColumn.create("scoreValue",scoreValue));
System.out.println(healthData.print());
try {
healthData.write().csv(new Date().getTime()+"gf.csv");
}catch (Exception e){
e.printStackTrace();
}
LambdaQueryWrapper<IdxBizPvPointProcessVariableClassification> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(IdxBizPvPointProcessVariableClassification::getSequenceNbr, jsonArrayToStringList);
List<IdxBizPvPointProcessVariableClassification> list = idxBizPvPointProcessVariableClassificationMapper.selectList(queryWrapper);
......@@ -1735,7 +1868,7 @@ public class CommonServiceImpl {
IdxBizPvHealthIndex idxBizPvHealthIndex = new IdxBizPvHealthIndex();
BeanUtils.copyProperties(obj, idxBizPvHealthIndex, "sequenceNbr");
// idxBizPvHealthIndex.setSequenceNbr(null);
idxBizPvHealthIndex.setHealthIndex(indexValueArray.getDoubleValue(i)< 0 ? 0 : indexValueArray.getDoubleValue(i));
idxBizPvHealthIndex.setHealthIndex(indexValueArray.getDoubleValue(i)< 0 ? Math.abs(indexValueArray.getDoubleValue(i)) : indexValueArray.getDoubleValue(i));
idxBizPvHealthIndex.setAnalysisObjSeq(obj.getSequenceNbr());
idxBizPvHealthIndex.setRecDate(time);
idxBizPvHealthIndex.setWeigth(1.0);
......
......@@ -275,6 +275,7 @@ public class HealthStatusIndicatorServiceImpl {
LambdaQueryWrapper<IdxBizPvHealthIndex> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IdxBizPvHealthIndex::getAnalysisType,"按小时");
wrapper.ne(IdxBizPvHealthIndex::getHealthLevel,"安全");
wrapper.eq(IdxBizPvHealthIndex::getAnalysisObjType,"测点");
wrapper.ge(IdxBizPvHealthIndex::getRecDate,df.format(calendar.getTime()));
wrapper.orderByDesc(IdxBizPvHealthIndex::getRecDate);
List<IdxBizPvHealthIndex> healthIndices = idxBizPvHealthIndexMapper.selectList(wrapper);
......@@ -712,6 +713,7 @@ public class HealthStatusIndicatorServiceImpl {
LambdaQueryWrapper<IdxBizFanHealthIndex> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IdxBizFanHealthIndex::getAnalysisType,"按小时");
wrapper.eq(IdxBizFanHealthIndex::getAnalysisObjType,"测点");
wrapper.ne(IdxBizFanHealthIndex::getHealthLevel,"安全");
wrapper.ge(IdxBizFanHealthIndex::getRecDate,df.format(calendar.getTime()));
wrapper.orderByDesc(IdxBizFanHealthIndex::getRecDate);
......@@ -722,7 +724,7 @@ public class HealthStatusIndicatorServiceImpl {
List<String> collect = healthIndices.stream().map(IdxBizFanHealthIndex::getAnalysisObjSeq).collect(Collectors.toList());
LambdaQueryWrapper<IdxBizFanWarningRuleSet> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(IdxBizFanWarningRuleSet::getAnalysisType,"小时");
queryWrapper.eq(IdxBizFanWarningRuleSet::getAnalysisType,"小时");
queryWrapper.in(IdxBizFanWarningRuleSet::getAnalysisPointId,collect);
List<IdxBizFanWarningRuleSet> idxBizPvWarningRules = idxBizFanWarningRuleSetMapper.selectList(queryWrapper);
......
......@@ -292,7 +292,8 @@
count(1) as num,
(select count(1) from ${tableName} as tb
<where>
tb.DISPOSOTION_STATE = '未处置'
((tb.DISPOSOTION_STATE = '未处置')
or (tb.DISPOSOTION_STATE = '已处置' and tb.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
and tb.POINT_NAME = a.POINT_NAME
<if test="areaCode != null and areaCode != ''">
and tb.ARAE like concat('%', #{areaCode}, '%')
......
......@@ -2,4 +2,29 @@
<!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.IdxBizFanHealthLevelMapper">
<update id="updateByInfo">
UPDATE ${tableName}
<if test="groupLowerLimit != null and groupLowerLimit != ''">
set GROUP_LOWER_LIMIT = #{groupLowerLimit}
</if>
<if test="groupUpperLimit != null and groupUpperLimit != ''">
, GROUP_UPPER_LIMIT = #{groupUpperLimit}
</if>
WHERE
ANALYSIS_OBJ_TYPE = #{analysisObjType}
AND HEALTH_LEVEL = #{healthLevel}
</update>
<update id="updateByInfoIsNull">
UPDATE ${tableName}
<if test="groupLowerLimit != null and groupLowerLimit != ''">
set GROUP_LOWER_LIMIT = #{groupLowerLimit}
</if>
<if test="groupUpperLimit != null and groupUpperLimit != ''">
set GROUP_UPPER_LIMIT = #{groupUpperLimit}
</if>
WHERE
ANALYSIS_OBJ_TYPE = #{analysisObjType}
AND HEALTH_LEVEL = #{healthLevel}
</update>
</mapper>
......@@ -198,7 +198,7 @@
POINT_NAME ,
STATION,
CAST(HEALTH_INDEX AS UNSIGNED) as HEALTH_INDEX,
CAST(HEALTH_INDEX AS UNSIGNED) as value
CAST(HEALTH_INDEX AS UNSIGNED) as value,
HEALTH_LEVEL,
SUBARRAY,
REC_DATE,
......
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