1.in查询
<select id="selectTblCommentListByCommentIds" parameterType="java.util.List" resultMap="BaseResultMap">
select TopicId,CommentId from Gungnir..tbl_Comment WITH(NOLOCK)
where CommentId in
<foreach collection="commentIds" index="index" item="item" open="("separator="," close=")">
#{item}
</foreach>
</select>