feat: publish mileage assessment freshness
This commit is contained in:
@@ -26,7 +26,8 @@ app.get('/', async (c) => {
|
||||
SUM(CASE WHEN current_year_completion_rate >= 0.5 THEN 1 ELSE 0 END) as half_qualified_count,
|
||||
SUM(current_year_mileage_task) as current_year_target,
|
||||
SUM(current_year_mileage) as current_year_completed,
|
||||
MAX(current_year_assessment_end_date) as year_end_date
|
||||
MAX(current_year_assessment_end_date) as year_end_date,
|
||||
DATE_FORMAT(MAX(update_time), '%Y-%m-%dT%H:%i:%s+08:00') as snapshot_updated_at
|
||||
FROM lingniu_prod.tab_mileage_assessment_vehicle WHERE is_deleted = 0
|
||||
GROUP BY target_id
|
||||
`) as [any[], unknown];
|
||||
@@ -199,6 +200,7 @@ app.get('/', async (c) => {
|
||||
return {
|
||||
id: t.id,
|
||||
targetName: t.target_name,
|
||||
snapshotUpdatedAt: s.snapshot_updated_at || null,
|
||||
vehicleCount: Number(s.total) || t.vehicle_count,
|
||||
totalMileagePerVehicle: Number(t.total_mileage_per_vehicle),
|
||||
annualMileagePerVehicle: Number(t.annual_mileage_per_vehicle),
|
||||
|
||||
Reference in New Issue
Block a user