mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
fix: locomotive filtering
This commit is contained in:
@@ -12,7 +12,10 @@ function baseQuery(ctx: ReportContext): SelectQueryBuilder<ObjectLiteral> {
|
|||||||
.createQueryBuilder()
|
.createQueryBuilder()
|
||||||
.from(Locomotive, 'l')
|
.from(Locomotive, 'l')
|
||||||
.leftJoin(Yard, 'y', 'y.id = l.current_yard_id')
|
.leftJoin(Yard, 'y', 'y.id = l.current_yard_id')
|
||||||
.where('l.deleted_at IS NULL');
|
.where('l.deleted_at IS NULL')
|
||||||
|
// Names ending '#' are excluded from the fleet report by request; the
|
||||||
|
// marker is a roster convention, not a column the schema tracks.
|
||||||
|
.andWhere("COALESCE(l.name, '') NOT LIKE '%#'");
|
||||||
|
|
||||||
const statuses = params.statuses as string[] | null;
|
const statuses = params.statuses as string[] | null;
|
||||||
if (statuses) qb.andWhere('l.status IN (:...statuses)', { statuses });
|
if (statuses) qb.andWhere('l.status IN (:...statuses)', { statuses });
|
||||||
|
|||||||
Reference in New Issue
Block a user