diff --git a/src/modules/equipment/where_query_sql.py b/src/modules/equipment/where_query_sql.py index e65a1b6..5ccba25 100644 --- a/src/modules/equipment/where_query_sql.py +++ b/src/modules/equipment/where_query_sql.py @@ -3,6 +3,7 @@ def get_where_query_sql(assetnum, worktype): where (a.asset_unit = '3' OR a.asset_unit='00') and a.wonum not like 'T%' + and a.status in ('COMP', 'CLOSE') AND a.asset_assetnum = '{assetnum}' {f"AND a.worktype = '{worktype}'" if worktype != 'CM' else "AND a.worktype in ('CM', 'PROACTIVE', 'EM')"} {f"AND a.wojp8 != 'S1'" if worktype == 'CM' else ""} @@ -22,6 +23,7 @@ def get_where_query_sql_all_worktype(assetnum): where (a.asset_unit = '3' OR a.asset_unit='00') and a.wonum not like 'T%' + and a.status in ('COMP', 'CLOSE') AND a.asset_assetnum = '{assetnum}' AND ( (a.worktype = 'CM' AND a.wojp8 != 'S1')