GithubHelp home page GithubHelp logo

sirithink / mybatis-pagination Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fitzyyf/mybatis-pagination

0.0 2.0 0.0 976 KB

The Mybatis database physical paging dialect plug-ins

License: MIT License

mybatis-pagination's Introduction

Mybatis Pagination

support Mysql、MSSQL、Oracle、MSSQL2005、Postgre SQL、DB2.

Basic Usage

in the Mybatis config, add the plugin.

 <plugins>
    <plugin interceptor="org.mybatis.pagination.PaginationInterceptor">
          <property name="dbms" value="mysql"/>
          <property name="sqlRegex" value=".*findAll.*"/>
    </plugin>
</plugins>
  • dbms,database type. MYSQL\MSSQL\ORACLE\MSSQL2005\DB2
  • sqlRegex the mapper method/ sql mapper xml's id, regex string.
    • example .*findAll.* contain findAll query sql

Sql Mapper config

<select id="findAllDict"
        resultType="org.noo.module.Dict">
    SELECT
      ID,CREATORTIME,DATASOURCE,DATATYPE,DICTNAME,DICTNUMBER,ENABLE,RENEWTIME,SORT
     from CD_DICT ORDER BY SORT
</select>

Spring usage

@see config And TestCase

Maven Usage

  1. add repositories into you project pom.xml

     <repositories>
         <repository>
             <id>yfyang-mvn-repo</id>
             <url>https://raw.github.com/yfyang/mybatis-pagination/mvn-repo/</url>
             <snapshots>
                 <enabled>true</enabled>
                 <updatePolicy>always</updatePolicy>
             </snapshots>
         </repository>
     </repositories>
    
  2. add propertie into pom.xml:properties

     <properties>
         <org.mybatis.pagination.version>0.0.3</org.mybatis.pagination.version>
     </properties>
    
  3. add dependency into pom.xml

     <dependency>
         <groupId>org.mybatis</groupId>
         <artifactId>mybatis-pagination</artifactId>
         <version>${org.mybatis.pagination.version}</version>
     </dependency>
    

mybatis-pagination's People

Contributors

fitzyyf avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.