From 22873235a421965cc9fa3b61bfbfdf6227aa6fcc Mon Sep 17 00:00:00 2001 From: zakhy <=> Date: Wed, 9 Jul 2025 16:59:38 +0700 Subject: [PATCH] change query --- .../apps/eps/services/statistic/repository.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/positioning/apps/eps/services/statistic/repository.py b/positioning/apps/eps/services/statistic/repository.py index 7d97ddb..2687576 100644 --- a/positioning/apps/eps/services/statistic/repository.py +++ b/positioning/apps/eps/services/statistic/repository.py @@ -9,12 +9,16 @@ class WorkerStatisticRepository(WorkerRepository): data = [] # TODO техдолг query = """ - SELECT w.name, t.sn, t.charge, z.name - FROM eps_tag t - LEFT JOIN workers_worker w ON t.id = w.tag_id - INNER JOIN eps_zone z ON t.zone_id = z.id - WHERE t.date_time >= %s AND z.name != 'АБК' - """ + SELECT concat(w."firstName", ' ', w."lastName"), + t.sn, + t.charge, + z.name + FROM eps_tag t + LEFT JOIN workers_worker w ON t.id = w.tag_id + INNER JOIN eps_zone z ON t.zone_id = z.id + WHERE t.date_time >= %s + AND z.name != 'АБК' \ + """ params = [threshold] with connection.cursor() as cursor: