-- Employees
-- This report contains all active employees that do not have a simple123 or brstrat email address
-- FILTER: {
--   filter: "link",
--   column: "link",
--   "params": {
--         "blank": true,
--         "display": "View Employee"
--     }
-- }

SELECT ee.first_name,
       ee.last_name,
       ee.email,
       ee.phone_cell,
       ee.last_activity,
       bl.id, bl.name,
       bl."polyclassC",
       ee.contact_for_business_id,
       concat('https://www.simple123.com/agency/agencies/5656058538229760/baseemployees/', ee.id) as link
FROM simplebrsprod.employee_employee ee,
     simplebrsprod.business_location bl
WHERE ee.email not like '%simple123%'
  AND ee.email not like '%brstrat%'
  AND bl.id = ee.first_location_id
  AND ee.is_active = true
ORDER BY ee.last_activity DESC;