Commit 883405a2 authored by caotao's avatar caotao

1.接口返回新增测点id方便处理多余数据

2.新增通过excel更新数据
parent 46bf449b
package com.yeejoin.amos.boot.module.jxiop.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mysql.cj.x.protobuf.MysqlxCrud;
import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.RunRecord;
import com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator;
import org.apache.ibatis.annotations.Param;
......@@ -17,22 +14,7 @@ import java.util.Map;
* @createDate: 2023/7/3
*/
public interface MonitorFanIndicatorMapper extends BaseMapper<MonitorFanIndicator> {
//批量修改
void UpdateMonitorFanIndicator(@Param(value = "list") List<IndexDto> list);
Integer queryByPageTotal(@Param("equipmentNumber") String equipmentNumber,
@Param("gateway") String gateway,
@Param("frontModule") String frontModule);
List<MonitorFanIndicator> queryByPage(@Param("size") long size,
@Param("equipmentNumber") String equipmentNumber,
@Param("gateway") String gateway,
@Param("frontModule") String frontModule,
@Param("offset") int offset);
Object getIndicatoralueAvage(String gateway,String indicator);
Object getIndicatoralueTotal(String gateway,String indicator);
List<Map<String, String>> getFanConfigPower(@Param("gatewayId") String gatewayId,
@Param("equipmentNum") String equipmentNum);
......
<?xml version="1.0" encoding="UTF-8"?>
<!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.api.mapper.MonitorFanIndicatorMapper">
<update id="UpdateMonitorFanIndicator">
update monitor_fan_indicator
<trim prefix="set" suffixOverrides=",">
<trim prefix="indicator_value=case" suffix="end,">
<foreach collection="list" item="item" index="index">
when address_gateway=#{item.equipmentsIdx} then #{item.valueLabel}
</foreach>
</trim>
<trim prefix="indicator_time=case" suffix="end,">
<foreach collection="list" item="item" index="index">
when address_gateway=#{item.equipmentsIdx} then #{item.createdTime}
</foreach>
</trim>
</trim>
where address_gateway in
<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
#{item.equipmentsIdx}
</foreach>
</update>
<select id="queryByPage" resultType="com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator">
select * from monitor_fan_indicator
<where>
<if test="equipmentNumber != null and equipmentNumber !=''">
equipment_number = #{equipmentNumber}
</if>
<if test="gateway != null and gateway !=''">
AND gateway = #{gateway}
</if>
<if test="frontModule != null and frontModule !=''">
AND front_module = #{frontModule}
</if>
</where>
limit #{offset}, #{size}
</select>
<select id="queryByPageTotal" resultType="java.lang.Integer">
select count(1) from monitor_fan_indicator
<where>
<if test="equipmentNumber != null and equipmentNumber !=''">
equipment_number = #{equipmentNumber}
</if>
<if test="gateway != null and gateway !=''">
AND gateway = #{gateway}
</if>
<if test="frontModule != null and frontModule !=''">
AND front_module = #{frontModule}
</if>
</where>
</select>
<select id="getIndicatoralueAvage" resultType="Object">
SELECT AVG(indicator_value) wind_speed
FROM monitor_fan_indicator
WHERE gateway=#{gateway} and
indicator like concat('%',#{indicator},'%')
</select>
<select id="getIndicatoralueTotal" resultType="Object">
SELECT SUM(indicator_value) wind_speed
FROM monitor_fan_indicator
WHERE gateway=#{gateway} and
indicator like concat('%',#{indicator},'%')
</select>
<select id="getFanConfigPower" resultType="java.util.Map">
select
sequence_nbr as id,
......
......@@ -14,7 +14,7 @@ import java.util.Map;
*/
public interface IMonitorFanIndicator {
//批量修改指标值
void UpdateMonitorFanIndicator(List<IndexDto> list);
// void UpdateMonitorFanIndicator(List<IndexDto> list);
// ResultsData getNationWideInfo( int current, int size, String stationBasicId, String equipmentNumber);
// ResultsData getLsNationWideInfo( int current, int size, String stationBasicId, String equipmentNumber);
......
......@@ -115,13 +115,6 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
private List<Map> list;
@Override
public void UpdateMonitorFanIndicator(List<IndexDto> list) {
monitorFanIndicatorregionMapper.UpdateMonitorFanIndicator(list);
}
public ResultsData getNationWideInfo(int current, int size, String gateway, String equipmentNumber) {
......@@ -287,9 +280,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
* @param indicator
* @return
*/
public Object getIndicatoralueAvage(String gateway, String indicator) {
return monitorFanIndicatorregionMapper.getIndicatoralueAvage(gateway, indicator);
}
// public Object getIndicatoralueAvage(String gateway, String indicator) {
// return monitorFanIndicatorregionMapper.getIndicatoralueAvage(gateway, indicator);
// }
/**
......@@ -299,9 +292,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
* @param indicator
* @return
*/
public Object getIndicatoralueTotal(String gateway, String indicator) {
return monitorFanIndicatorregionMapper.getIndicatoralueTotal(gateway, indicator);
}
// public Object getIndicatoralueTotal(String gateway, String indicator) {
// return monitorFanIndicatorregionMapper.getIndicatoralueTotal(gateway, indicator);
// }
public StationBasic getOneByStationNumber(String stationId) {
......
package com.yeejoin.amos.boot.module.jxiop.biz.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
@Data
public class PointImportDto {
@ExcelProperty("网关")
private String gatewayId ;
@ExcelProperty("模块")
private String frontModule;
@ExcelProperty("类型")
private String systemType;
@ExcelProperty("排序号")
private String traceId;
@ExcelProperty("测点名称")
private String equipmentIndexName;
@ExcelProperty("显示名称")
private String displayName;
@ExcelProperty("单位")
private String unit;
}
......@@ -13,8 +13,6 @@ import java.util.Map;
* @createDate: 2023/7/3
*/
public interface IMonitorFanIndicator {
//批量修改指标值
void UpdateMonitorFanIndicator(List<IndexDto> list);
ResultsData getNationWideInfo( int current, int size, String stationBasicId, String equipmentNumber);
ResultsData getLsNationWideInfo( int current, int size, String stationBasicId, String equipmentNumber);
......
......@@ -117,10 +117,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
private List<Map> list;
@Override
public void UpdateMonitorFanIndicator(List<IndexDto> list) {
monitorFanIndicatorregionMapper.UpdateMonitorFanIndicator(list);
}
@Override
public ResultsData getNationWideInfo(int current, int size, String gateway, String equipmentNumber) {
......@@ -294,28 +291,10 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
return treeDto;
}
/**
* 根据网关与指标获取指标的平均值
*
* @param gateway
* @param indicator
* @return
*/
public Object getIndicatoralueAvage(String gateway, String indicator) {
return monitorFanIndicatorregionMapper.getIndicatoralueAvage(gateway, indicator);
}
/**
* 根据网关与指标获取指标的总值
*
* @param gateway
* @param indicator
* @return
*/
public Object getIndicatoralueTotal(String gateway, String indicator) {
return monitorFanIndicatorregionMapper.getIndicatoralueTotal(gateway, indicator);
}
public StationBasic getOneByStationNumber(String stationId) {
......
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