Commit a585c478 authored by chenzhao's avatar chenzhao

分析PC端接口开发

parent 4da056ab
......@@ -112,4 +112,12 @@ public class IdxBizFanHealthIndexController extends BaseController {
public ResponseModel<List<IdxBizFanHealthIndexDto>> selectForList() {
return ResponseHelper.buildResponse(idxBizFanHealthIndexServiceImpl.queryForIdxBizFanHealthIndexList());
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测风机层左侧列表", notes = "预警监测风机层左侧列表")
@GetMapping(value = "/tableLeftList")
public ResponseModel<List<IdxBizFanHealthIndexDto>> queryForLeftTableList(String STATION,String HEALTHLEVEL) {
return ResponseHelper.buildResponse(idxBizFanHealthIndexServiceImpl.queryForLeftTableList(STATION,HEALTHLEVEL));
}
}
......@@ -112,4 +112,11 @@ public class IdxBizPvHealthIndexController extends BaseController {
public ResponseModel<List<IdxBizPvHealthIndexDto>> selectForList() {
return ResponseHelper.buildResponse(idxBizPvHealthIndexServiceImpl.queryForIdxBizPvHealthIndexList());
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "预警监测设备级左侧列表", notes = "预警监测设备级左侧列表")
@GetMapping(value = "/queryForLeftTableListByEquip")
public ResponseModel<List<IdxBizPvHealthIndexDto>> queryForLeftTableListByEquip(@RequestParam(required = false) String STATION,@RequestParam(required = false) String SUBARRAY,@RequestParam(required = false) String HEALTHLEVEL) {
return ResponseHelper.buildResponse(idxBizPvHealthIndexServiceImpl.queryForLeftTableListByEquip(STATION,SUBARRAY,HEALTHLEVEL));
}
}
......@@ -9,17 +9,17 @@ import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
/**
*
*
* @author system_generator
* @date 2023-08-15
*/
@Data
@ApiModel(value="IdxBizPvHealthIndexDto", description="")
@ApiModel(value = "IdxBizPvHealthIndexDto", description = "")
public class IdxBizPvHealthIndexDto {
private static final long serialVersionUID = 1L;
......@@ -32,7 +32,7 @@ public class IdxBizPvHealthIndexDto {
private String record;
@TableField("REC_DATE")
private LocalDateTime recDate;
private Date recDate;
@TableField("REC_USER_ID")
private String recUserId;
......@@ -66,10 +66,10 @@ public class IdxBizPvHealthIndexDto {
private String analysisType;
@TableField("ANALYSIS_START_TIME")
private LocalDateTime analysisStartTime;
private Date analysisStartTime;
@TableField("ANALYSIS_END_TIME")
private LocalDateTime analysisEndTime;
private Date analysisEndTime;
@ApiModelProperty(value = "片区")
@TableField("ARAE")
......@@ -103,4 +103,16 @@ public class IdxBizPvHealthIndexDto {
@TableField("EQUIPMENT_NAME")
private String equipmentName;
@TableField("ANOMALY")
private Double ANOMALY;
/**
* 分析变量名称
*/
@TableField("POINT_NAME")
private String pointName;
@TableField("ANALYSIS_TIME")
private String ANALYSISTIME;
}
......@@ -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.dto.FullViewRecallDataDTO;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanHealthIndexDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthIndex;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthLevel;
import org.apache.ibatis.annotations.Param;
......@@ -97,4 +98,6 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List<String> getAddressInfo();
List<IdxBizFanHealthIndexDto> queryForLeftTableList(String STATION,String HEALTHLEVEL);
}
package com.yeejoin.amos.boot.module.jxiop.biz.mapper2;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvHealthIndexDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvHealthIndex;
import java.util.List;
/**
* Mapper 接口
*
......@@ -11,4 +14,5 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvHealthIndex;
*/
public interface IdxBizPvHealthIndexMapper extends BaseMapper<IdxBizPvHealthIndex> {
List<IdxBizPvHealthIndexDto> queryForLeftTableListByEquip(String STATION, String SUBARRAY, String HEALTHLEVEL);
}
......@@ -31,4 +31,8 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth
public List<IdxBizFanHealthIndexDto> queryForIdxBizFanHealthIndexList() {
return this.queryForList("" , false);
}
public List<IdxBizFanHealthIndexDto> queryForLeftTableList(String STATION,String HEALTHLEVEL){
return this.getBaseMapper().queryForLeftTableList(STATION,HEALTHLEVEL);
}
}
\ No newline at end of file
......@@ -31,4 +31,13 @@ public class IdxBizPvHealthIndexServiceImpl extends BaseService<IdxBizPvHealthIn
public List<IdxBizPvHealthIndexDto> queryForIdxBizPvHealthIndexList() {
return this.queryForList("" , false);
}
public List<IdxBizPvHealthIndexDto> queryForLeftTableListByEquip(String STATION,String SUBARRAY,String HEALTHLEVEL) {
return this.getBaseMapper().queryForLeftTableListByEquip(STATION,SUBARRAY,HEALTHLEVEL);
}
}
\ No newline at end of file
......@@ -824,4 +824,43 @@
<select id="getAddressInfo" resultType="java.lang.String">
select index_address from wl_equipment_specific_index where gateway_id = '1668801435891929089' and data_type = 'analog' limit 100
</select>
<select id="queryForLeftTableList" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizFanHealthIndexDto">
SELECT
b.*,
IFNULL( ibfhi.HEALTH_INDEX, 100 ) as HEALTH_INDEX ,
IFNULL( ibfhi.HEALTH_LEVEL, '安全' ) as HEALTH_LEVEL,
(case ibfhi.HEALTH_LEVEL
WHEN '危险' THEN 3
WHEN '告警' THEN 2
WHEN '注意' THEN 1
ELSE 0 end) as status
FROM
(
SELECT
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` AS `EQUIPMENT_NAME`,
`idx_biz_fan_point_process_variable_classification`.`STATION` AS `STATION`
FROM
`idx_biz_fan_point_process_variable_classification`
WHERE
`idx_biz_fan_point_process_variable_classification`.`TAG_CODE` = '分析变量'
GROUP BY
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME`
ORDER BY
`idx_biz_fan_point_process_variable_classification`.`EQUIPMENT_NAME` ASC
) b
LEFT JOIN `idx_biz_fan_health_index` `ibfhi` ON ( ( `b`.`EQUIPMENT_NAME` = `ibfhi`.`EQUIPMENT_NAME` ) )
AND ibfhi.ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_OBJ_TYPE = '设备' AND ANALYSIS_TYPE = '按天' AND DATE_FORMAT(ibfhi.REC_DATE,"%Y-%m-%d") = DATE_FORMAT(NOW(),"%Y-%m-%d")
<where>
<if test="STATION != '' AND STATION != null">
b.STATION = #{STATION}
</if>
<if test="HEALTH_LEVEL != '' AND HEALTH_LEVEL != null">
AND HEALTH_LEVEL = #{HEALTHLEVEL}
</if>
</where>
</select>
</mapper>
......@@ -2,4 +2,34 @@
<!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.IdxBizPvHealthIndexMapper">
<select id="queryForLeftTableListByEquip" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvHealthIndexDto">
SELECT
b.SEQUENCE_NBR,
b.ARAE,
b.STATION,
b.EQUIPMENT_NAME,
b.HEALTH_INDEX,
b.HEALTH_LEVEL,
CONCAT( '子阵 ', b.SUBARRAY ) AS 子阵,
( CASE b.HEALTH_LEVEL WHEN '危险' THEN 3 WHEN '告警' THEN 2 WHEN '注意' THEN 1 ELSE 0 END ) AS STATUS,
b.REC_DATE,
b.SUBARRAY
FROM
`idx_biz_pv_health_index` b
WHERE
DATE_FORMAT(b.REC_DATE,"%Y-%m-%d") = DATE_FORMAT(NOW(),"%Y-%m-%d") AND b.ANALYSIS_OBJ_TYPE = '设备' AND b.ANALYSIS_TYPE = '按天'
<if test="SUBARRAY != '' and SUBARRAY != null">
AND b.SUBARRAY = #{SUBARRAY}
</if>
<if test="STATION != '' and STATION != null">
AND b.STATION = #{STATION}
</if>
<if test="HEALTHLEVEL != '' and HEALTHLEVEL != null">
AND b.HEALTH_LEVEL = #{HEALTHLEVEL}
</if>
</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