That's surprisingly tough.
3 cameras come to mind - Avigilon, Axis, and Mobotix.
Avigilon has on-board storage and loitering but you still need a server for setup and notifications. (Related, discontinued VideoIQ cameras would meet all your requirements).
Axis has on-board storage, can run stand-alone (either Camera Companion or e.g., Exacq Edge) but then you would need to add a third party app to do loitering detection. There's definitely one out there, it's just time consuming.
Mobotix has on-board storage, can run stand-alone, has analytics, but I don't think they do loitering.
There are other cameras with analytics and storage (Samsung) but I am not sure / confident of the quality of their on-board recording or analytics.
Bosch IP cameras (with the IVA feature) support the functionality you have described. On-board storage uses micro-SD. Loitering (with user-defined time delay) is one of the available analytics. Each analytic you configure is referred to as a task. Tasks maybe configured via web browser or Configuration Manager software.
John mentioned notification in his response. If you want an email to be sent, you can configure this in the camera, but, of course, a 3rd party mail server must be accesible to the camera. I've attached an image of browser setup for that. Hope this helps.
Correct. The Dinion 7000 does support POE. Analytics is schedulable from within the browser. Two unique profiles can be configured. Although 2TB edge capacity is supported, that size media is not yet available. Alternatively, you can find media >64GB and use it.