首页-数据概览

This commit is contained in:
2025-07-09 16:57:41 +08:00
parent 3eb8636e53
commit 29c5ffc15c
9 changed files with 92 additions and 36 deletions

View File

@ -133,6 +133,10 @@
group by device_type
</select>
<select id="getAlarmGradeList" resultType="com.xzzn.ems.domain.vo.AlarmGradeList">
select alarm_level as level,COUNT(1) as dataNum from ems_alarm_records group by alarm_level;
</select>
<select id="getAlarmRecordDetailList" parameterType="AlarmRecordListRequestVo" resultType="com.xzzn.ems.domain.vo.AlarmRecordListResponseVo">
select t.device_name as deviceName,t.alarm_level as alarmLevel,
t.alarm_content as alarmContent,t.status as status,

View File

@ -348,17 +348,19 @@
</select>
<select id="getElectDataList" resultType="com.xzzn.ems.domain.vo.ElectricIndexList">
select tmp.date_month as dateMonth,
SUM(tmp.daily_ac_charge_energy) as chargeEnergy,
SUM(tmp.daily_ac_discharge_energy) as disChargeEnergy
from (
select date_month,date_day,t.daily_ac_charge_energy,t.daily_ac_discharge_energy,t.create_time
from ems_pcs_data t
where t.create_time = (select MAX(create_time) FROM ems_pcs_data where site_id = t.site_id
and device_id = t.device_id and date_day = t.date_day and date_month = t.date_month)
) as tmp
group by dateMonth
SELECT DATE_FORMAT(t.data_update_time, '%Y-%m') AS dateMonth,
SUM(t.daily_ac_charge_energy) AS chargeEnergy,
SUM(t.daily_ac_discharge_energy) AS disChargeEnergy
FROM ems_pcs_data t
INNER JOIN ( SELECT site_id, device_id, date_month, date_day, MAX(data_update_time) AS max_update_time
FROM ems_pcs_data GROUP BY site_id, device_id, date_month, date_day
) max_dates ON t.site_id = max_dates.site_id
AND t.device_id = max_dates.device_id
AND t.date_month = max_dates.date_month
AND t.date_day = max_dates.date_day
AND t.data_update_time = max_dates.max_update_time
GROUP BY dateMonth
ORDER BY dateMonth;
</select>
<select id="getPcsDetailInfoBySiteId" parameterType="String" resultType="com.xzzn.ems.domain.vo.PcsDetailInfoVo">
@ -487,6 +489,7 @@
</choose>
</sql>
<select id="getPcsActivePowerByDay" parameterType="com.xzzn.ems.domain.vo.DateSearchRequest" resultType="com.xzzn.ems.domain.vo.PcsStatisListVo">
select CONCAT(t.date_month,'/',t.date_day) as statisDate,
<include refid="dataTypeChooseFilter"/>