这段时间一直在用mybatis+spring+springMVC的框架,总结点东西吧。
mybatis的oracle分页写法:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="common">
<sql >
<![CDATA[ ) z where rownum <= #{oracleEnd} ) y where y.oracleStart > #{oracleStart} ]]>
</if>
</sql>
</mapper>
页面调用此方法的情况:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.edu.hbcf.plugin.asset.dao.AssetApplyDao">
<select />
</select>
mysql的分页通用代码如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="common">
<sql >
<![CDATA[ limit #{start},#{limit} ]]>
</if>
</sql>
</mapper>
先留下痕迹,以后用的时候方便查看