when (select ID from js_esua_epdc_events.epdc_item_handle_process where STATE != 10 and DEL_FLAG ='0' and ITEM_ID = t1.ID group by t1.ID) is null then 1
when (select ID from esua_epdc_events.epdc_item_handle_process where STATE != 10 and DEL_FLAG ='0' and ITEM_ID = t1.ID group by t1.ID) is null then 1
else 2 end as projectLevel
from (select * from(select * from esua_epdc_events.epdc_item where DEL_FLAG = '0'