yeg
2026-09-03 f3f54c6ee9b9485429cb9f1d2a6cdcedc41aaaab
ruoyi-system/src/main/resources/mapper/system/TTestMapper.xml
@@ -411,7 +411,17 @@
               timestampdiff(second, min(sample.device_time_utc), max(sample.device_time_utc)) stepDuration,
               max(sample.capacity_ah) capacity, max(sample.energy_wh) energy,
               min(sample.voltage_v) startVoltage,
               max(sample.voltage_v) endVoltage,
               <!-- 工步终止电压按设备时间最后成功采样取值;同一时刻以采样主键稳定排序。 -->
               (select latest.voltage_v
                  from t_test_sample latest
                 where latest.test_id = sample.test_id
                   and latest.binding_id = sample.binding_id
                   and latest.cycle_no = sample.cycle_no
                   and latest.step_no = sample.step_no
                   and latest.step_type &lt;=&gt; sample.step_type
                   and latest.step_name &lt;=&gt; sample.step_name
                 order by latest.device_time_utc desc, latest.sample_id desc
                 limit 1) endVoltage,
               max(case when sample.current_a &gt;= 0 then sample.voltage_v end) chargePeakVoltage,
               min(case when sample.current_a &lt; 0 then sample.voltage_v end) dischargeValleyVoltage,
               channel.adapter_id adapterId, channel.adapter_code adapterCode, channel.devtype devtype,