Best practice in custom MyBatis query now

I’m now working on adding some new query apis for engine, e.g. the process instance count for each version of a process definition. I’ve checked the document, the linked blog and the sample code.

Howver, I also found an answer to a question which said the the tutorial would be removed from the official documentation (but still in the docs now after more than 5 years).

Therefore, may I know whether there are new tutorials for custom MyBatis query now a days? The code in the mentioned tutorial in the official documents is indeed out-of-date, but should we still use the same solution now?