This commit is contained in:
2025-06-29 14:45:20 +08:00
parent aed3f830f5
commit 324beeaa69
7 changed files with 20 additions and 20 deletions

View File

@ -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;
/** /**

View File

@ -52,7 +52,7 @@ public class HomePageServiceImpl implements IHomePageService
if (!StringUtils.isEmpty(siteId)) { if (!StringUtils.isEmpty(siteId)) {
// 站点基本信息 // 站点基本信息
EmsSiteSetting emsSite = emsSiteMapper.selectEmsSiteSettingBySiteId(siteId); EmsSiteSetting emsSite = emsSiteMapper.selectEmsSiteSettingBySiteId(siteId);
if (emsSite != null) { if (StringUtils.isNotEmpty(siteId)) {
// 装机功率+装机容量 // 装机功率+装机容量
singleSiteBaseInfo.setSiteName(emsSite.getSiteName()); singleSiteBaseInfo.setSiteName(emsSite.getSiteName());
singleSiteBaseInfo.setInstalledCap(emsSite.getInstallCapacity()); singleSiteBaseInfo.setInstalledCap(emsSite.getInstallCapacity());

View File

@ -169,7 +169,7 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
bmsOverViewVoList = emsBatteryStackMapper.selectEmsBatteryStackBySiteId(siteId); bmsOverViewVoList = emsBatteryStackMapper.selectEmsBatteryStackBySiteId(siteId);
if (!CollectionUtils.isEmpty(bmsOverViewVoList)) { if (!CollectionUtils.isEmpty(bmsOverViewVoList)) {
for (BMSOverViewVo bmsOverViewVo : bmsOverViewVoList) { for (BMSOverViewVo bmsOverViewVo : bmsOverViewVoList) {
// 获取单体电池数据-待确认 // 获取单体电池数据
String stackDeviceId = bmsOverViewVo.getDeviceId(); String stackDeviceId = bmsOverViewVo.getDeviceId();
if (!StringUtils.isEmpty(stackDeviceId)) { if (!StringUtils.isEmpty(stackDeviceId)) {
List<BMSBatteryDataList> batteryDataList = new ArrayList<>(); List<BMSBatteryDataList> batteryDataList = new ArrayList<>();

View File

@ -311,7 +311,7 @@
tmp.total_current as totalCurrent,tmp.dischargeable_capacity as dischargeableCapacity,tmp.total_discharged_capacity as totalDischargedCapacity, tmp.total_current as totalCurrent,tmp.dischargeable_capacity as dischargeableCapacity,tmp.total_discharged_capacity as totalDischargedCapacity,
tmp.soh as soh,tmp.average_temperature as averageTemperature,tmp.insulation_resistance as insulationResistance, tmp.soh as soh,tmp.average_temperature as averageTemperature,tmp.insulation_resistance as insulationResistance,
tmp.current_soc as currentSoc,tmp.site_id as siteId,tmp.device_id as deviceId tmp.current_soc as currentSoc,tmp.site_id as siteId,tmp.device_id as deviceId
from ems_battery_stack tmp left join ems_devices_setting td on tmp.device_id = td.id and tmp.site_id = td.site_id from ems_battery_stack tmp left join ems_devices_setting td on tmp.device_id = td.device_id and tmp.site_id = td.site_id
where tmp.site_id = #{siteId} where tmp.site_id = #{siteId}
and tmp.update_time = (select MAX(t.update_time) FROM ems_battery_stack t where t.site_id = tmp.site_id and tmp.update_time = (select MAX(t.update_time) FROM ems_battery_stack t where t.site_id = tmp.site_id
and t.device_id = tmp.device_id) and t.device_id = tmp.device_id)

View File

@ -125,12 +125,12 @@
</delete> </delete>
<select id="getCoolingDataList" parameterType="String" resultMap="EmsCoolingDataResult"> <select id="getCoolingDataList" parameterType="String" resultMap="EmsCoolingDataResult">
select t.* SELECT t.*
from ems_cooling_data t FROM ( SELECT *, ROW_NUMBER() OVER (PARTITION BY device_id ORDER BY update_time DESC ) AS rn
where t.site_id = #{siteId} FROM ems_cooling_data
and t.update_time = ( WHERE site_id = #{siteId}
select MAX(tcd.update_time) from ems_cooling_data tcd where tcd.site_id = t.site_id and tcd.device_id = t.device_id) ) t
order by t.system_name WHERE rn = 1
ORDER BY system_name
</select> </select>
</mapper> </mapper>

View File

@ -205,14 +205,15 @@
</delete> </delete>
<select id="getPcsBranchInfoList" resultType="com.xzzn.ems.domain.vo.PcsBranchInfo"> <select id="getPcsBranchInfoList" resultType="com.xzzn.ems.domain.vo.PcsBranchInfo">
select tmp.branch_id as branchId, tmp.discharge_status as dischargeStatus, SELECT tmp.branch_id as branchId, tmp.discharge_status as dischargeStatus,
tmp.dc_power as dcPower, tmp.dc_voltage as dcVoltage, tmp.dc_power as dcPower, tmp.dc_voltage as dcVoltage,
tmp.dc_current as dcCurrent, tmp.site_id as siteId, tmp.device_id as deviceId tmp.dc_current as dcCurrent, tmp.site_id as siteId, tmp.device_id as deviceId
from ems_pcs_branch_data tmp FROM (
where tmp.site_id = #{siteId} SELECT t.*, ROW_NUMBER() OVER ( PARTITION BY t.branch_id ORDER BY t.update_time DESC ) AS rn
and tmp.device_id = #{deviceId} FROM ems_pcs_branch_data t
and tmp.update_time = (select MAX(t.update_time) FROM ems_pcs_branch_data t where t.site_id = tmp.site_id WHERE t.site_id = #{siteId} AND t.device_id = #{deviceId}
and t.device_id = tmp.device_id and t.branch_id = tmp.branch_id) ) tmp
order by tmp.branch_id WHERE rn = 1
ORDER BY tmp.branch_id;
</select> </select>
</mapper> </mapper>

View File

@ -349,7 +349,7 @@
tmp.c_phase_current as cPhaseVoltage,tmp.c_phase_current as cPhaseCurrent, tmp.c_phase_current as cPhaseVoltage,tmp.c_phase_current as cPhaseCurrent,
tmp.total_power_factor as totalPowerFactor, tmp.total_power_factor as totalPowerFactor,
tmp.pcs_environment_temperature as pcsEnvironmentTemperature,tmp.ac_frequency as acFrequency tmp.pcs_environment_temperature as pcsEnvironmentTemperature,tmp.ac_frequency as acFrequency
from ems_pcs_data tmp left join ems_devices_setting td on tmp.device_id = td.id and tmp.site_id = td.site_id from ems_pcs_data tmp left join ems_devices_setting td on tmp.device_id = td.device_id and tmp.site_id = td.site_id
where tmp.site_id = #{siteId} where tmp.site_id = #{siteId}
and tmp.data_update_time = (select MAX(data_update_time) FROM ems_pcs_data where site_id = tmp.site_id and tmp.data_update_time = (select MAX(data_update_time) FROM ems_pcs_data where site_id = tmp.site_id
and device_id = tmp.device_id) and device_id = tmp.device_id)