xyc
2026-11-11 f9ccdc1663bc98b1e068ab47c58887e3b482bc6d
docs/database.md
@@ -140,6 +140,38 @@
| import_batch_id | bigint | 导入批次 |
| created_at | datetime | 创建时间 |
### h202_freight_vehicle_ownership (H202 highway freight operating vehicle ownership)
Source: transport authority comprehensive ledger workbook `RP_JTB_FreightVehicle_<region>.xlsx`.
One row contains one report period, one region, and one indicator code (`01`-`93`).
All numeric values use `DECIMAL(30,15)` and Java `BigDecimal`; Excel values are converted
through their exact text and are never routed through `double`.
| Field | Type | Description |
|------|------|------|
| id | bigint | Primary key |
| report_period | varchar(20) | Report period `yyyy-MM` |
| region_name | varchar(50) | Hubei province or one of 17 prefecture-level regions |
| report_date | date | Report date read from cell `L3` |
| item_code | varchar(10) | H202 indicator code `01`-`93` |
| item_name | varchar(200) | Indicator name inherited from the matrix row |
| unit | varchar(20) | Measurement unit |
| total_value | decimal(30,15) | Total |
| individual_value | decimal(30,15) | Individual |
| large_value | decimal(30,15) | Large |
| large_heavy_value | decimal(30,15) | Large-heavy |
| large_heavy_individual_value | decimal(30,15) | Large-heavy-individual |
| large_individual_value | decimal(30,15) | Large-individual |
| medium_value | decimal(30,15) | Medium |
| medium_individual_value | decimal(30,15) | Medium-individual |
| small_value | decimal(30,15) | Small |
| small_individual_value | decimal(30,15) | Small-individual |
| source_file_name | varchar(255) | Source workbook file name |
| import_batch_id | bigint | Import batch |
| created_at | datetime | Creation time |
Unique key: `(report_period, region_name, item_code)`.
### transport_auth_vehicle(运政车辆数据)
> 数据来源:模板_运政车辆.xlsx
@@ -157,17 +189,21 @@
| created_at | datetime | 创建时间 |
### vehicle_track_mileage(车辆轨迹里程)
> 数据来源:模板_轨迹里程.xlsx
> 数据来源:模板_轨迹里程.xlsx。同一报表期可同时存在规上企业和两客企业。
| 字段 | 类型 | 说明 |
|------|------|------|
| id | bigint | PK |
| enterprise_name | varchar(200) | 企业名称 |
| enterprise_category | varchar(20) | ABOVE_SCALE(规上企业)/PASSENGER(两客企业) |
| monthly_mileage | double | 月度总里程(公里) |
| tracked_vehicles | int | 有里程的车辆数 |
| anomaly_mileage | double | 异常里程(公里);旧文件无此列时为 NULL |
| report_period | varchar(20) | 报表期 |
| import_batch_id | bigint | 导入批次 |
| created_at | datetime | 创建时间 |
> 唯一约束:`report_period + enterprise_category + enterprise_name`。审核规则只使用 `ABOVE_SCALE` 数据。
### scale_split_transport(规上规下拆分运输量)
> 数据来源:模板_规上规下拆分运输量.xlsx,用户手动上传
@@ -285,13 +321,34 @@
| fuel_unit | varchar(20) | 燃料1计量单位 |
| fuel_consumption | double | 燃料1消耗量 |
| avg_distance | double | 平均运距(公里) |
| avg_loaded_tonnage | double | 平均载货吨位(吨) |
| avg_loaded_tonnage | double | 平均载货吨位(吨)= 货物周转量/载货里程 |
| transport_efficiency | double | 运输效率(吨)= 货物周转量/总行程(官方格式自带该列,缺列时回算) |
| avg_trip_mileage | double | 单趟平均里程(公里) |
| fuel_per_100km | double | 百公里单耗 |
| turnover_fuel | double | 周转量单耗 |
| import_batch_id | bigint | 导入批次 |
| created_at | datetime | 创建时间 |
### h204_fuel_per100km_threshold(H204 百公里单耗审核阈值·《单耗审核公式》表)
> 数据来源:docs/能耗/单耗审核公式.xlsx。判定:单耗 &lt; normal_min 或 &gt;= edit_threshold → 「请修改」(RED);normal_max &lt; 单耗 &lt; edit_threshold → 「请核实」(YELLOW);[normal_min, normal_max] 为正常。按 (fuel_group, k_min, effective_period) 唯一;审核时取 effective_period 不大于报表期且最大者。
| 字段 | 类型 | 说明 |
|------|------|------|
| id | bigint | PK |
| fuel_group | varchar(30) | 燃料分组码:GASOLINE / DIESEL_LNG / CNG / DUAL / EV |
| fuel_group_name | varchar(50) | 燃料分组名称 |
| k_min | double | 标记吨位下限(不含) |
| k_max | double | 标记吨位上限(含);NULL=无上限 |
| k_label | varchar(20) | 档位文字,如 8-30吨 |
| normal_min | double | 正常区间下限 |
| normal_max | double | 正常区间上限 |
| edit_threshold | double | 达到该值(含)即为「请修改」 |
| effective_period | varchar(20) | 生效报表期(含),种子为 2026-01 |
| remark | varchar(200) | 备注 |
| created_at | datetime | 创建时间 |
> 燃料分组对应:01 汽油→GASOLINE;02 柴油、04 液化天然气→DIESEL_LNG;03 压缩天然气→CNG;05 双燃料、06 混合动力、08 燃料电池→DUAL;07 纯电动→EV。
### h204_auth_vehicle(道路货运能耗_运政车辆信息)
> 数据来源:道路货运车辆能源消耗情况(2026年).xlsx 的「运政车辆信息」sheet(车牌号/车辆类型/燃料类型/标记吨位/准牵引质量),随季报一起按报表期导入