这段时间一直在用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>

先留下痕迹,以后用的时候方便查看

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
  • 2021-09-28
  • 2022-01-06
  • 2022-12-23
  • 2022-12-23
  • 2021-05-17
猜你喜欢
  • 2021-11-20
  • 2022-12-23
  • 2021-11-02
  • 2021-05-09
  • 2021-11-20
  • 2022-12-23
相关资源
相似解决方案