Fix issue with annotating published entries count

Use dirty hack to inject SQL CASE statement