单个单体电池数据曲线图
This commit is contained in:
@ -197,7 +197,6 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertEmsBatteryDataList" parameterType="java.util.List">
|
||||
INSERT INTO ems_battery_data (
|
||||
battery_pack, battery_cluster, battery_cell_id,
|
||||
@ -214,4 +213,25 @@
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getSingleBatteryData" parameterType="com.xzzn.ems.domain.vo.DateSearchRequest" resultType="com.xzzn.ems.domain.vo.BatteryDataStatsListVo">
|
||||
SELECT latest.dateDay as dataTimestamp,
|
||||
t.voltage,
|
||||
t.temperature,
|
||||
t.soc,
|
||||
t.soh,
|
||||
t.device_id as deviceId,
|
||||
t.cluster_device_id as clusterDeviceId
|
||||
FROM ems_battery_data t
|
||||
INNER JOIN ( SELECT site_id,cluster_device_id,device_id,DATE(data_timestamp) as dateDay,MAX(data_timestamp) AS max_update_time
|
||||
FROM ems_battery_data
|
||||
WHERE site_id = #{siteId}
|
||||
and cluster_device_id = #{clusterDeviceId}
|
||||
and device_id = #{deviceId}
|
||||
and data_timestamp >= #{startDate}
|
||||
and data_timestamp < #{endDate}
|
||||
GROUP BY site_id,cluster_device_id,device_id,dateDay
|
||||
) latest ON t.site_id = latest.site_id and t.cluster_device_id = latest.cluster_device_id
|
||||
and t.device_id = latest.device_id AND t.data_timestamp = latest.max_update_time
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user