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"],