fix(energy): connect Foshan external vehicle hydrogen orders
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -8,10 +8,14 @@ export interface EnergyDateRange {
|
||||
|
||||
const YMD_RE = /^\d{4}-\d{2}-\d{2}$/;
|
||||
|
||||
// 新账本目前只承载羚牛车辆订单;外部车辆仍需返回空集合而不是混用羚牛数据。
|
||||
// 主数据 ID 341:佛山南海羚牛加氢站。车牌文字存在不代表已关联车辆。
|
||||
const FOSHAN_LINGNIU_STATION_ID = 341;
|
||||
|
||||
// 日明细账本使用别名 b;两类互斥,其他订单继续保留在原羚牛范围内。
|
||||
export function customerClause(customer: CustomerKind): string {
|
||||
if (customer === 'external') return '1=0';
|
||||
if (customer === 'lingniu') return '1=1';
|
||||
const external = `(COALESCE(b.station_id, 0) = ${FOSHAN_LINGNIU_STATION_ID} AND b.vehicle_id IS NULL)`;
|
||||
if (customer === 'external') return external;
|
||||
if (customer === 'lingniu') return `NOT ${external}`;
|
||||
return '1=1';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user