单站监控-单体电池列表分页
This commit is contained in:
@ -2,14 +2,15 @@ package com.xzzn.ems.domain.vo;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 单站监控-单体电池数据
|
||||
*
|
||||
*/
|
||||
public class BatteryDataStatsListVo {
|
||||
/** 月份 */
|
||||
private String dataMonth;
|
||||
/** 单体电池设备id */
|
||||
private String deviceId;
|
||||
|
||||
/** 电压 (V) */
|
||||
private BigDecimal voltage;
|
||||
@ -23,12 +24,14 @@ public class BatteryDataStatsListVo {
|
||||
/** SOH (%) */
|
||||
private BigDecimal soh;
|
||||
|
||||
public String getDataMonth() {
|
||||
return dataMonth;
|
||||
private Date updateTime;
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDataMonth(String dataMonth) {
|
||||
this.dataMonth = dataMonth;
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public BigDecimal getVoltage() {
|
||||
@ -62,4 +65,12 @@ public class BatteryDataStatsListVo {
|
||||
public void setSoh(BigDecimal 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 com.xzzn.ems.domain.EmsBatteryData;
|
||||
import com.xzzn.ems.domain.vo.BMSBatteryClusterDataList;
|
||||
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;
|
||||
|
||||
/**
|
||||
@ -86,4 +85,11 @@ public interface EmsBatteryDataMapper
|
||||
* @return
|
||||
*/
|
||||
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 BatteryDataStatsListVo getClusterDataInfoList(String clusterDeviceId);
|
||||
public List<BatteryDataStatsListVo> getClusterDataInfoList(String clusterDeviceId);
|
||||
|
||||
public List<AmmeterDataVo> getAmmeterDataList(String siteId);
|
||||
}
|
||||
|
@ -268,8 +268,9 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public BatteryDataStatsListVo getClusterDataInfoList(String clusterDeviceId) {
|
||||
BatteryDataStatsListVo batteryDataStatsListVo = new BatteryDataStatsListVo();
|
||||
public List<BatteryDataStatsListVo> getClusterDataInfoList(String clusterDeviceId) {
|
||||
List<BatteryDataStatsListVo> batteryDataStatsListVo = new ArrayList<>();
|
||||
batteryDataStatsListVo = emsBatteryDataMapper.getAllBatteryDataByClusterId(clusterDeviceId);
|
||||
return batteryDataStatsListVo;
|
||||
}
|
||||
|
||||
|
@ -176,4 +176,22 @@
|
||||
</if>
|
||||
SELECT NULL AS type, NULL AS device_id FROM DUAL WHERE 1=0
|
||||
</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>
|
Reference in New Issue
Block a user