SELECT AOGUID FROM "ADDROBJ" WHERE AOID=(SELECT AOID FROM "ADDROBJ" WHERE AOID='{{ aoid }}' OR AOGUID='{{ aoid }}') AND ACTSTATUS=True AND LIVESTATUS=True AND NEXTID IS NULL LIMIT 1;