From 8c8d7af1ba73333c931d69f751c1bb74ad2aa4f4 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 7 Nov 2024 09:01:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20count=5Frunning=5Fstate=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=9B=B4=E5=A4=9A=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/em/views.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/em/views.py b/apps/em/views.py index 3060bb0e..c3172530 100644 --- a/apps/em/views.py +++ b/apps/em/views.py @@ -105,6 +105,11 @@ class EquipmentViewSet(CustomModelViewSet): count_stop=Count(Case(When(running_state=30, then=1), output_field=IntegerField())), count_fail=Count(Case(When(running_state=40, then=1), output_field=IntegerField())), count_offline=Count(Case(When(running_state=50, then=1), output_field=IntegerField())), + count_ok=Count(Case(When(state=Equipment.EQUIP_STATE_OK, then=1), output_field=IntegerField())), + count_limit=Count(Case(When(state=Equipment.EQUIP_STATE_LIMIT, then=1), output_field=IntegerField())), + count_fix=Count(Case(When(state=Equipment.EQUIP_STATE_FIX, then=1), output_field=IntegerField())), + count_disable=Count(Case(When(state=Equipment.EQUIP_STATE_DISABLE, then=1), output_field=IntegerField())), + count_scrap=Count(Case(When(state=Equipment.EQUIP_STATE_SCRAP, then=1), output_field=IntegerField())), ) json_result = { "count": result["count"],