<select id="listTagByIds" resultType="la.kaike.ziyue.dmhub.tag.service.dto.TagInfoDTO">
SELECT
*
FROM
tag_info
WHERE
id in
<foreach collection="tagIdList" open="(" item="item" separator="," close=")">
#{item}
</foreach>
order by field
<foreach collection="tagIdList" open="(id," item="item" separator="," close=")">
#{item}
</foreach>
</select>
sql 最终被拼写为:
SELECT * FROM tag_info WHERE id in ( ? , ? , ? , ? , ? , ? , ? , ? ) order by field (id, ? , ? , ? , ? , ? , ? , ? , ? )