refactor(go): stop duplicate mileage history writes

This commit is contained in:
lingniu
2026-07-02 19:42:53 +08:00
parent be559c0f99
commit 0bbe87e6fc
7 changed files with 30 additions and 73 deletions

View File

@@ -369,9 +369,9 @@ func (r *LocationRepository) tableName() string {
func (r *MileagePointRepository) tableName() string {
if r.database == "" {
return "vehicle_mileage_points"
return "vehicle_locations"
}
return r.database + ".vehicle_mileage_points"
return r.database + ".vehicle_locations"
}
func normalizeRawFrameQuery(query RawFrameQuery) RawFrameQuery {
@@ -676,7 +676,7 @@ func locationWhere(query LocationQuery) []string {
}
func mileagePointWhere(query MileagePointQuery) []string {
var where []string
where := []string{"total_mileage_km IS NOT NULL"}
add := func(clause string) {
where = append(where, clause)
}