TRUNK-4496 Moved sql query from service to Dao to remove the sql level access privelege required for saving an order

Follow up - TRUNK-4496