| | |
| | | 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 <=> sample.step_type |
| | | and latest.step_name <=> sample.step_name |
| | | order by latest.device_time_utc desc, latest.sample_id desc |
| | | limit 1) endVoltage, |
| | | max(case when sample.current_a >= 0 then sample.voltage_v end) chargePeakVoltage, |
| | | min(case when sample.current_a < 0 then sample.voltage_v end) dischargeValleyVoltage, |
| | | channel.adapter_id adapterId, channel.adapter_code adapterCode, channel.devtype devtype, |