Undo the full-tree rollback in 6ea1b3d and restore the pre-rollback v1.2.0 code. Preserve the new asset flow rules, abnormal inventory separation, range drilldowns and date picker; adapt the regression test to the restored routes layout.
6ea1b3d
37a9f303
改动 - 新增 mileage/repository.ts:18 个查询函数,覆盖 vehicle-info(含搬走的 VEHICLE_INFO_SQL 共享常量)、trend、监控缓存、targets(8 条)、 daily-report-store(5 条)、daily-report-service。 - 6 个含 SQL 的文件改为调用 repository;路由/服务层不再出现 SQL 文本。 - 日报写入的两个函数改为返回 affectedRows(调用方本来只用它),而不是行数组。 - 架构守护的"已完整分层"清单加入 mileage —— 至此八个域全部在守护范围内。 SQL 保持性验证 - 逐字比对:改造前 6 个文件里的 19 条 SQL 字面量,除"动态 INSERT 关键字"一处外, 全部在 repository.ts 中原样出现。 - 那一处是 `${insert} INTO ${TABLE}`(insert 为 'REPLACE' | 'INSERT IGNORE'), 改为 `${replace ? "REPLACE" : "INSERT IGNORE"}`;已渲染两个分支与原文本逐字比对,均为 identical。 验证 - 全量 lint / test(191) / build 全绿,可达性 0 未引用文件。 - 里程域的模型层测试(cache-model / oneos-model / daily-report-model)以及依赖里程的 调度、车辆热力图契约测试全部通过。