单站监控-单体电池列表分页
This commit is contained in:
@ -2,11 +2,15 @@ package com.xzzn.web.controller.ems;
|
|||||||
|
|
||||||
import com.xzzn.common.core.controller.BaseController;
|
import com.xzzn.common.core.controller.BaseController;
|
||||||
import com.xzzn.common.core.domain.AjaxResult;
|
import com.xzzn.common.core.domain.AjaxResult;
|
||||||
|
import com.xzzn.common.core.page.TableDataInfo;
|
||||||
|
import com.xzzn.ems.domain.vo.BatteryDataStatsListVo;
|
||||||
import com.xzzn.ems.service.IEmsSiteService;
|
import com.xzzn.ems.service.IEmsSiteService;
|
||||||
import com.xzzn.ems.service.ISingleSiteService;
|
import com.xzzn.ems.service.ISingleSiteService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* 单站监控
|
* 单站监控
|
||||||
@ -106,9 +110,11 @@ public class EmsSiteMonitorController extends BaseController{
|
|||||||
* 获取电池簇下面的单体电池数据
|
* 获取电池簇下面的单体电池数据
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getClusterDataInfoList")
|
@GetMapping("/getClusterDataInfoList")
|
||||||
public AjaxResult getClusterDataInfoList(@RequestParam String clusterDeviceId)
|
public TableDataInfo getClusterDataInfoList(@RequestParam String clusterDeviceId)
|
||||||
{
|
{
|
||||||
return success(iSingleSiteService.getClusterDataInfoList(clusterDeviceId));
|
startPage();
|
||||||
|
List<BatteryDataStatsListVo> list = iSingleSiteService.getClusterDataInfoList(clusterDeviceId);
|
||||||
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2,14 +2,15 @@ package com.xzzn.ems.domain.vo;
|
|||||||
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单站监控-单体电池数据
|
* 单站监控-单体电池数据
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class BatteryDataStatsListVo {
|
public class BatteryDataStatsListVo {
|
||||||
/** 月份 */
|
/** 单体电池设备id */
|
||||||
private String dataMonth;
|
private String deviceId;
|
||||||
|
|
||||||
/** 电压 (V) */
|
/** 电压 (V) */
|
||||||
private BigDecimal voltage;
|
private BigDecimal voltage;
|
||||||
@ -23,12 +24,14 @@ public class BatteryDataStatsListVo {
|
|||||||
/** SOH (%) */
|
/** SOH (%) */
|
||||||
private BigDecimal soh;
|
private BigDecimal soh;
|
||||||
|
|
||||||
public String getDataMonth() {
|
private Date updateTime;
|
||||||
return dataMonth;
|
|
||||||
|
public String getDeviceId() {
|
||||||
|
return deviceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDataMonth(String dataMonth) {
|
public void setDeviceId(String deviceId) {
|
||||||
this.dataMonth = dataMonth;
|
this.deviceId = deviceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getVoltage() {
|
public BigDecimal getVoltage() {
|
||||||
@ -62,4 +65,12 @@ public class BatteryDataStatsListVo {
|
|||||||
public void setSoh(BigDecimal soh) {
|
public void setSoh(BigDecimal soh) {
|
||||||
this.soh = soh;
|
this.soh = soh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,8 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.xzzn.ems.domain.EmsBatteryData;
|
import com.xzzn.ems.domain.EmsBatteryData;
|
||||||
import com.xzzn.ems.domain.vo.BMSBatteryClusterDataList;
|
|
||||||
import com.xzzn.ems.domain.vo.BatteryClusterDataDetailVo;
|
import com.xzzn.ems.domain.vo.BatteryClusterDataDetailVo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import com.xzzn.ems.domain.vo.BatteryDataStatsListVo;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,4 +85,11 @@ public interface EmsBatteryDataMapper
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<Map<String, Object>> getDataIdsMap(BatteryClusterDataDetailVo dataVo);
|
public List<Map<String, Object>> getDataIdsMap(BatteryClusterDataDetailVo dataVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据电池簇设备id获取下面所有单体电池
|
||||||
|
* @param clusterDeviceId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<BatteryDataStatsListVo> getAllBatteryDataByClusterId(String clusterDeviceId);
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ public interface ISingleSiteService
|
|||||||
|
|
||||||
public List<EmsCoolingData> getCoolingDataList(String siteId);
|
public List<EmsCoolingData> getCoolingDataList(String siteId);
|
||||||
|
|
||||||
public BatteryDataStatsListVo getClusterDataInfoList(String clusterDeviceId);
|
public List<BatteryDataStatsListVo> getClusterDataInfoList(String clusterDeviceId);
|
||||||
|
|
||||||
public List<AmmeterDataVo> getAmmeterDataList(String siteId);
|
public List<AmmeterDataVo> getAmmeterDataList(String siteId);
|
||||||
}
|
}
|
||||||
|
@ -268,8 +268,9 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public BatteryDataStatsListVo getClusterDataInfoList(String clusterDeviceId) {
|
public List<BatteryDataStatsListVo> getClusterDataInfoList(String clusterDeviceId) {
|
||||||
BatteryDataStatsListVo batteryDataStatsListVo = new BatteryDataStatsListVo();
|
List<BatteryDataStatsListVo> batteryDataStatsListVo = new ArrayList<>();
|
||||||
|
batteryDataStatsListVo = emsBatteryDataMapper.getAllBatteryDataByClusterId(clusterDeviceId);
|
||||||
return batteryDataStatsListVo;
|
return batteryDataStatsListVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,4 +176,22 @@
|
|||||||
</if>
|
</if>
|
||||||
SELECT NULL AS type, NULL AS device_id FROM DUAL WHERE 1=0
|
SELECT NULL AS type, NULL AS device_id FROM DUAL WHERE 1=0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getAllBatteryDataByClusterId" parameterType="String" resultType="com.xzzn.ems.domain.vo.BatteryDataStatsListVo">
|
||||||
|
SELECT
|
||||||
|
update_time as updateTime,
|
||||||
|
voltage, temperature, soc, soh,
|
||||||
|
device_id as deviceId
|
||||||
|
FROM (
|
||||||
|
SELECT
|
||||||
|
t.update_time, t.voltage, t.temperature, t.soc, t.soh, t.device_id,
|
||||||
|
ROW_NUMBER() OVER (
|
||||||
|
PARTITION BY t.device_id ORDER BY t.update_time DESC
|
||||||
|
) AS rn
|
||||||
|
FROM ems_battery_data t
|
||||||
|
WHERE t.cluster_device_id = #{clusterDeviceId}
|
||||||
|
) ranked
|
||||||
|
WHERE rn = 1
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
Reference in New Issue
Block a user