Commit ac98443f authored by hezhuozhi's avatar hezhuozhi

27467 智能分析时序图、新增健康等级、监测设备重复

parent 9eb74b69
......@@ -48,8 +48,8 @@ public class AnalyseController extends BaseController {
@Autowired
CommonServiceImpl commonServiceImpl;
@Autowired
IdxBizFanHealthIndexMapper idxBizFanHealthIndexMapper;
// @Autowired
// IdxBizFanHealthIndexMapper idxBizFanHealthIndexMapper;
@Autowired
IAlarmInfoDetailService iAlarmInfoDetailService;
......@@ -242,12 +242,12 @@ public class AnalyseController extends BaseController {
|| CharSequenceUtil.isEmpty(map.get("EQUIPINDEX").toString())) {
return ResponseHelper.buildResponse(new HashMap<>());
}
LambdaQueryWrapper<IdxBizFanHealthIndex> indexLambdaQueryWrapper = new LambdaQueryWrapper<>();
indexLambdaQueryWrapper.eq(IdxBizFanHealthIndex::getStation, map.get("STATION"));
indexLambdaQueryWrapper.eq(IdxBizFanHealthIndex::getEquipmentName, map.get("EQUIPNAME"));
indexLambdaQueryWrapper.eq(IdxBizFanHealthIndex::getPointName, map.get("EQUIPINDEX")).last("limit 1");
LambdaQueryWrapper<FanHealthIndex> indexLambdaQueryWrapper = new LambdaQueryWrapper<>();
indexLambdaQueryWrapper.eq(FanHealthIndex::getStation, map.get("STATION"));
indexLambdaQueryWrapper.eq(FanHealthIndex::getEquipmentName, map.get("EQUIPNAME"));
indexLambdaQueryWrapper.eq(FanHealthIndex::getPointName, map.get("EQUIPINDEX")).last("limit 1");
List<IdxBizFanHealthIndex> idxBizFanHealthIndices = idxBizFanHealthIndexMapper
List<FanHealthIndex> idxBizFanHealthIndices = fanHealthIndexMapper
.selectList(indexLambdaQueryWrapper);
if (CollectionUtils.isNotEmpty(idxBizFanHealthIndices)) {
pointId = idxBizFanHealthIndices.get(0).getIndexAddress();
......
......@@ -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;
/**
*
......@@ -101,6 +102,13 @@ public class IdxBizFanHealthLevelController extends BaseController {
return ResponseHelper.buildResponse(idxBizFanHealthLevelServiceImpl.queryForIdxBizFanHealthLevelPage(page));
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "健康等级划分", notes = "健康等级划分")
@GetMapping(value = "/queryHealthLevel")
public ResponseModel<List<Map<String,Object>>> queryHealthLevel() {
return ResponseHelper.buildResponse(idxBizFanHealthLevelServiceImpl.queryHealthLevel());
}
/**
* 列表全部数据查询
*
......
......@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthLevel;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* Mapper 接口
*
......@@ -26,4 +29,9 @@ public interface IdxBizFanHealthLevelMapper extends BaseMapper<IdxBizFanHealthLe
@Param("groupLowerLimit") String groupLowerLimit,
@Param("analysisObjType") String analysisObjType,
@Param("healthLevel") String healthLevel);
/**
* 查询健康等级
* @return
*/
List<Map<String, Object>> queryHealthLevel();
}
......@@ -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 IdxBizFanHealthLevelServiceImpl extends BaseService<IdxBizFanHealth
public List<IdxBizFanHealthLevelDto> queryForIdxBizFanHealthLevelList() {
return this.queryForList("" , false);
}
/**
* 查询健康等级
* @return
*/
public List<Map<String,Object>> queryHealthLevel() {
return this.baseMapper.queryHealthLevel();
}
}
\ No newline at end of file
......@@ -11,7 +11,7 @@ import java.util.Map;
public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
@Select("<script>"+
"SELECT `health_index` AS healthIndex,anomaly,rec_date as recDate, `health_index` AS `value`, substr(analysis_time,1,10) as analysisTime, station,equipment_name AS equipmentName,point_name as pointName, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" +
"SELECT distinct `health_index` AS healthIndex,anomaly,rec_date as recDate, `health_index` AS `value`, substr(analysis_time,1,10) as analysisTime, station,equipment_name AS equipmentName,point_name as pointName, ( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" +
"<if test='endTimeTop!= null'> and ts &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and ts &gt;= #{startTimeTop} </if> " +
"<if test='area!= null'> AND area = #{area} </if> " +
......@@ -34,7 +34,8 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
@Select("<script>"+
"SELECT count(1) FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" +
"SELECT count(1) from ( SELECT distinct `health_index` AS healthIndex,anomaly,rec_date as recDate, `health_index` AS `value`, substr(analysis_time,1,10) as analysisTime, station,equipment_name AS equipmentName,point_name as pointName,\n" +
"( CASE HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '警告' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS status FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} and org_code is not null" +
"<if test='endTimeTop!= null'> and ts &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and ts &gt;= #{startTimeTop} </if> " +
"<if test='area!= null'> AND area = #{area} </if> " +
......@@ -44,7 +45,7 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
"<if test='healthLevel!= null'>AND health_level = #{healthLevel} </if>" +
"<if test='subSystem!= null'>AND sub_system = #{subSystem} </if> " +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
"<if test='orgCode!= null'>AND org_code like '${orgCode}' </if>" +
"<if test='orgCode!= null'>AND org_code like '${orgCode}' </if>)" +
"</script>")
int selectDataTotal(@Param("healthLevel")String healthLevel,@Param("area")String area,@Param("equipmentName")String equipmentName,@Param("subSystem")String subSystem,@Param("analysisType")String analysisType,@Param("analysisObjType")String analysisObjType,@Param("station")String station,@Param("pointName")String pointName, @Param("indexAddress")String indexAddress,@Param("startTimeTop") String startTimeTop, @Param("endTimeTop")String endTimeTop, @Param("orgCode")String orgCode);
......
......@@ -27,4 +27,8 @@
ANALYSIS_OBJ_TYPE = #{analysisObjType}
AND HEALTH_LEVEL = #{healthLevel}
</update>
<select id="queryHealthLevel" resultType="java.util.Map">
SELECT * FROM idx_biz_fan_health_level where ANALYSIS_OBJ_TYPE = '全域' ORDER BY GROUP_UPPER_LIMIT DESC
</select>
</mapper>
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