<select id="select_fy" resultType="User">
select *
from (select ROWNUM r,USER_NAME,USER_ID
from (select ROWNUM,USER_NAME,USER_ID from YH_USER y where ROWNUM < {after}))
where r >= #{before}
</select>
最后发现是因为mybatis中的mapper.xml中 不能存在 < > 符号
在代码中加入 <![CDATA[ 符号 ]]>
即可