22. <mapper id="feedstore-mapper">
<select id="selectEntriesByTag" selector="selectEntriesByTag:limit:" resultMap="entryWithFeedMap" arguments="tag, limit">
SELECT
e.id AS entry_id
, e.title AS entry_title
, e.link AS entry_link
, e.summary AS entry_summary
, e.issued AS entry_issued
, f.id AS feed_id
, f.name AS feed_name
, f.feed_url AS feed_url
, f.site_url AS site_url
, t.id AS tag_id
, t.tag AS tag_tag
FROM
Entry AS e
LEFT OUTER JOIN
Entry_Feed AS e2f
ON e.id = e2f.entry_id
LEFT OUTER JOIN
Feed AS f
ON f.id = e2f.feed_id
LEFT OUTER JOIN
Tag_Feed AS t2f
ON f.id = t2f.feed_id
LEFT OUTER JOIN
Tag AS t
ON t.id = t2f.tag_id
WHERE
(LOWER(t.tag) IN (#{tag}))
ORDER BY
e.issued DESC
LIMIT #{limit}
</select>
....