https://esp8266hints.wordpress.com/2018/02/13/adding-an-ethernet-port-to-your-esp-revisited/
The code is based on TornTrousers' ESP-Now demo, with the ESP8266 driving the W5500 board via the SPI (plus one extra pin to control the W5500 reset). Multiple (battery-powered) sensor nodes connect at regular intervals to the gateway, transferring a data packet. The data is then sent by the ESP8266, via the wired ethernet interface, to the MQTT broker. Using ESP-Now, the sensor nodes are only awake for about half a second (including the time taken to read the sensor), so battery drain is very much reduced compared to a normal WiFi connection.
Although this particular demo uses ESP-Now, the same configuration and most of the code could be used to provide a WiFi to wired MQTT gateway for virtually any application (the RF connection between ESPs doesn't have to be ESP-Now).