20250808优化-告警优化&主路线图优化

This commit is contained in:
2025-08-27 01:32:05 +08:00
parent d6276dc21f
commit 1a1558f8cd
8 changed files with 71 additions and 4 deletions

View File

@ -162,6 +162,13 @@
<if test="deviceId != null and deviceId != ''">
AND t.device_id = #{deviceId}
</if>
<if test="status != null and status != ''">
AND t.status IN (
<foreach collection="status.split(',')" item="item" separator=",">
#{item}
</foreach>
)
</if>
<if test="alarmStartTime != null and alarmStartTime != null and alarmEndTime != null and alarmEndTime != ''">
AND (date_format(t.alarm_start_time,'%Y%m%d') BETWEEN date_format(#{alarmStartTime},'%Y%m%d') and date_format(#{alarmEndTime},'%Y%m%d')
or date_format(t.alarm_end_time,'%Y%m%d') BETWEEN date_format(#{alarmStartTime},'%Y%m%d') and date_format(#{alarmEndTime},'%Y%m%d') )

View File

@ -198,4 +198,19 @@
update_by = IF(VALUES(temperature) > temperature, VALUES(update_by), update_by),
temperature = IF(VALUES(temperature) > temperature, VALUES(temperature), temperature)
</insert>
<select id="getBatteryDayData" parameterType="com.xzzn.ems.domain.vo.DateSearchRequest" resultType="com.xzzn.ems.domain.vo.BatteryDataStatsListVo">
SELECT day_time as dataTimestamp,
voltage, temperature, soc, soh,
device_id as deviceId,
cluster_device_id as clusterDeviceId
FROM ems_battery_data_day
WHERE site_id = #{siteId}
and cluster_device_id = #{clusterDeviceId}
and device_id = #{deviceId}
and day_time &gt;= #{startDate}
and day_time &lt;= #{endDate}
order by day_time
</select>
</mapper>