oracle mysql 的mybatis 逆向工程中的分页查询的写法
2016-12-01 09:47
417 查看
mysql 分页在mybatis 中的实现 <select id="selectByExampleWithPage" resultMap="BaseResultMap" parameterType="map" > select <if test="example.distinct" > distinct </if> 4000 <include refid="Base_Column_List" /> from tb_item <if test="example.join != null" > ${example.join} </if> <if test="_parameter != null" > <include refid="Example_Where_Clause_Page" /> </if> <if test="example.orderByClause != null" > order by ${example.orderByClause} </if> limit ${startPage},${endPage} </select>
oracle 中分页查询在mybatis 中的实现
<select id="selectByExampleWithPage" resultMap="BaseResultMap" parameterType="map" > select * from (select g.*,rownum rn from (select <if test="example.distinct" > distinct </if> <include refid="Base_Column_List" /> from tb_content <if test="example.join != null" > ${example.join} </if> <if test="_parameter != null" > <include refid="Example_Where_Clause_Page" /> </if> <if test="example.orderByClause != null" > order by ${example.orderByClause} </if> ) g where rownum < ${endPage} ) where rn >= ${startPage} </select>
欢迎批评和指正,觉得还行请点赞,有异议欢迎留言讨论
相关文章推荐
- Oracle, DB2 及 MySQL 分页查询写法
- 【转】Oracle, DB2 及 MySQL 分页查询写法
- Oracle, DB2 及 MySQL 分页查询写法
- mybatis分页查询(Mysql,oracle分页语句)
- Oracle, DB2 及 MySQL 分页查询写法
- Oracle、MYSQL、sql server和DB2分页查询写法
- 解决Mybatis 分页插件pagehelper不支持逆向工程Example条件查询
- mybatis的分页插件pagehelper-fix使用、数据库分页查询模板sql、总结mysql与oracle语句的区别
- Mybatis中oracle、mysql、db2、sql server的like模糊查询
- Oracle、MySQL和SqlServe分页查询的语句区别
- Oracle、 Mysql 、 SQLserver 分页查询
- oracle VS mysql 的分页查询
- SQL server、MySQL、Oracle分页查询SQL语句
- MySQL、SqlServer、Oracle三大主流数据库实现分页查询的方法
- Mybatis中oracle、mysql、db2、sql server的like模糊查询
- oracle 动态分页查询的写法
- Mybatis+mysql动态分页查询数据案例——房屋信息的实现类(HouseDaoMybatisImpl)
- mybatis里面的mysql和oracle简单模糊查询
- Oracle分页查询语句的写法
- mysql,sqlServer,oracle分页查询