├── properties.png ├── wx_mybatis.jpg ├── .gitignore ├── pagehelper-spring-boot-samples ├── pagehelper-spring-boot-sample-annotation │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── META-INF │ │ │ │ └── services │ │ │ │ │ └── com.github.pagehelper.parser.CountSqlParser │ │ │ ├── application.properties │ │ │ └── import.sql │ │ │ └── java │ │ │ └── tk │ │ │ └── mybatis │ │ │ └── pagehelper │ │ │ ├── MyOrderBySqlParser.java │ │ │ ├── MyCountSqlParser.java │ │ │ ├── mapper │ │ │ └── UserMapper.java │ │ │ ├── domain │ │ │ └── User.java │ │ │ └── SampleMapperApplication.java │ └── pom.xml ├── pagehelper-spring-boot-sample-xml │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── application.properties │ │ │ ├── tk │ │ │ │ └── mybatis │ │ │ │ │ └── pagehelper │ │ │ │ │ └── mapper │ │ │ │ │ └── UserMapper.xml │ │ │ ├── mybatis-config.xml │ │ │ └── import.sql │ │ │ └── java │ │ │ └── tk │ │ │ └── mybatis │ │ │ └── pagehelper │ │ │ ├── mapper │ │ │ └── UserMapper.java │ │ │ ├── dao │ │ │ └── CityDao.java │ │ │ ├── domain │ │ │ ├── User.java │ │ │ ├── Hotel.java │ │ │ └── City.java │ │ │ └── SampleXmlApplication.java │ └── pom.xml └── pom.xml ├── pagehelper-spring-boot-starter ├── src │ └── main │ │ └── resources │ │ └── META-INF │ │ └── spring.provides └── pom.xml ├── pagehelper-spring-boot-autoconfigure ├── src │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ ├── spring │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ │ └── spring.factories │ │ └── java │ │ └── com │ │ └── github │ │ └── pagehelper │ │ └── autoconfigure │ │ ├── PageHelperAutoConfiguration.java │ │ ├── PageHelperProperties.java │ │ └── PageHelperStandardProperties.java └── pom.xml ├── .github └── workflows │ ├── pull-request.yml │ └── release.yml ├── LICENSE ├── README.md └── pom.xml /properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pagehelper-org/pagehelper-spring-boot/HEAD/properties.png -------------------------------------------------------------------------------- /wx_mybatis.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pagehelper-org/pagehelper-spring-boot/HEAD/wx_mybatis.jpg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Maven # 2 | target/ 3 | .flattened-pom.xml 4 | 5 | # IDEA # 6 | .idea/ 7 | *.iml 8 | 9 | # Eclipse # 10 | .settings/ 11 | .classpath 12 | .project -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-annotation/src/main/resources/META-INF/services/com.github.pagehelper.parser.CountSqlParser: -------------------------------------------------------------------------------- 1 | tk.mybatis.pagehelper.MyCountSqlParser -------------------------------------------------------------------------------- /pagehelper-spring-boot-starter/src/main/resources/META-INF/spring.provides: -------------------------------------------------------------------------------- 1 | provides: pagehelper-spring-boot-autoconfigure,pagehelper,mybatis-spring-boot-autoconfigure,mybatis,mybatis-spring 2 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration 2 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | # Auto Configure 2 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 3 | com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration 4 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-annotation/src/main/java/tk/mybatis/pagehelper/MyOrderBySqlParser.java: -------------------------------------------------------------------------------- 1 | package tk.mybatis.pagehelper; 2 | 3 | import com.github.pagehelper.parser.defaults.DefaultOrderBySqlParser; 4 | 5 | public class MyOrderBySqlParser extends DefaultOrderBySqlParser { 6 | 7 | @Override 8 | public String converToOrderBySql(String sql, String orderBy) { 9 | return "/* order-by */" + super.converToOrderBySql(sql, orderBy); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /.github/workflows/pull-request.yml: -------------------------------------------------------------------------------- 1 | name: Maven verify 2 | on: 3 | pull_request: 4 | types: [ opened, reopened, edited ] 5 | jobs: 6 | mvn_verify: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v3 10 | - name: Set up Maven Central Repository 11 | uses: actions/setup-java@v2 12 | with: 13 | java-version: '8' 14 | distribution: 'adopt' 15 | - name: Run the Maven verify phase 16 | run: mvn --batch-mode --update-snapshots -P dev verify -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-annotation/src/main/java/tk/mybatis/pagehelper/MyCountSqlParser.java: -------------------------------------------------------------------------------- 1 | package tk.mybatis.pagehelper; 2 | 3 | import com.github.pagehelper.parser.defaults.DefaultCountSqlParser; 4 | 5 | public class MyCountSqlParser extends DefaultCountSqlParser { 6 | @Override 7 | public String getSmartCountSql(String sql, String countColumn) { 8 | return "/* count */" + super.getSmartCountSql(sql, countColumn); 9 | } 10 | 11 | @Override 12 | public String getSimpleCountSql(String sql) { 13 | return "/* count */" + super.getSimpleCountSql(sql); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Publish package to the Maven Central Repository 2 | on: 3 | push: 4 | tags: [ "*" ] 5 | jobs: 6 | publish: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v3 10 | - name: Set up Maven Central Repository 11 | uses: actions/setup-java@v2 12 | with: 13 | java-version: '8' 14 | distribution: 'adopt' 15 | server-id: ossrh 16 | server-username: MAVEN_USERNAME 17 | server-password: MAVEN_PASSWORD 18 | - id: install-secret-key 19 | name: Install gpg secret key 20 | run: | 21 | cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import 22 | gpg --list-secret-keys --keyid-format LONG 23 | - name: Publish package 24 | env: 25 | MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} 26 | MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} 27 | run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -P release clean deploy -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 abel533@gmail.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-xml/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2017 abel533@gmail.com 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy 7 | # of this software and associated documentation files (the "Software"), to deal 8 | # in the Software without restriction, including without limitation the rights 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | # copies of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included in 14 | # all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | # THE SOFTWARE. 23 | # 24 | spring.sql.init.schema-locations=import.sql 25 | mybatis.config-location=mybatis-config.xml 26 | logging.level.root=WARN 27 | logging.level.tk.mybatis.pagehelper.mapper=TRACE -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-xml/src/main/java/tk/mybatis/pagehelper/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 abel533@gmail.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package tk.mybatis.pagehelper.mapper; 25 | 26 | import org.apache.ibatis.annotations.Mapper; 27 | import tk.mybatis.pagehelper.domain.User; 28 | 29 | import java.util.List; 30 | 31 | /** 32 | * @author Eduardo Macarron 33 | */ 34 | @Mapper 35 | public interface UserMapper { 36 | 37 | List selectAll(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-xml/src/main/resources/tk/mybatis/pagehelper/mapper/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 29 | 30 | 34 | 35 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-xml/src/main/resources/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-annotation/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2017 abel533@gmail.com 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy 7 | # of this software and associated documentation files (the "Software"), to deal 8 | # in the Software without restriction, including without limitation the rights 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | # copies of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included in 14 | # all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | # THE SOFTWARE. 23 | # 24 | spring.sql.init.schema-locations=import.sql 25 | debug=true 26 | logging.level.root=WARN 27 | logging.level.tk.mybatis.pagehelper.mapper=TRACE 28 | #pagehelper. 29 | pagehelper.autoDialect=true 30 | pagehelper.closeConn=true 31 | #\u6D4B\u8BD5\u5C5E\u6027\u6CE8\u5165 32 | pagehelper.hello=\u4F60\u597D 33 | pagehelper.nihao=Hello 34 | pagehelper.offset-as-page-num=true 35 | pagehelper.count-column=* 36 | pagehelper.async-count=true 37 | pagehelper.orderBySqlParser=tk.mybatis.pagehelper.MyOrderBySqlParser -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-annotation/src/main/java/tk/mybatis/pagehelper/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 abel533@gmail.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | package tk.mybatis.pagehelper.mapper; 26 | 27 | import org.apache.ibatis.annotations.Mapper; 28 | import org.apache.ibatis.annotations.Select; 29 | import org.apache.ibatis.session.RowBounds; 30 | import tk.mybatis.pagehelper.domain.User; 31 | 32 | import java.util.List; 33 | 34 | @Mapper 35 | public interface UserMapper { 36 | 37 | @Select("select * from sys_user") 38 | List findAll(); 39 | 40 | List findAll(RowBounds rowBounds); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-xml/src/main/java/tk/mybatis/pagehelper/dao/CityDao.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 abel533@gmail.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package tk.mybatis.pagehelper.dao; 25 | 26 | import org.apache.ibatis.session.SqlSession; 27 | import org.springframework.beans.factory.annotation.Autowired; 28 | import org.springframework.stereotype.Component; 29 | import tk.mybatis.pagehelper.domain.City; 30 | 31 | /** 32 | * @author Eddú Meléndez 33 | */ 34 | @Component 35 | public class CityDao { 36 | 37 | @Autowired 38 | private SqlSession sqlSession; 39 | 40 | public City selectCityById(long id) { 41 | return this.sqlSession.selectOne("selectCityById", id); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-xml/src/main/java/tk/mybatis/pagehelper/domain/User.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 abel533@gmail.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | package tk.mybatis.pagehelper.domain; 26 | 27 | import java.io.Serializable; 28 | 29 | public class User implements Serializable { 30 | private static final long serialVersionUID = 6569081236403751407L; 31 | 32 | private int id; 33 | private String name; 34 | private String py; 35 | 36 | public int getId() { 37 | return id; 38 | } 39 | 40 | public void setId(int id) { 41 | this.id = id; 42 | } 43 | 44 | public String getName() { 45 | return name; 46 | } 47 | 48 | public void setName(String name) { 49 | this.name = name; 50 | } 51 | 52 | public String getPy() { 53 | return py; 54 | } 55 | 56 | public void setPy(String py) { 57 | this.py = py; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-annotation/src/main/java/tk/mybatis/pagehelper/domain/User.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 abel533@gmail.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | package tk.mybatis.pagehelper.domain; 26 | 27 | import java.io.Serializable; 28 | 29 | public class User implements Serializable { 30 | private static final long serialVersionUID = 6569081236403751407L; 31 | 32 | private int id; 33 | private String name; 34 | private String py; 35 | 36 | public int getId() { 37 | return id; 38 | } 39 | 40 | public void setId(int id) { 41 | this.id = id; 42 | } 43 | 44 | public String getName() { 45 | return name; 46 | } 47 | 48 | public void setName(String name) { 49 | this.name = name; 50 | } 51 | 52 | public String getPy() { 53 | return py; 54 | } 55 | 56 | public void setPy(String py) { 57 | this.py = py; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-xml/src/main/java/tk/mybatis/pagehelper/SampleXmlApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 abel533@gmail.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | package tk.mybatis.pagehelper; 26 | 27 | import com.github.pagehelper.Page; 28 | import com.github.pagehelper.PageHelper; 29 | import org.springframework.beans.factory.annotation.Autowired; 30 | import org.springframework.boot.CommandLineRunner; 31 | import org.springframework.boot.SpringApplication; 32 | import org.springframework.boot.autoconfigure.SpringBootApplication; 33 | import tk.mybatis.pagehelper.domain.User; 34 | import tk.mybatis.pagehelper.mapper.UserMapper; 35 | 36 | import java.util.List; 37 | 38 | @SpringBootApplication 39 | public class SampleXmlApplication implements CommandLineRunner { 40 | 41 | @Autowired 42 | private UserMapper userMapper; 43 | 44 | public static void main(String[] args) { 45 | SpringApplication.run(SampleXmlApplication.class, args); 46 | } 47 | 48 | @Override 49 | public void run(String... args) throws Exception { 50 | PageHelper.startPage(1, 20); 51 | List users = userMapper.selectAll(); 52 | System.out.println("Total: " + ((Page) users).getTotal()); 53 | for (User user : users) { 54 | System.out.println("Name: " + user.getName()); 55 | } 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-xml/src/main/java/tk/mybatis/pagehelper/domain/Hotel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 abel533@gmail.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | /** 25 | * @author Eduardo Macarron 26 | */ 27 | package tk.mybatis.pagehelper.domain; 28 | 29 | import java.io.Serializable; 30 | 31 | public class Hotel implements Serializable { 32 | 33 | private static final long serialVersionUID = 1L; 34 | 35 | private Long city; 36 | 37 | private String name; 38 | 39 | private String address; 40 | 41 | private String zip; 42 | 43 | public Long getCity() { 44 | return city; 45 | } 46 | 47 | public void setCity(Long city) { 48 | this.city = city; 49 | } 50 | 51 | public String getName() { 52 | return name; 53 | } 54 | 55 | public void setName(String name) { 56 | this.name = name; 57 | } 58 | 59 | public String getAddress() { 60 | return address; 61 | } 62 | 63 | public void setAddress(String address) { 64 | this.address = address; 65 | } 66 | 67 | public String getZip() { 68 | return zip; 69 | } 70 | 71 | public void setZip(String zip) { 72 | this.zip = zip; 73 | } 74 | 75 | @Override 76 | public String toString() { 77 | return getCity() + "," + getName() + "," + getAddress() + "," + getZip(); 78 | } 79 | 80 | } -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-xml/src/main/java/tk/mybatis/pagehelper/domain/City.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 abel533@gmail.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | package tk.mybatis.pagehelper.domain; 25 | 26 | import java.io.Serializable; 27 | 28 | /** 29 | * @author Eddú Meléndez 30 | */ 31 | public class City implements Serializable { 32 | 33 | private static final long serialVersionUID = 1L; 34 | 35 | private Long id; 36 | 37 | private String name; 38 | 39 | private String state; 40 | 41 | private String country; 42 | 43 | public Long getId() { 44 | return this.id; 45 | } 46 | 47 | public void setId(Long id) { 48 | this.id = id; 49 | } 50 | 51 | public String getName() { 52 | return this.name; 53 | } 54 | 55 | public void setName(String name) { 56 | this.name = name; 57 | } 58 | 59 | public String getState() { 60 | return this.state; 61 | } 62 | 63 | public void setState(String state) { 64 | this.state = state; 65 | } 66 | 67 | public String getCountry() { 68 | return this.country; 69 | } 70 | 71 | public void setCountry(String country) { 72 | this.country = country; 73 | } 74 | 75 | @Override 76 | public String toString() { 77 | return getId() + "," + getName() + "," + getState() + "," + getCountry(); 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-starter/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 28 | 4.0.0 29 | 30 | com.github.pagehelper 31 | pagehelper-spring-boot 32 | ${revision} 33 | 34 | pagehelper-spring-boot-starter 35 | pagehelper-spring-boot-starter 36 | 37 | 38 | org.springframework.boot 39 | spring-boot-starter 40 | 41 | 42 | org.mybatis.spring.boot 43 | mybatis-spring-boot-starter 44 | 45 | 46 | com.github.pagehelper 47 | pagehelper-spring-boot-autoconfigure 48 | 49 | 50 | com.github.pagehelper 51 | pagehelper 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 28 | 4.0.0 29 | 30 | com.github.pagehelper 31 | pagehelper-spring-boot 32 | ${revision} 33 | 34 | pagehelper-spring-boot-samples 35 | pom 36 | pagehelper-spring-boot-samples 37 | 38 | pagehelper-spring-boot-sample-annotation 39 | pagehelper-spring-boot-sample-xml 40 | 41 | 42 | 43 | 44 | ognl 45 | ognl 46 | 3.1.2 47 | 48 | 49 | javassist 50 | javassist 51 | 52 | 53 | 54 | 55 | org.javassist 56 | javassist 57 | 3.20.0-GA 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-xml/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 27 | 4.0.0 28 | 29 | com.github.pagehelper 30 | pagehelper-spring-boot-samples 31 | ${revision} 32 | 33 | pagehelper-spring-boot-sample-xml 34 | jar 35 | pagehelper-spring-boot-sample-xml 36 | 37 | 38 | org.mybatis.spring.boot 39 | mybatis-spring-boot-starter 40 | 41 | 42 | 43 | com.github.pagehelper 44 | pagehelper-spring-boot-starter 45 | 46 | 47 | 48 | com.h2database 49 | h2 50 | runtime 51 | 52 | 53 | 54 | 55 | 56 | 57 | org.springframework.boot 58 | spring-boot-maven-plugin 59 | ${spring-boot.version} 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-annotation/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 27 | 4.0.0 28 | 29 | com.github.pagehelper 30 | pagehelper-spring-boot-samples 31 | ${revision} 32 | 33 | pagehelper-spring-boot-sample-annotation 34 | jar 35 | pagehelper-spring-boot-sample-annotation 36 | 37 | 38 | org.mybatis.spring.boot 39 | mybatis-spring-boot-starter 40 | 41 | 42 | com.github.pagehelper 43 | pagehelper-spring-boot-starter 44 | 45 | 46 | com.h2database 47 | h2 48 | runtime 49 | 50 | 51 | 52 | 53 | 54 | org.springframework.boot 55 | spring-boot-maven-plugin 56 | ${spring-boot.version} 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-autoconfigure/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 28 | 4.0.0 29 | 30 | com.github.pagehelper 31 | pagehelper-spring-boot 32 | ${revision} 33 | 34 | pagehelper-spring-boot-autoconfigure 35 | pagehelper-spring-boot-autoconfigure 36 | 37 | 38 | 39 | 40 | org.springframework.boot 41 | spring-boot-autoconfigure 42 | 43 | 44 | 45 | 46 | org.mybatis 47 | mybatis 48 | 3.5.10 49 | true 50 | 51 | 52 | com.github.pagehelper 53 | pagehelper 54 | true 55 | 56 | 57 | org.mybatis.spring.boot 58 | mybatis-spring-boot-autoconfigure 59 | true 60 | 61 | 62 | 63 | 64 | org.springframework.boot 65 | spring-boot-configuration-processor 66 | true 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-annotation/src/main/java/tk/mybatis/pagehelper/SampleMapperApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 abel533@gmail.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | package tk.mybatis.pagehelper; 26 | 27 | import com.github.pagehelper.Page; 28 | import com.github.pagehelper.PageHelper; 29 | import com.github.pagehelper.PageRowBounds; 30 | import org.mybatis.spring.annotation.MapperScan; 31 | import org.springframework.beans.factory.annotation.Autowired; 32 | import org.springframework.boot.CommandLineRunner; 33 | import org.springframework.boot.SpringApplication; 34 | import org.springframework.boot.autoconfigure.SpringBootApplication; 35 | import tk.mybatis.pagehelper.domain.User; 36 | import tk.mybatis.pagehelper.mapper.UserMapper; 37 | 38 | import java.util.List; 39 | 40 | @MapperScan(basePackages = "tk.mybatis.pagehelper") 41 | @SpringBootApplication 42 | public class SampleMapperApplication implements CommandLineRunner { 43 | 44 | @Autowired 45 | private UserMapper userMapper; 46 | 47 | public static void main(String[] args) { 48 | SpringApplication.run(SampleMapperApplication.class, args); 49 | } 50 | 51 | @Override 52 | public void run(String... args) throws Exception { 53 | PageHelper.startPage(1, 20).disableAsyncCount(); 54 | List users = userMapper.findAll(); 55 | System.out.println("Total: " + ((Page) users).getTotal()); 56 | for (User user : users) { 57 | System.out.println("Name: " + user.getName()); 58 | } 59 | 60 | PageHelper.orderBy("id desc"); 61 | users = userMapper.findAll(); 62 | System.out.println("Total: " + ((Page) users).getTotal()); 63 | for (User user : users) { 64 | System.out.println("Name: " + user.getName()); 65 | } 66 | 67 | PageRowBounds rowBounds = new PageRowBounds(3, 5); 68 | users = userMapper.findAll(rowBounds); 69 | System.out.println("Total: " + rowBounds.getTotal()); 70 | for (User user : users) { 71 | System.out.println("Name: " + user.getName()); 72 | } 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-autoconfigure/src/main/java/com/github/pagehelper/autoconfigure/PageHelperAutoConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 abel533@gmail.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | package com.github.pagehelper.autoconfigure; 26 | 27 | import com.github.pagehelper.PageInterceptor; 28 | import org.apache.ibatis.plugin.Interceptor; 29 | import org.apache.ibatis.session.SqlSessionFactory; 30 | import org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration; 31 | import org.springframework.beans.factory.InitializingBean; 32 | import org.springframework.boot.autoconfigure.AutoConfigureAfter; 33 | import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; 34 | import org.springframework.boot.context.properties.EnableConfigurationProperties; 35 | import org.springframework.context.annotation.Configuration; 36 | import org.springframework.context.annotation.Lazy; 37 | 38 | import java.util.List; 39 | 40 | /** 41 | * 自定注入分页插件 42 | * 43 | * @author liuzh 44 | */ 45 | @Configuration 46 | @ConditionalOnBean(SqlSessionFactory.class) 47 | @EnableConfigurationProperties({PageHelperProperties.class, PageHelperStandardProperties.class}) 48 | @AutoConfigureAfter(MybatisAutoConfiguration.class) 49 | //@Import(PageHelperProperties.class) 50 | @Lazy(false) 51 | public class PageHelperAutoConfiguration implements InitializingBean { 52 | 53 | private final List sqlSessionFactoryList; 54 | 55 | private final PageHelperProperties properties; 56 | 57 | public PageHelperAutoConfiguration(List sqlSessionFactoryList, PageHelperStandardProperties standardProperties) { 58 | this.sqlSessionFactoryList = sqlSessionFactoryList; 59 | this.properties = standardProperties.getProperties(); 60 | } 61 | 62 | @Override 63 | public void afterPropertiesSet() throws Exception { 64 | PageInterceptor interceptor = new PageInterceptor(); 65 | interceptor.setProperties(this.properties); 66 | for (SqlSessionFactory sqlSessionFactory : sqlSessionFactoryList) { 67 | org.apache.ibatis.session.Configuration configuration = sqlSessionFactory.getConfiguration(); 68 | if (!containsInterceptor(configuration, interceptor)) { 69 | configuration.addInterceptor(interceptor); 70 | } 71 | } 72 | } 73 | 74 | /** 75 | * 是否已经存在相同的拦截器 76 | * 77 | * @param configuration 78 | * @param interceptor 79 | * @return 80 | */ 81 | private boolean containsInterceptor(org.apache.ibatis.session.Configuration configuration, Interceptor interceptor) { 82 | try { 83 | // getInterceptors since 3.2.2 84 | return configuration.getInterceptors().stream().anyMatch(config->interceptor.getClass().isAssignableFrom(config.getClass())); 85 | } catch (Exception e) { 86 | return false; 87 | } 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-autoconfigure/src/main/java/com/github/pagehelper/autoconfigure/PageHelperProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 abel533@gmail.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | package com.github.pagehelper.autoconfigure; 26 | 27 | import org.springframework.boot.context.properties.ConfigurationProperties; 28 | 29 | import java.util.Properties; 30 | 31 | /** 32 | * Configuration properties for PageHelper. 33 | * 34 | * @author liuzh 35 | */ 36 | @ConfigurationProperties(prefix = PageHelperProperties.PAGEHELPER_PREFIX) 37 | public class PageHelperProperties extends Properties { 38 | public static final String PAGEHELPER_PREFIX = "pagehelper"; 39 | 40 | public Boolean getOffsetAsPageNum() { 41 | return Boolean.valueOf(getProperty("offsetAsPageNum")); 42 | } 43 | 44 | public void setOffsetAsPageNum(Boolean offsetAsPageNum) { 45 | setProperty("offsetAsPageNum", offsetAsPageNum.toString()); 46 | } 47 | 48 | public Boolean getRowBoundsWithCount() { 49 | return Boolean.valueOf(getProperty("rowBoundsWithCount")); 50 | } 51 | 52 | public void setRowBoundsWithCount(Boolean rowBoundsWithCount) { 53 | setProperty("rowBoundsWithCount", rowBoundsWithCount.toString()); 54 | } 55 | 56 | public Boolean getPageSizeZero() { 57 | return Boolean.valueOf(getProperty("pageSizeZero")); 58 | } 59 | 60 | public void setPageSizeZero(Boolean pageSizeZero) { 61 | setProperty("pageSizeZero", pageSizeZero.toString()); 62 | } 63 | 64 | public Boolean getReasonable() { 65 | return Boolean.valueOf(getProperty("reasonable")); 66 | } 67 | 68 | public void setReasonable(Boolean reasonable) { 69 | setProperty("reasonable", reasonable.toString()); 70 | } 71 | 72 | public Boolean getSupportMethodsArguments() { 73 | return Boolean.valueOf(getProperty("supportMethodsArguments")); 74 | } 75 | 76 | public void setSupportMethodsArguments(Boolean supportMethodsArguments) { 77 | setProperty("supportMethodsArguments", supportMethodsArguments.toString()); 78 | } 79 | 80 | public String getDialect() { 81 | return getProperty("dialect"); 82 | } 83 | 84 | public void setDialect(String dialect) { 85 | setProperty("dialect", dialect); 86 | } 87 | 88 | public String getHelperDialect() { 89 | return getProperty("helperDialect"); 90 | } 91 | 92 | public void setHelperDialect(String helperDialect) { 93 | setProperty("helperDialect", helperDialect); 94 | } 95 | 96 | public Boolean getAutoRuntimeDialect() { 97 | return Boolean.valueOf(getProperty("autoRuntimeDialect")); 98 | } 99 | 100 | public void setAutoRuntimeDialect(Boolean autoRuntimeDialect) { 101 | setProperty("autoRuntimeDialect", autoRuntimeDialect.toString()); 102 | } 103 | 104 | public Boolean getAutoDialect() { 105 | return Boolean.valueOf(getProperty("autoDialect")); 106 | } 107 | 108 | public void setAutoDialect(Boolean autoDialect) { 109 | setProperty("autoDialect", autoDialect.toString()); 110 | } 111 | 112 | public Boolean getCloseConn() { 113 | return Boolean.valueOf(getProperty("closeConn")); 114 | } 115 | 116 | public void setCloseConn(Boolean closeConn) { 117 | setProperty("closeConn", closeConn.toString()); 118 | } 119 | 120 | public String getParams() { 121 | return getProperty("params"); 122 | } 123 | 124 | public void setParams(String params) { 125 | setProperty("params", params); 126 | } 127 | 128 | public Boolean getDefaultCount() { 129 | return Boolean.valueOf(getProperty("defaultCount")); 130 | } 131 | 132 | public void setDefaultCount(Boolean defaultCount) { 133 | setProperty("defaultCount", defaultCount.toString()); 134 | } 135 | 136 | public String getDialectAlias() { 137 | return getProperty("dialectAlias"); 138 | } 139 | 140 | public void setDialectAlias(String dialectAlias) { 141 | setProperty("dialectAlias", dialectAlias); 142 | } 143 | 144 | public String getAutoDialectClass() { 145 | return getProperty("autoDialectClass"); 146 | } 147 | 148 | public void setAutoDialectClass(String autoDialectClass) { 149 | setProperty("autoDialectClass", autoDialectClass); 150 | } 151 | 152 | public Boolean getAsyncCount() { 153 | return Boolean.valueOf(getProperty("asyncCount")); 154 | } 155 | 156 | public void setAsyncCount(Boolean asyncCount) { 157 | setProperty("asyncCount", asyncCount.toString()); 158 | } 159 | 160 | public String getCountSqlParser() { 161 | return getProperty("countSqlParser"); 162 | } 163 | 164 | public void setCountSqlParser(String countSqlParser) { 165 | setProperty("countSqlParser", countSqlParser); 166 | } 167 | 168 | public String getOrderBySqlParser() { 169 | return getProperty("orderBySqlParser"); 170 | } 171 | 172 | public void setOrderBySqlParser(String orderBySqlParser) { 173 | setProperty("orderBySqlParser", orderBySqlParser); 174 | } 175 | 176 | public String getSqlServerSqlParser() { 177 | return getProperty("sqlServerSqlParser"); 178 | } 179 | 180 | public void setSqlServerSqlParser(String sqlServerSqlParser) { 181 | setProperty("sqlServerSqlParser", sqlServerSqlParser); 182 | } 183 | 184 | public void setBannerEnabled(Boolean bannerEnabled) { 185 | setProperty("banner",bannerEnabled.toString()); 186 | } 187 | 188 | public Boolean getBannerEnabled() { 189 | return Boolean.valueOf(getProperty("banner")); 190 | } 191 | } 192 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PageHelper integration with Spring Boot 2 | 3 | PageHelper-Spring-Boot-Starter 帮助你集成分页插件到 Spring Boot。 4 | 5 | PageHelper-Spring-Boot-Starter will help you use PageHelper with Spring Boot. 6 | 7 | Support PageHelper 6.x 8 | 9 | ## How to use 10 | 在 pom.xml 中添加如下依赖: 11 | 12 | Add the following dependency to your pom.xml: 13 | 14 | ```xml 15 | 16 | 17 | com.github.pagehelper 18 | pagehelper-spring-boot-starter 19 | 2.1.1 20 | 21 | ``` 22 | 23 | ## 微信公众号 24 | 25 | 26 | 27 | ## v2.1.1 - 2025-06-20 28 | 29 | - 升级 PageHelper 到 6.1.1 30 | - 升级 MyBatis 到 3.5.19 31 | 32 | **当前版本支持 JDK17+ 和以下依赖版本:** 33 | 34 | - mybatis-spring-boot-starter 3.0.4 35 | - spring-boot-dependencies 3.5.0 36 | 37 | ## v2.1.0 - 2023-12-17 38 | 39 | - 升级 PageHelper 到 6.1.0,支持异步 count 40 | 等功能,详细查看 [6.1.0](https://github.com/pagehelper/Mybatis-PageHelper/releases/tag/v6.1.0) 41 | - 升级 MyBatis 到 3.5.15 42 | - 升级 springboot 到 2.7.18 43 | - 新增参数 `orderBySqlParser`,`OrderBySqlParser`改为接口,允许通过`orderBySqlParser`参数替换为自己的实现 44 | - 新增参数 `sqlServerSqlParser`,`SqlServerSqlParser`改为接口,允许通过`sqlServerSqlParser`参数替换为自己的实现 45 | - 接口 `CountSqlParser`,`OrderBySqlParser`,`SqlServerSqlParser` 还支持SPI方式覆盖默认实现,优先级低于参数指定 46 | 47 | ## v2.0.0 - 2023-11-05 48 | 49 | - 升级 PageHelper 到 6.0.0,支持异步 count 等功能,详细查看 [6.0](https://github.com/pagehelper/Mybatis-PageHelper/releases/tag/v6.0.0) 50 | - 升级 MyBatis 到 3.5.15 51 | - 升级 springboot 到 2.7.17 52 | - 新增参数 `asyncCount`,增加异步count支持,默认`false`,单次设置:`PageHelper.startPage(1, 10).enableAsyncCount()`; 53 | - 新增参数 `countSqlParser`,`CountSqlParser`改为接口,允许通过`countSqlParser`参数替换为自己的实现 54 | 55 | 参数示例: 56 | ```properties 57 | pagehelper.async-count=true 58 | ``` 59 | 60 | ## v1.4.7 - 2023-06-03 61 | 62 | - 升级 PageHelper 到 5.3.3 63 | - 升级 MyBatis 到 3.5.13 64 | - 升级 MyBatis Starter 到 2.3.1 65 | - 升级 springboot 到 2.7.12 66 | 67 | ## v1.4.6 - 2022-11-28 68 | 69 | - 兼容 Spring Boot 3.0 by [pky920216344](https://github.com/pky920216344) 70 | - 功能完善:存在PageInterceptor及其子类就不再添加过滤器 by [jingheee](https://github.com/jingheee) 71 | 72 | ## v1.4.5 - 2022-09-18 73 | 74 | - 升级 PageHelper 到 5.3.2 75 | 76 | ## v1.4.4 - 2022-09-16 77 | 78 | - 修复配置文件中kebab-case风格的配置项失效的问题 pr#138, by ShoWen 79 | - 兼容性支持,demo配置修改 80 | - 升级 springboot 到 2.7.3 81 | - 82 | 83 | ## v1.4.3 - 2022-06-18 84 | 85 | - 升级 PageHelper 到 5.3.1 86 | - 升级 MyBatis 到 3.5.10 87 | - 升级 springboot 到 2.7.0 88 | 89 | ## v1.4.2 - 2022-04-06 90 | 91 | - 升级 MyBatis 到 3.5.9 92 | - 升级 MyBatis Starter 到 2.2.2 93 | - 升级 springboot 到 2.6.6 94 | 95 | ## v1.4.1 - 2021-11-24 96 | 97 | - 升级 springboot 到 2.6.0,兼容性修复,解决循环依赖 98 | 99 | ## v1.4.0 - 2021-10-07 100 | 101 | - 升级 PageHelper 到 5.3.0 102 | - 升级 springboot 到 2.5.5 103 | - 增加 `autoDialectClass` 参数,详情看 PageHelper 更新日志 104 | 105 | 106 | ## v1.3.1 - 2021-06-20 107 | 108 | - 升级 PageHelper 到 5.2.1 109 | - 升级 MyBatis 到 3.5.7 110 | - 升级 MyBatis Starter 到 2.2.0 111 | - 升级 springboot 到 2.5.1 112 | - `PageHelperAutoConfiguration` 使用 `InitializingBean` 接口代替 `@PostConstruct` 注解 113 | 114 | ## v1.3.0 - 2020-07-26 115 | 116 | - 升级 PageHelper 到 5.2.0,包含大量改动,详细内容参考:[PageHelper 更新日志](https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/zh/Changelog.md) 117 | - 升级 MyBatis 到 3.5.5 118 | - 升级 MyBatis Starter 到 2.1.3 119 | - 升级 springboot 到 2.3.1.RELEASE 120 | - `PageHelperAutoConfiguration` 增加 `@Lazy(false)` 注解,当配置延迟加载时,避免分页插件出错 121 | - 添加分页插件时判断是否已经配置过同一个实例(不同的配置是不同的实例) 122 | 123 | ## v1.2.13 - 2019-11-26 124 | 125 | - 升级 PageHelper 到 5.1.11 126 | - 升级 MyBatis 到 3.5.3 127 | - 升级 MyBatis Starter 到 2.1.1 128 | - 升级 springboot 到 2.2.1.RELEASE 129 | 130 | ## v1.2.12 - 2019-06-05 131 | 132 | - 升级 PageHelper 到 5.1.10 133 | 134 | ## v1.2.11 - 2019-05-29 135 | 136 | - 升级 PageHelper 到 5.1.9 137 | - 升级 MyBatis 到 3.5.1 138 | - 升级 MyBatis Starter 到 2.0.1 139 | - 升级 springboot 到 2.1.5.RELEASE 140 | 141 | ## v1.2.10 - 2018-11-11 142 | 143 | - 升级 PageHelper 到 5.1.8 144 | - 升级 springboot 到 2.1.0.RELEASE 145 | 146 | ## v1.2.9 - 2018-10-11 147 | 148 | - 升级 PageHelper 到 5.1.7 149 | 150 | >v1.2.8 由于未修改版本,仍然和 v1.2.7 相同。 151 | 152 | ## v1.2.7 - 2018-09-04 153 | 154 | - 升级 PageHelper 到 5.1.6 155 | 156 | 157 | ## v1.2.6 - 2018-09-04 158 | 159 | - 升级 PageHelper 到 5.1.5 160 | 161 | 162 | ## v1.2.5 - 2018-04-22 163 | 164 | - 升级 PageHelper 到 5.1.4(默认增加对达梦数据库的支持) 165 | - 升级 MyBatis 到 3.4.6 166 | 167 | ## v1.2.4 - 2018-04-07 168 | 169 | - 升级 PageHelper 到 5.1.3 170 | - 升级 springboot 到 2.0.1.RELEASE 171 | - 增加 dialectAlias 参数,允许配置自定义实现的 别名,可以用于根据JDBCURL自动获取对应实现,允许通过此种方式覆盖已有的实现,配置示例如(多个配置用分号`;`隔开): 172 | ```properties 173 | pagehelper.dialect-alias=oracle=com.github.pagehelper.dialect.helper.OracleDialect 174 | ``` 175 | - 增加 defaultCount 参数,用于控制默认不带 count 查询的方法中,是否执行 count 查询,默认 true 会执行 count 查询,这是一个全局生效的参数,多数据源时也是统一的行为。配置示例如: 176 | ```properties 177 | pagehelper.default-count=false 178 | ``` 179 | 180 | 181 | ## v1.2.3 - 2017-09-25 182 | 183 | - 修改属性获取方式,兼容 Spring Boot 1.x 和 2.x 184 | - 第三方扩展分页插件时使用到额外属性时,配置属性要和属性名完全匹配 185 | - 升级 springboot 到 1.5.7.RELEASE 186 | - 升级 MyBatis-Starter 版本到 1.3.1 187 | 188 | ## v1.2.2 - 2017-09-18 189 | 190 | - 升级 pagehelper 到 5.1.2 191 | 192 | ## v1.2.1 - 2017-08-30 193 | 194 | - 升级 pagehelper 到 5.1.1 195 | 196 | ## v1.2.0 - 2017-08-28 197 | 198 | - 升级 pagehelper 到 5.1.0 199 | 200 | ## v1.1.3 - 2017-08-01 201 | 202 | - 升级 pagehelper 到 5.0.4 203 | - 升级 springboot 到 1.5.6.RELEASE 204 | 205 | ## v1.1.2 - 2017-06-28 by [drtrang](https://github.com/drtrang) 206 | 207 | - 升级 pagehelper 到 5.0.3 208 | - 升级 springboot 到 1.5.4.RELEASE 209 | - 将 maven-compiler-plugin 和 maven-source-plugin 从 release profile 中提出来作为全局插件,并且增加继承属性,解决 `PageHelperAutoConfiguration` 类中的 `@Override` 报错问题。 210 | 211 | ## v1.1.1 - 2017-04-25 212 | - 增加多数据源支持 [#pr6](https://github.com/pagehelper/pagehelper-spring-boot/pull/6) by [yangBin666](https://github.com/yangBin666) 213 | - 升级分页插件 PageHelper 版本到 5.0.1 214 | - 升级 MyBatis 版本到 3.4.4 215 | - 升级 Spring Boot 版本到 1.5.3.RELEASE 216 | - 升级 MyBatis-Starter 版本到 1.3.0 217 | 218 | ## v1.1.0 - 2017-02-04 219 | - 解决可能会注册两次分页插件的问题。 220 | - 增加 PageHelperProperties 注入,常用属性可以通过 IDE 自动提示 221 | 222 | ![IDE 自动提示](properties.png) 223 | 224 | ## Example 225 | >https://github.com/abel533/MyBatis-Spring-Boot 226 | 227 | ## PageHelper 228 | >https://github.com/pagehelper/Mybatis-PageHelper 229 | 230 | ## Special Configurations 231 | 一般情况下,你不需要做任何配置。 232 | 233 | Normally, you don't need to do any configuration. 234 | 235 | 如果需要配置,可以使用如下方式进行配置: 236 | 237 | You can config PageHelper as the following: 238 | 239 | application.properties: 240 | ```properties 241 | pagehelper.propertyName=propertyValue 242 | ``` 243 | 注意 pagehelper 配置,因为分页插件根据自己的扩展不同,支持的参数也不同,所以不能用固定的对象接收参数,所以这里使用的 `Map`,因此参数名是什么这里就写什么,IDE 也不会有自动提示。 244 | 245 | 关于可配置的属性请参考 [如何使用分页插件](https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/zh/HowToUse.md)。 246 | 247 | You can configure the properties of the reference here [How to use the PageHelper](https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/en/HowToUse.md). 248 | 249 | ## Interceptor Order 250 | 251 | 如果你想要控制 拦截器插件的顺序,可以通过下面注解控制: 252 | 253 | If you want to control the order in which the interceptor plug-in, you can use the following annotation control: 254 | ```java 255 | @AutoConfigureAfter(PageHelperAutoConfiguration.class) 256 | //Or 257 | @AutoConfigureBefore(PageHelperAutoConfiguration.class) 258 | ``` 259 | 260 | ## 感谢所有项目贡献者! 261 | 262 | 263 | 264 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 28 | 4.0.0 29 | 30 | com.github.pagehelper 31 | pagehelper-spring-boot 32 | ${revision} 33 | pom 34 | 35 | pagehelper-spring-boot 36 | Spring Boot Support for PageHelper 37 | https://github.com/pagehelper/pagehelper-spring-boot/ 38 | 39 | 40 | 41 | The MIT License (MIT) 42 | https://github.com/pagehelper/pagehelper-spring-boot/blob/master/LICENSE 43 | 44 | 45 | 46 | 47 | 48 | abel533 49 | abel533@gmail.com 50 | 51 | 52 | 53 | 54 | scm:git:git@github.com:pagehelper/pagehelper-spring-boot.git 55 | scm:git:git@github.com:pagehelper/pagehelper-spring-boot.git 56 | git@github.com:pagehelper/pagehelper-spring-boot.git 57 | 58 | 59 | 60 | pagehelper-spring-boot-autoconfigure 61 | pagehelper-spring-boot-starter 62 | pagehelper-spring-boot-samples 63 | 64 | 65 | 66 | 2.1.1 67 | 68 | 8 69 | 8 70 | UTF-8 71 | UTF-8 72 | 73 | 3.5.19 74 | 6.1.1 75 | 2.3.2 76 | 2.7.18 77 | 78 | 79 | 80 | 81 | 82 | org.mybatis 83 | mybatis 84 | ${mybatis.version} 85 | 86 | 87 | com.github.pagehelper 88 | pagehelper 89 | ${pagehelper.version} 90 | 91 | 92 | org.mybatis.spring.boot 93 | mybatis-spring-boot-autoconfigure 94 | ${mybatis-spring-boot.version} 95 | 96 | 97 | com.github.pagehelper 98 | pagehelper-spring-boot-autoconfigure 99 | ${project.version} 100 | 101 | 102 | com.github.pagehelper 103 | pagehelper-spring-boot-starter 104 | ${project.version} 105 | 106 | 107 | org.mybatis.spring.boot 108 | mybatis-spring-boot-starter 109 | ${mybatis-spring-boot.version} 110 | 111 | 112 | org.springframework.boot 113 | spring-boot-dependencies 114 | ${spring-boot.version} 115 | pom 116 | import 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | release 125 | 126 | 127 | 128 | 129 | org.apache.maven.plugins 130 | maven-javadoc-plugin 131 | 3.2.0 132 | 133 | 134 | -Xdoclint:none 135 | 136 | 137 | 138 | 139 | package 140 | 141 | jar 142 | 143 | 144 | 145 | 146 | 147 | 148 | maven-gpg-plugin 149 | true 150 | 151 | 152 | sign-artifacts 153 | verify 154 | 155 | sign 156 | 157 | 158 | 159 | 160 | 161 | --pinentry-mode 162 | loopback 163 | 164 | 165 | 166 | 167 | org.sonatype.plugins 168 | nexus-staging-maven-plugin 169 | true 170 | 171 | ossrh 172 | https://oss.sonatype.org/ 173 | true 174 | 175 | 176 | 177 | 178 | 179 | 180 | ossrh 181 | https://oss.sonatype.org/content/repositories/snapshots/ 182 | 183 | 184 | ossrh 185 | https://oss.sonatype.org/service/local/staging/deploy/maven2/ 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | maven-source-plugin 196 | 2.2.1 197 | true 198 | 199 | 200 | package 201 | 202 | jar-no-fork 203 | 204 | 205 | 206 | 207 | 208 | org.codehaus.mojo 209 | flatten-maven-plugin 210 | 1.1.0 211 | 212 | true 213 | resolveCiFriendliesOnly 214 | 215 | 216 | 217 | flatten 218 | process-resources 219 | 220 | flatten 221 | 222 | 223 | 224 | flatten.clean 225 | clean 226 | 227 | clean 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-autoconfigure/src/main/java/com/github/pagehelper/autoconfigure/PageHelperStandardProperties.java: -------------------------------------------------------------------------------- 1 | package com.github.pagehelper.autoconfigure; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | 6 | import java.util.Optional; 7 | 8 | /** 9 | * 原来的{@link PageHelperProperties}继承了{@link java.util.Properties}
10 | * 在使用中发现SpringBoot会直接将application.yml(application.properties)的配置名原样set到集合中, 11 | * 这样会导致配置文件里的kebab-case风格配置映射到配置类中还是kebab-case而不是camelCase, 12 | * 之后设置属性的时候就会因为找不到camelCase的配置导致失效。 13 | *
14 | * 所有kebab-case风格的配置项都会产生这个问题,即配置不生效。 15 | *
16 | * 这个类不继承{@link java.util.Properties},用于提前接收配置文件中的配置项, 17 | * 由于没有继承{@link java.util.Properties},SpringBoot可以做正常的风格转换, 18 | * 转换完成后再将camelCase风格的配置放到原来的{@link PageHelperProperties}中 19 | * 20 | * @author showen 21 | */ 22 | @ConfigurationProperties(prefix = PageHelperProperties.PAGEHELPER_PREFIX) 23 | public class PageHelperStandardProperties { 24 | private final PageHelperProperties properties; 25 | private Boolean offsetAsPageNum; 26 | private Boolean rowBoundsWithCount; 27 | private Boolean pageSizeZero; 28 | private Boolean reasonable; 29 | private Boolean supportMethodsArguments; 30 | private String dialect; 31 | private String helperDialect; 32 | private Boolean autoRuntimeDialect; 33 | private Boolean autoDialect; 34 | private Boolean closeConn; 35 | private String params; 36 | private Boolean defaultCount; 37 | private String dialectAlias; 38 | private String autoDialectClass; 39 | private Boolean useSqlserver2012; 40 | private String countColumn; 41 | private String replaceSql; 42 | private String sqlCacheClass; 43 | private String boundSqlInterceptors; 44 | private Boolean keepOrderBy; 45 | private Boolean keepSubSelectOrderBy; 46 | private String sqlParser; 47 | private Boolean asyncCount; 48 | private String countSqlParser; 49 | private String orderBySqlParser; 50 | private String sqlServerSqlParser; 51 | 52 | @Autowired 53 | public PageHelperStandardProperties(PageHelperProperties properties) { 54 | this.properties = properties; 55 | } 56 | 57 | public PageHelperProperties getProperties() { 58 | return properties; 59 | } 60 | 61 | public Boolean getOffsetAsPageNum() { 62 | return offsetAsPageNum; 63 | } 64 | 65 | public void setOffsetAsPageNum(Boolean offsetAsPageNum) { 66 | this.offsetAsPageNum = offsetAsPageNum; 67 | Optional.ofNullable(offsetAsPageNum).ifPresent(properties::setOffsetAsPageNum); 68 | } 69 | 70 | public Boolean getRowBoundsWithCount() { 71 | return rowBoundsWithCount; 72 | } 73 | 74 | public void setRowBoundsWithCount(Boolean rowBoundsWithCount) { 75 | this.rowBoundsWithCount = rowBoundsWithCount; 76 | Optional.ofNullable(rowBoundsWithCount).ifPresent(properties::setRowBoundsWithCount); 77 | } 78 | 79 | public Boolean getPageSizeZero() { 80 | return pageSizeZero; 81 | } 82 | 83 | public void setPageSizeZero(Boolean pageSizeZero) { 84 | this.pageSizeZero = pageSizeZero; 85 | Optional.ofNullable(pageSizeZero).ifPresent(properties::setPageSizeZero); 86 | } 87 | 88 | public Boolean getReasonable() { 89 | return reasonable; 90 | } 91 | 92 | public void setReasonable(Boolean reasonable) { 93 | this.reasonable = reasonable; 94 | Optional.ofNullable(reasonable).ifPresent(properties::setReasonable); 95 | } 96 | 97 | public Boolean getSupportMethodsArguments() { 98 | return supportMethodsArguments; 99 | } 100 | 101 | public void setSupportMethodsArguments(Boolean supportMethodsArguments) { 102 | this.supportMethodsArguments = supportMethodsArguments; 103 | Optional.ofNullable(supportMethodsArguments).ifPresent(properties::setSupportMethodsArguments); 104 | } 105 | 106 | public String getDialect() { 107 | return dialect; 108 | } 109 | 110 | public void setDialect(String dialect) { 111 | this.dialect = dialect; 112 | Optional.ofNullable(dialect).ifPresent(properties::setDialect); 113 | } 114 | 115 | public String getHelperDialect() { 116 | return helperDialect; 117 | } 118 | 119 | public void setHelperDialect(String helperDialect) { 120 | this.helperDialect = helperDialect; 121 | Optional.ofNullable(helperDialect).ifPresent(properties::setHelperDialect); 122 | } 123 | 124 | public Boolean getAutoRuntimeDialect() { 125 | return autoRuntimeDialect; 126 | } 127 | 128 | public void setAutoRuntimeDialect(Boolean autoRuntimeDialect) { 129 | this.autoRuntimeDialect = autoRuntimeDialect; 130 | Optional.ofNullable(autoRuntimeDialect).ifPresent(properties::setAutoRuntimeDialect); 131 | } 132 | 133 | public Boolean getAutoDialect() { 134 | return autoDialect; 135 | } 136 | 137 | public void setAutoDialect(Boolean autoDialect) { 138 | this.autoDialect = autoDialect; 139 | Optional.ofNullable(autoDialect).ifPresent(properties::setAutoDialect); 140 | } 141 | 142 | public Boolean getCloseConn() { 143 | return closeConn; 144 | } 145 | 146 | public void setCloseConn(Boolean closeConn) { 147 | this.closeConn = closeConn; 148 | Optional.ofNullable(closeConn).ifPresent(properties::setCloseConn); 149 | } 150 | 151 | public String getParams() { 152 | return params; 153 | } 154 | 155 | public void setParams(String params) { 156 | this.params = params; 157 | Optional.ofNullable(params).ifPresent(properties::setParams); 158 | } 159 | 160 | public Boolean getDefaultCount() { 161 | return defaultCount; 162 | } 163 | 164 | public void setDefaultCount(Boolean defaultCount) { 165 | this.defaultCount = defaultCount; 166 | Optional.ofNullable(defaultCount).ifPresent(properties::setDefaultCount); 167 | } 168 | 169 | public String getDialectAlias() { 170 | return dialectAlias; 171 | } 172 | 173 | public void setDialectAlias(String dialectAlias) { 174 | this.dialectAlias = dialectAlias; 175 | Optional.ofNullable(dialectAlias).ifPresent(properties::setDialectAlias); 176 | } 177 | 178 | public String getAutoDialectClass() { 179 | return autoDialectClass; 180 | } 181 | 182 | public void setAutoDialectClass(String autoDialectClass) { 183 | this.autoDialectClass = autoDialectClass; 184 | Optional.ofNullable(autoDialectClass).ifPresent(properties::setAutoDialectClass); 185 | } 186 | 187 | public Boolean getUseSqlserver2012() { 188 | return useSqlserver2012; 189 | } 190 | 191 | public void setUseSqlserver2012(Boolean useSqlserver2012) { 192 | this.useSqlserver2012 = useSqlserver2012; 193 | Optional.ofNullable(useSqlserver2012).ifPresent(v -> properties.setProperty("useSqlserver2012", v.toString())); 194 | } 195 | 196 | public String getCountColumn() { 197 | return countColumn; 198 | } 199 | 200 | public void setCountColumn(String countColumn) { 201 | this.countColumn = countColumn; 202 | Optional.ofNullable(countColumn).ifPresent(v -> properties.setProperty("countColumn", v)); 203 | } 204 | 205 | public String getReplaceSql() { 206 | return replaceSql; 207 | } 208 | 209 | public void setReplaceSql(String replaceSql) { 210 | this.replaceSql = replaceSql; 211 | Optional.ofNullable(replaceSql).ifPresent(v -> properties.setProperty("replaceSql", v)); 212 | } 213 | 214 | public String getSqlCacheClass() { 215 | return sqlCacheClass; 216 | } 217 | 218 | public void setSqlCacheClass(String sqlCacheClass) { 219 | this.sqlCacheClass = sqlCacheClass; 220 | Optional.ofNullable(sqlCacheClass).ifPresent(v -> properties.setProperty("sqlCacheClass", v)); 221 | } 222 | 223 | public String getBoundSqlInterceptors() { 224 | return boundSqlInterceptors; 225 | } 226 | 227 | public void setBoundSqlInterceptors(String boundSqlInterceptors) { 228 | this.boundSqlInterceptors = boundSqlInterceptors; 229 | Optional.ofNullable(boundSqlInterceptors).ifPresent(v -> properties.setProperty("boundSqlInterceptors", v)); 230 | } 231 | 232 | public Boolean getKeepOrderBy() { 233 | return keepOrderBy; 234 | } 235 | 236 | public void setKeepOrderBy(Boolean keepOrderBy) { 237 | this.keepOrderBy = keepOrderBy; 238 | Optional.ofNullable(keepOrderBy).ifPresent(v -> properties.setProperty("keepOrderBy", v.toString())); 239 | } 240 | 241 | public Boolean getKeepSubSelectOrderBy() { 242 | return keepSubSelectOrderBy; 243 | } 244 | 245 | public void setKeepSubSelectOrderBy(Boolean keepSubSelectOrderBy) { 246 | this.keepSubSelectOrderBy = keepSubSelectOrderBy; 247 | Optional.ofNullable(keepSubSelectOrderBy).ifPresent(v -> properties.setProperty("keepSubSelectOrderBy", v.toString())); 248 | } 249 | 250 | public String getSqlParser() { 251 | return sqlParser; 252 | } 253 | 254 | public void setSqlParser(String sqlParser) { 255 | this.sqlParser = sqlParser; 256 | Optional.ofNullable(sqlParser).ifPresent(v -> properties.setProperty("sqlParser", v)); 257 | } 258 | 259 | public Boolean getAsyncCount() { 260 | return asyncCount; 261 | } 262 | 263 | public void setAsyncCount(Boolean asyncCount) { 264 | this.asyncCount = asyncCount; 265 | Optional.ofNullable(asyncCount).ifPresent(v -> properties.setProperty("asyncCount", v.toString())); 266 | } 267 | 268 | public String getCountSqlParser() { 269 | return countSqlParser; 270 | } 271 | 272 | public void setCountSqlParser(String countSqlParser) { 273 | this.countSqlParser = countSqlParser; 274 | Optional.ofNullable(countSqlParser).ifPresent(v -> properties.setProperty("countSqlParser", v)); 275 | } 276 | 277 | public String getOrderBySqlParser() { 278 | return orderBySqlParser; 279 | } 280 | 281 | public void setOrderBySqlParser(String orderBySqlParser) { 282 | this.orderBySqlParser = orderBySqlParser; 283 | Optional.ofNullable(orderBySqlParser).ifPresent(v -> properties.setProperty("orderBySqlParser", v)); 284 | } 285 | 286 | public String getSqlServerSqlParser() { 287 | return sqlServerSqlParser; 288 | } 289 | 290 | public void setSqlServerSqlParser(String sqlServerSqlParser) { 291 | this.sqlServerSqlParser = sqlServerSqlParser; 292 | Optional.ofNullable(sqlServerSqlParser).ifPresent(v -> properties.setProperty("sqlServerSqlParser", v)); 293 | } 294 | } 295 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-xml/src/main/resources/import.sql: -------------------------------------------------------------------------------- 1 | drop table sys_user if exists; 2 | 3 | create table sys_user 4 | ( 5 | id integer, 6 | name varchar(32), 7 | py varchar(5) 8 | ); 9 | 10 | insert into sys_user(id, name, py) 11 | values ('1', '毕淑儒', 'BSR'); 12 | insert into sys_user(id, name, py) 13 | values ('2', '蔡兴熙', 'CXX'); 14 | insert into sys_user(id, name, py) 15 | values ('3', '曾三杰', 'ZSJ'); 16 | insert into sys_user(id, name, py) 17 | values ('4', '常元琴', 'CYQ'); 18 | insert into sys_user(id, name, py) 19 | values ('5', '陈栋芬', 'CDF'); 20 | insert into sys_user(id, name, py) 21 | values ('6', '陈宁婷', 'CNZ'); 22 | insert into sys_user(id, name, py) 23 | values ('7', '陈瑞', 'CR'); 24 | insert into sys_user(id, name, py) 25 | values ('8', '陈武宵', 'CWX'); 26 | insert into sys_user(id, name, py) 27 | values ('9', '陈晓丽', 'CXL'); 28 | insert into sys_user(id, name, py) 29 | values ('10', '陈翼涛', 'CYT'); 30 | insert into sys_user(id, name, py) 31 | values ('11', '陈宇然', 'CYR'); 32 | insert into sys_user(id, name, py) 33 | values ('12', '陈震', 'CZ'); 34 | insert into sys_user(id, name, py) 35 | values ('13', '程太君', 'CTJ'); 36 | insert into sys_user(id, name, py) 37 | values ('14', '程玉娜', 'CYN'); 38 | insert into sys_user(id, name, py) 39 | values ('15', '丛贺轩', 'CHX'); 40 | insert into sys_user(id, name, py) 41 | values ('16', '戴国宇', 'DGY'); 42 | insert into sys_user(id, name, py) 43 | values ('17', '戴杰亮', 'DJL'); 44 | insert into sys_user(id, name, py) 45 | values ('18', '丁玉华', 'DYH'); 46 | insert into sys_user(id, name, py) 47 | values ('19', '董秋明', 'DQM'); 48 | insert into sys_user(id, name, py) 49 | values ('20', '董政厚', 'DZH'); 50 | insert into sys_user(id, name, py) 51 | values ('21', '杜玉焱', 'DYZ'); 52 | insert into sys_user(id, name, py) 53 | values ('22', '段瑜芝', 'DZZ'); 54 | insert into sys_user(id, name, py) 55 | values ('23', '傅广友', 'FGY'); 56 | insert into sys_user(id, name, py) 57 | values ('24', '傅井飞', 'FJF'); 58 | insert into sys_user(id, name, py) 59 | values ('25', '高辉涛', 'GHT'); 60 | insert into sys_user(id, name, py) 61 | values ('26', '高龙飞', 'GLF'); 62 | insert into sys_user(id, name, py) 63 | values ('27', '高汝英', 'GRY'); 64 | insert into sys_user(id, name, py) 65 | values ('28', '高云天', 'GYT'); 66 | insert into sys_user(id, name, py) 67 | values ('29', '郭义民', 'GYM'); 68 | insert into sys_user(id, name, py) 69 | values ('30', '郭永洪', 'GYH'); 70 | insert into sys_user(id, name, py) 71 | values ('31', '韩国茜', 'HGZ'); 72 | insert into sys_user(id, name, py) 73 | values ('32', '韩龙康', 'HLK'); 74 | insert into sys_user(id, name, py) 75 | values ('33', '韩伟佳', 'HWJ'); 76 | insert into sys_user(id, name, py) 77 | values ('34', '韩扬谦', 'HYQ'); 78 | insert into sys_user(id, name, py) 79 | values ('35', '郝静生', 'HJS'); 80 | insert into sys_user(id, name, py) 81 | values ('36', '何柏红', 'HBH'); 82 | insert into sys_user(id, name, py) 83 | values ('37', '何彩智', 'HCZ'); 84 | insert into sys_user(id, name, py) 85 | values ('38', '何陶增', 'HTZ'); 86 | insert into sys_user(id, name, py) 87 | values ('39', '何薇', 'HZ'); 88 | insert into sys_user(id, name, py) 89 | values ('40', '何小凡', 'HXF'); 90 | insert into sys_user(id, name, py) 91 | values ('41', '何振平', 'HZP'); 92 | insert into sys_user(id, name, py) 93 | values ('42', '洪彩辉', 'HCH'); 94 | insert into sys_user(id, name, py) 95 | values ('43', '胡仕明', 'HSM'); 96 | insert into sys_user(id, name, py) 97 | values ('44', '黄建朋', 'HJP'); 98 | insert into sys_user(id, name, py) 99 | values ('45', '黄祥荣', 'HXR'); 100 | insert into sys_user(id, name, py) 101 | values ('46', '黄璇平', 'HZP'); 102 | insert into sys_user(id, name, py) 103 | values ('47', '贾茂飞', 'JMF'); 104 | insert into sys_user(id, name, py) 105 | values ('48', '李迪茹', 'LDR'); 106 | insert into sys_user(id, name, py) 107 | values ('49', '李桂博', 'LGB'); 108 | insert into sys_user(id, name, py) 109 | values ('50', '李国祯', 'LGZ'); 110 | insert into sys_user(id, name, py) 111 | values ('51', '李宏川', 'LHC'); 112 | insert into sys_user(id, name, py) 113 | values ('52', '李梅', 'LM'); 114 | insert into sys_user(id, name, py) 115 | values ('53', '李媚文', 'LMW'); 116 | insert into sys_user(id, name, py) 117 | values ('54', '李孟惠', 'LMH'); 118 | insert into sys_user(id, name, py) 119 | values ('55', '李南懋', 'LNZ'); 120 | insert into sys_user(id, name, py) 121 | values ('56', '李鹏龙', 'LPL'); 122 | insert into sys_user(id, name, py) 123 | values ('57', '李诗庸', 'LSY'); 124 | insert into sys_user(id, name, py) 125 | values ('58', '李姝勇', 'LZY'); 126 | insert into sys_user(id, name, py) 127 | values ('59', '李树鹏', 'LSP'); 128 | insert into sys_user(id, name, py) 129 | values ('60', '李薇红', 'LZH'); 130 | insert into sys_user(id, name, py) 131 | values ('61', '李文章', 'LWZ'); 132 | insert into sys_user(id, name, py) 133 | values ('62', '李星佳', 'LXJ'); 134 | insert into sys_user(id, name, py) 135 | values ('63', '李兴', 'LX'); 136 | insert into sys_user(id, name, py) 137 | values ('64', '李秀倩', 'LXZ'); 138 | insert into sys_user(id, name, py) 139 | values ('65', '李艳生', 'LYS'); 140 | insert into sys_user(id, name, py) 141 | values ('66', '李燕金', 'LYJ'); 142 | insert into sys_user(id, name, py) 143 | values ('67', '李玉彪', 'LYB'); 144 | insert into sys_user(id, name, py) 145 | values ('68', '李振峰', 'LZF'); 146 | insert into sys_user(id, name, py) 147 | values ('69', '梁斌芳', 'LBF'); 148 | insert into sys_user(id, name, py) 149 | values ('70', '梁国云', 'LGY'); 150 | insert into sys_user(id, name, py) 151 | values ('71', '梁巧爱', 'LQA'); 152 | insert into sys_user(id, name, py) 153 | values ('72', '梁照金', 'LZJ'); 154 | insert into sys_user(id, name, py) 155 | values ('73', '林婧美', 'LZM'); 156 | insert into sys_user(id, name, py) 157 | values ('74', '林沛寿', 'LPS'); 158 | insert into sys_user(id, name, py) 159 | values ('75', '林薇程', 'LZC'); 160 | insert into sys_user(id, name, py) 161 | values ('76', '林伟玉', 'LWY'); 162 | insert into sys_user(id, name, py) 163 | values ('77', '林艺玲', 'LYL'); 164 | insert into sys_user(id, name, py) 165 | values ('78', '刘睿', 'LR'); 166 | insert into sys_user(id, name, py) 167 | values ('79', '刘芊芊', 'LQQ'); 168 | insert into sys_user(id, name, py) 169 | values ('80', '刘海波', 'LHB'); 170 | insert into sys_user(id, name, py) 171 | values ('81', '刘斓琴', 'LZQ'); 172 | insert into sys_user(id, name, py) 173 | values ('82', '刘磊东', 'LLD'); 174 | insert into sys_user(id, name, py) 175 | values ('83', '刘明琪', 'LMZ'); 176 | insert into sys_user(id, name, py) 177 | values ('84', '刘铭恩', 'LME'); 178 | insert into sys_user(id, name, py) 179 | values ('85', '刘任恺', 'LRZ'); 180 | insert into sys_user(id, name, py) 181 | values ('86', '刘水秋', 'LSQ'); 182 | insert into sys_user(id, name, py) 183 | values ('87', '刘文萱', 'LWZ'); 184 | insert into sys_user(id, name, py) 185 | values ('88', '刘祥瑶', 'LXY'); 186 | insert into sys_user(id, name, py) 187 | values ('89', '刘薪坪', 'LXP'); 188 | insert into sys_user(id, name, py) 189 | values ('90', '刘秀涛', 'LXT'); 190 | insert into sys_user(id, name, py) 191 | values ('91', '刘彦利', 'LYL'); 192 | insert into sys_user(id, name, py) 193 | values ('92', '刘益存', 'LYC'); 194 | insert into sys_user(id, name, py) 195 | values ('93', '龙子苹', 'LZP'); 196 | insert into sys_user(id, name, py) 197 | values ('94', '卢秀剑', 'LXJ'); 198 | insert into sys_user(id, name, py) 199 | values ('95', '罗乔华', 'LQH'); 200 | insert into sys_user(id, name, py) 201 | values ('96', '罗希清', 'LXQ'); 202 | insert into sys_user(id, name, py) 203 | values ('97', '马家兰', 'MJL'); 204 | insert into sys_user(id, name, py) 205 | values ('98', '马莲莹', 'MLY'); 206 | insert into sys_user(id, name, py) 207 | values ('99', '马宁文', 'MNW'); 208 | insert into sys_user(id, name, py) 209 | values ('100', '马水鹏', 'MSP'); 210 | insert into sys_user(id, name, py) 211 | values ('101', '孟三云', 'MSY'); 212 | insert into sys_user(id, name, py) 213 | values ('102', '孟寿云', 'MSY'); 214 | insert into sys_user(id, name, py) 215 | values ('103', '聂伟元', 'NWY'); 216 | insert into sys_user(id, name, py) 217 | values ('104', '潘永飞', 'PYF'); 218 | insert into sys_user(id, name, py) 219 | values ('105', '彭健颖', 'PJY'); 220 | insert into sys_user(id, name, py) 221 | values ('106', '钱文松', 'QWS'); 222 | insert into sys_user(id, name, py) 223 | values ('107', '屈江珍', 'QJZ'); 224 | insert into sys_user(id, name, py) 225 | values ('108', '邵建林', 'SJL'); 226 | insert into sys_user(id, name, py) 227 | values ('109', '施家晖', 'SJZ'); 228 | insert into sys_user(id, name, py) 229 | values ('110', '施艺英', 'SYY'); 230 | insert into sys_user(id, name, py) 231 | values ('111', '孙常程', 'SCC'); 232 | insert into sys_user(id, name, py) 233 | values ('112', '谭佳盈', 'TJY'); 234 | insert into sys_user(id, name, py) 235 | values ('113', '唐春珊', 'TCS'); 236 | insert into sys_user(id, name, py) 237 | values ('114', '唐军霞', 'TJX'); 238 | insert into sys_user(id, name, py) 239 | values ('115', '唐里丽', 'TLL'); 240 | insert into sys_user(id, name, py) 241 | values ('116', '陶姐华', 'TJH'); 242 | insert into sys_user(id, name, py) 243 | values ('117', '万圻艳', 'WZY'); 244 | insert into sys_user(id, name, py) 245 | values ('118', '王傲凤', 'WAF'); 246 | insert into sys_user(id, name, py) 247 | values ('119', '王德英', 'WDY'); 248 | insert into sys_user(id, name, py) 249 | values ('120', '王鼎华', 'WDH'); 250 | insert into sys_user(id, name, py) 251 | values ('121', '王慧', 'WH'); 252 | insert into sys_user(id, name, py) 253 | values ('122', '王佳光', 'WJG'); 254 | insert into sys_user(id, name, py) 255 | values ('123', '王家胜', 'WJS'); 256 | insert into sys_user(id, name, py) 257 | values ('124', '王竞飞', 'WJF'); 258 | insert into sys_user(id, name, py) 259 | values ('125', '王科磊', 'WKL'); 260 | insert into sys_user(id, name, py) 261 | values ('126', '王丽章', 'WLZ'); 262 | insert into sys_user(id, name, py) 263 | values ('127', '王励苗', 'WLM'); 264 | insert into sys_user(id, name, py) 265 | values ('128', '王美东', 'WMD'); 266 | insert into sys_user(id, name, py) 267 | values ('129', '王美媛', 'WMZ'); 268 | insert into sys_user(id, name, py) 269 | values ('130', '王蕊颖', 'WRY'); 270 | insert into sys_user(id, name, py) 271 | values ('131', '王士成', 'WSC'); 272 | insert into sys_user(id, name, py) 273 | values ('132', '王熙斌', 'WXB'); 274 | insert into sys_user(id, name, py) 275 | values ('133', '王香军', 'WXJ'); 276 | insert into sys_user(id, name, py) 277 | values ('134', '王休娜', 'WXN'); 278 | insert into sys_user(id, name, py) 279 | values ('135', '王仪行', 'WYX'); 280 | insert into sys_user(id, name, py) 281 | values ('136', '王赢基', 'WYJ'); 282 | insert into sys_user(id, name, py) 283 | values ('137', '王云芯', 'WYX'); 284 | insert into sys_user(id, name, py) 285 | values ('138', '王郑林', 'WZL'); 286 | insert into sys_user(id, name, py) 287 | values ('139', '王治良', 'WZL'); 288 | insert into sys_user(id, name, py) 289 | values ('140', '王忠宇', 'WZY'); 290 | insert into sys_user(id, name, py) 291 | values ('141', '王子冰', 'WZB'); 292 | insert into sys_user(id, name, py) 293 | values ('142', '韦新裕', 'WXY'); 294 | insert into sys_user(id, name, py) 295 | values ('143', '魏复冉', 'WFR'); 296 | insert into sys_user(id, name, py) 297 | values ('144', '吴翰志', 'WHZ'); 298 | insert into sys_user(id, name, py) 299 | values ('145', '吴美森', 'WMS'); 300 | insert into sys_user(id, name, py) 301 | values ('146', '吴翔良', 'WXL'); 302 | insert into sys_user(id, name, py) 303 | values ('147', '吴艳伟', 'WYW'); 304 | insert into sys_user(id, name, py) 305 | values ('148', '吴钲辉', 'WZH'); 306 | insert into sys_user(id, name, py) 307 | values ('149', '向盼洛', 'XPL'); 308 | insert into sys_user(id, name, py) 309 | values ('150', '萧恩', 'XE'); 310 | insert into sys_user(id, name, py) 311 | values ('151', '萧军杰', 'XJJ'); 312 | insert into sys_user(id, name, py) 313 | values ('152', '萧圣梅', 'XSM'); 314 | insert into sys_user(id, name, py) 315 | values ('153', '谢辰吉', 'XCJ'); 316 | insert into sys_user(id, name, py) 317 | values ('154', '徐郎求', 'XLQ'); 318 | insert into sys_user(id, name, py) 319 | values ('155', '徐铭森', 'XMS'); 320 | insert into sys_user(id, name, py) 321 | values ('156', '徐蓉伟', 'XRW'); 322 | insert into sys_user(id, name, py) 323 | values ('157', '许为梧', 'XWW'); 324 | insert into sys_user(id, name, py) 325 | values ('158', '阎皓河', 'YZH'); 326 | insert into sys_user(id, name, py) 327 | values ('159', '阎思华', 'YSH'); 328 | insert into sys_user(id, name, py) 329 | values ('160', '杨爱秀', 'YAX'); 330 | insert into sys_user(id, name, py) 331 | values ('161', '杨昆飞', 'YKF'); 332 | insert into sys_user(id, name, py) 333 | values ('162', '杨良林', 'YLL'); 334 | insert into sys_user(id, name, py) 335 | values ('163', '杨少君', 'YSJ'); 336 | insert into sys_user(id, name, py) 337 | values ('164', '杨玉丽', 'YYL'); 338 | insert into sys_user(id, name, py) 339 | values ('165', '杨之安', 'YZA'); 340 | insert into sys_user(id, name, py) 341 | values ('166', '尤榕锋', 'YZF'); 342 | insert into sys_user(id, name, py) 343 | values ('167', '余俊珠', 'YJZ'); 344 | insert into sys_user(id, name, py) 345 | values ('168', '袁江蔓', 'YJM'); 346 | insert into sys_user(id, name, py) 347 | values ('169', '张必翰', 'ZBH'); 348 | insert into sys_user(id, name, py) 349 | values ('170', '张昌颜', 'ZCY'); 350 | insert into sys_user(id, name, py) 351 | values ('171', '张恩星', 'ZEX'); 352 | insert into sys_user(id, name, py) 353 | values ('172', '张飞强', 'ZFQ'); 354 | insert into sys_user(id, name, py) 355 | values ('173', '张凤焯', 'ZFZ'); 356 | insert into sys_user(id, name, py) 357 | values ('174', '张国强', 'ZGQ'); 358 | insert into sys_user(id, name, py) 359 | values ('175', '张计欣', 'ZJX'); 360 | insert into sys_user(id, name, py) 361 | values ('176', '张家颖', 'ZJY'); 362 | insert into sys_user(id, name, py) 363 | values ('177', '张金安', 'ZJA'); 364 | insert into sys_user(id, name, py) 365 | values ('178', '张莉', 'ZL'); 366 | insert into sys_user(id, name, py) 367 | values ('179', '张米龙', 'ZML'); 368 | insert into sys_user(id, name, py) 369 | values ('180', '张善渊', 'ZSY'); 370 | insert into sys_user(id, name, py) 371 | values ('181', '张万敏', 'ZWM'); 372 | insert into sys_user(id, name, py) 373 | values ('182', '张晓林', 'ZXL'); 374 | insert into sys_user(id, name, py) 375 | values ('183', '张秀高', 'ZXG'); 376 | -------------------------------------------------------------------------------- /pagehelper-spring-boot-samples/pagehelper-spring-boot-sample-annotation/src/main/resources/import.sql: -------------------------------------------------------------------------------- 1 | drop table sys_user if exists; 2 | 3 | create table sys_user 4 | ( 5 | id integer, 6 | name varchar(32), 7 | py varchar(5) 8 | ); 9 | 10 | insert into sys_user(id, name, py) 11 | values ('1', '毕淑儒', 'BSR'); 12 | insert into sys_user(id, name, py) 13 | values ('2', '蔡兴熙', 'CXX'); 14 | insert into sys_user(id, name, py) 15 | values ('3', '曾三杰', 'ZSJ'); 16 | insert into sys_user(id, name, py) 17 | values ('4', '常元琴', 'CYQ'); 18 | insert into sys_user(id, name, py) 19 | values ('5', '陈栋芬', 'CDF'); 20 | insert into sys_user(id, name, py) 21 | values ('6', '陈宁婷', 'CNZ'); 22 | insert into sys_user(id, name, py) 23 | values ('7', '陈瑞', 'CR'); 24 | insert into sys_user(id, name, py) 25 | values ('8', '陈武宵', 'CWX'); 26 | insert into sys_user(id, name, py) 27 | values ('9', '陈晓丽', 'CXL'); 28 | insert into sys_user(id, name, py) 29 | values ('10', '陈翼涛', 'CYT'); 30 | insert into sys_user(id, name, py) 31 | values ('11', '陈宇然', 'CYR'); 32 | insert into sys_user(id, name, py) 33 | values ('12', '陈震', 'CZ'); 34 | insert into sys_user(id, name, py) 35 | values ('13', '程太君', 'CTJ'); 36 | insert into sys_user(id, name, py) 37 | values ('14', '程玉娜', 'CYN'); 38 | insert into sys_user(id, name, py) 39 | values ('15', '丛贺轩', 'CHX'); 40 | insert into sys_user(id, name, py) 41 | values ('16', '戴国宇', 'DGY'); 42 | insert into sys_user(id, name, py) 43 | values ('17', '戴杰亮', 'DJL'); 44 | insert into sys_user(id, name, py) 45 | values ('18', '丁玉华', 'DYH'); 46 | insert into sys_user(id, name, py) 47 | values ('19', '董秋明', 'DQM'); 48 | insert into sys_user(id, name, py) 49 | values ('20', '董政厚', 'DZH'); 50 | insert into sys_user(id, name, py) 51 | values ('21', '杜玉焱', 'DYZ'); 52 | insert into sys_user(id, name, py) 53 | values ('22', '段瑜芝', 'DZZ'); 54 | insert into sys_user(id, name, py) 55 | values ('23', '傅广友', 'FGY'); 56 | insert into sys_user(id, name, py) 57 | values ('24', '傅井飞', 'FJF'); 58 | insert into sys_user(id, name, py) 59 | values ('25', '高辉涛', 'GHT'); 60 | insert into sys_user(id, name, py) 61 | values ('26', '高龙飞', 'GLF'); 62 | insert into sys_user(id, name, py) 63 | values ('27', '高汝英', 'GRY'); 64 | insert into sys_user(id, name, py) 65 | values ('28', '高云天', 'GYT'); 66 | insert into sys_user(id, name, py) 67 | values ('29', '郭义民', 'GYM'); 68 | insert into sys_user(id, name, py) 69 | values ('30', '郭永洪', 'GYH'); 70 | insert into sys_user(id, name, py) 71 | values ('31', '韩国茜', 'HGZ'); 72 | insert into sys_user(id, name, py) 73 | values ('32', '韩龙康', 'HLK'); 74 | insert into sys_user(id, name, py) 75 | values ('33', '韩伟佳', 'HWJ'); 76 | insert into sys_user(id, name, py) 77 | values ('34', '韩扬谦', 'HYQ'); 78 | insert into sys_user(id, name, py) 79 | values ('35', '郝静生', 'HJS'); 80 | insert into sys_user(id, name, py) 81 | values ('36', '何柏红', 'HBH'); 82 | insert into sys_user(id, name, py) 83 | values ('37', '何彩智', 'HCZ'); 84 | insert into sys_user(id, name, py) 85 | values ('38', '何陶增', 'HTZ'); 86 | insert into sys_user(id, name, py) 87 | values ('39', '何薇', 'HZ'); 88 | insert into sys_user(id, name, py) 89 | values ('40', '何小凡', 'HXF'); 90 | insert into sys_user(id, name, py) 91 | values ('41', '何振平', 'HZP'); 92 | insert into sys_user(id, name, py) 93 | values ('42', '洪彩辉', 'HCH'); 94 | insert into sys_user(id, name, py) 95 | values ('43', '胡仕明', 'HSM'); 96 | insert into sys_user(id, name, py) 97 | values ('44', '黄建朋', 'HJP'); 98 | insert into sys_user(id, name, py) 99 | values ('45', '黄祥荣', 'HXR'); 100 | insert into sys_user(id, name, py) 101 | values ('46', '黄璇平', 'HZP'); 102 | insert into sys_user(id, name, py) 103 | values ('47', '贾茂飞', 'JMF'); 104 | insert into sys_user(id, name, py) 105 | values ('48', '李迪茹', 'LDR'); 106 | insert into sys_user(id, name, py) 107 | values ('49', '李桂博', 'LGB'); 108 | insert into sys_user(id, name, py) 109 | values ('50', '李国祯', 'LGZ'); 110 | insert into sys_user(id, name, py) 111 | values ('51', '李宏川', 'LHC'); 112 | insert into sys_user(id, name, py) 113 | values ('52', '李梅', 'LM'); 114 | insert into sys_user(id, name, py) 115 | values ('53', '李媚文', 'LMW'); 116 | insert into sys_user(id, name, py) 117 | values ('54', '李孟惠', 'LMH'); 118 | insert into sys_user(id, name, py) 119 | values ('55', '李南懋', 'LNZ'); 120 | insert into sys_user(id, name, py) 121 | values ('56', '李鹏龙', 'LPL'); 122 | insert into sys_user(id, name, py) 123 | values ('57', '李诗庸', 'LSY'); 124 | insert into sys_user(id, name, py) 125 | values ('58', '李姝勇', 'LZY'); 126 | insert into sys_user(id, name, py) 127 | values ('59', '李树鹏', 'LSP'); 128 | insert into sys_user(id, name, py) 129 | values ('60', '李薇红', 'LZH'); 130 | insert into sys_user(id, name, py) 131 | values ('61', '李文章', 'LWZ'); 132 | insert into sys_user(id, name, py) 133 | values ('62', '李星佳', 'LXJ'); 134 | insert into sys_user(id, name, py) 135 | values ('63', '李兴', 'LX'); 136 | insert into sys_user(id, name, py) 137 | values ('64', '李秀倩', 'LXZ'); 138 | insert into sys_user(id, name, py) 139 | values ('65', '李艳生', 'LYS'); 140 | insert into sys_user(id, name, py) 141 | values ('66', '李燕金', 'LYJ'); 142 | insert into sys_user(id, name, py) 143 | values ('67', '李玉彪', 'LYB'); 144 | insert into sys_user(id, name, py) 145 | values ('68', '李振峰', 'LZF'); 146 | insert into sys_user(id, name, py) 147 | values ('69', '梁斌芳', 'LBF'); 148 | insert into sys_user(id, name, py) 149 | values ('70', '梁国云', 'LGY'); 150 | insert into sys_user(id, name, py) 151 | values ('71', '梁巧爱', 'LQA'); 152 | insert into sys_user(id, name, py) 153 | values ('72', '梁照金', 'LZJ'); 154 | insert into sys_user(id, name, py) 155 | values ('73', '林婧美', 'LZM'); 156 | insert into sys_user(id, name, py) 157 | values ('74', '林沛寿', 'LPS'); 158 | insert into sys_user(id, name, py) 159 | values ('75', '林薇程', 'LZC'); 160 | insert into sys_user(id, name, py) 161 | values ('76', '林伟玉', 'LWY'); 162 | insert into sys_user(id, name, py) 163 | values ('77', '林艺玲', 'LYL'); 164 | insert into sys_user(id, name, py) 165 | values ('78', '刘睿', 'LR'); 166 | insert into sys_user(id, name, py) 167 | values ('79', '刘芊芊', 'LQQ'); 168 | insert into sys_user(id, name, py) 169 | values ('80', '刘海波', 'LHB'); 170 | insert into sys_user(id, name, py) 171 | values ('81', '刘斓琴', 'LZQ'); 172 | insert into sys_user(id, name, py) 173 | values ('82', '刘磊东', 'LLD'); 174 | insert into sys_user(id, name, py) 175 | values ('83', '刘明琪', 'LMZ'); 176 | insert into sys_user(id, name, py) 177 | values ('84', '刘铭恩', 'LME'); 178 | insert into sys_user(id, name, py) 179 | values ('85', '刘任恺', 'LRZ'); 180 | insert into sys_user(id, name, py) 181 | values ('86', '刘水秋', 'LSQ'); 182 | insert into sys_user(id, name, py) 183 | values ('87', '刘文萱', 'LWZ'); 184 | insert into sys_user(id, name, py) 185 | values ('88', '刘祥瑶', 'LXY'); 186 | insert into sys_user(id, name, py) 187 | values ('89', '刘薪坪', 'LXP'); 188 | insert into sys_user(id, name, py) 189 | values ('90', '刘秀涛', 'LXT'); 190 | insert into sys_user(id, name, py) 191 | values ('91', '刘彦利', 'LYL'); 192 | insert into sys_user(id, name, py) 193 | values ('92', '刘益存', 'LYC'); 194 | insert into sys_user(id, name, py) 195 | values ('93', '龙子苹', 'LZP'); 196 | insert into sys_user(id, name, py) 197 | values ('94', '卢秀剑', 'LXJ'); 198 | insert into sys_user(id, name, py) 199 | values ('95', '罗乔华', 'LQH'); 200 | insert into sys_user(id, name, py) 201 | values ('96', '罗希清', 'LXQ'); 202 | insert into sys_user(id, name, py) 203 | values ('97', '马家兰', 'MJL'); 204 | insert into sys_user(id, name, py) 205 | values ('98', '马莲莹', 'MLY'); 206 | insert into sys_user(id, name, py) 207 | values ('99', '马宁文', 'MNW'); 208 | insert into sys_user(id, name, py) 209 | values ('100', '马水鹏', 'MSP'); 210 | insert into sys_user(id, name, py) 211 | values ('101', '孟三云', 'MSY'); 212 | insert into sys_user(id, name, py) 213 | values ('102', '孟寿云', 'MSY'); 214 | insert into sys_user(id, name, py) 215 | values ('103', '聂伟元', 'NWY'); 216 | insert into sys_user(id, name, py) 217 | values ('104', '潘永飞', 'PYF'); 218 | insert into sys_user(id, name, py) 219 | values ('105', '彭健颖', 'PJY'); 220 | insert into sys_user(id, name, py) 221 | values ('106', '钱文松', 'QWS'); 222 | insert into sys_user(id, name, py) 223 | values ('107', '屈江珍', 'QJZ'); 224 | insert into sys_user(id, name, py) 225 | values ('108', '邵建林', 'SJL'); 226 | insert into sys_user(id, name, py) 227 | values ('109', '施家晖', 'SJZ'); 228 | insert into sys_user(id, name, py) 229 | values ('110', '施艺英', 'SYY'); 230 | insert into sys_user(id, name, py) 231 | values ('111', '孙常程', 'SCC'); 232 | insert into sys_user(id, name, py) 233 | values ('112', '谭佳盈', 'TJY'); 234 | insert into sys_user(id, name, py) 235 | values ('113', '唐春珊', 'TCS'); 236 | insert into sys_user(id, name, py) 237 | values ('114', '唐军霞', 'TJX'); 238 | insert into sys_user(id, name, py) 239 | values ('115', '唐里丽', 'TLL'); 240 | insert into sys_user(id, name, py) 241 | values ('116', '陶姐华', 'TJH'); 242 | insert into sys_user(id, name, py) 243 | values ('117', '万圻艳', 'WZY'); 244 | insert into sys_user(id, name, py) 245 | values ('118', '王傲凤', 'WAF'); 246 | insert into sys_user(id, name, py) 247 | values ('119', '王德英', 'WDY'); 248 | insert into sys_user(id, name, py) 249 | values ('120', '王鼎华', 'WDH'); 250 | insert into sys_user(id, name, py) 251 | values ('121', '王慧', 'WH'); 252 | insert into sys_user(id, name, py) 253 | values ('122', '王佳光', 'WJG'); 254 | insert into sys_user(id, name, py) 255 | values ('123', '王家胜', 'WJS'); 256 | insert into sys_user(id, name, py) 257 | values ('124', '王竞飞', 'WJF'); 258 | insert into sys_user(id, name, py) 259 | values ('125', '王科磊', 'WKL'); 260 | insert into sys_user(id, name, py) 261 | values ('126', '王丽章', 'WLZ'); 262 | insert into sys_user(id, name, py) 263 | values ('127', '王励苗', 'WLM'); 264 | insert into sys_user(id, name, py) 265 | values ('128', '王美东', 'WMD'); 266 | insert into sys_user(id, name, py) 267 | values ('129', '王美媛', 'WMZ'); 268 | insert into sys_user(id, name, py) 269 | values ('130', '王蕊颖', 'WRY'); 270 | insert into sys_user(id, name, py) 271 | values ('131', '王士成', 'WSC'); 272 | insert into sys_user(id, name, py) 273 | values ('132', '王熙斌', 'WXB'); 274 | insert into sys_user(id, name, py) 275 | values ('133', '王香军', 'WXJ'); 276 | insert into sys_user(id, name, py) 277 | values ('134', '王休娜', 'WXN'); 278 | insert into sys_user(id, name, py) 279 | values ('135', '王仪行', 'WYX'); 280 | insert into sys_user(id, name, py) 281 | values ('136', '王赢基', 'WYJ'); 282 | insert into sys_user(id, name, py) 283 | values ('137', '王云芯', 'WYX'); 284 | insert into sys_user(id, name, py) 285 | values ('138', '王郑林', 'WZL'); 286 | insert into sys_user(id, name, py) 287 | values ('139', '王治良', 'WZL'); 288 | insert into sys_user(id, name, py) 289 | values ('140', '王忠宇', 'WZY'); 290 | insert into sys_user(id, name, py) 291 | values ('141', '王子冰', 'WZB'); 292 | insert into sys_user(id, name, py) 293 | values ('142', '韦新裕', 'WXY'); 294 | insert into sys_user(id, name, py) 295 | values ('143', '魏复冉', 'WFR'); 296 | insert into sys_user(id, name, py) 297 | values ('144', '吴翰志', 'WHZ'); 298 | insert into sys_user(id, name, py) 299 | values ('145', '吴美森', 'WMS'); 300 | insert into sys_user(id, name, py) 301 | values ('146', '吴翔良', 'WXL'); 302 | insert into sys_user(id, name, py) 303 | values ('147', '吴艳伟', 'WYW'); 304 | insert into sys_user(id, name, py) 305 | values ('148', '吴钲辉', 'WZH'); 306 | insert into sys_user(id, name, py) 307 | values ('149', '向盼洛', 'XPL'); 308 | insert into sys_user(id, name, py) 309 | values ('150', '萧恩', 'XE'); 310 | insert into sys_user(id, name, py) 311 | values ('151', '萧军杰', 'XJJ'); 312 | insert into sys_user(id, name, py) 313 | values ('152', '萧圣梅', 'XSM'); 314 | insert into sys_user(id, name, py) 315 | values ('153', '谢辰吉', 'XCJ'); 316 | insert into sys_user(id, name, py) 317 | values ('154', '徐郎求', 'XLQ'); 318 | insert into sys_user(id, name, py) 319 | values ('155', '徐铭森', 'XMS'); 320 | insert into sys_user(id, name, py) 321 | values ('156', '徐蓉伟', 'XRW'); 322 | insert into sys_user(id, name, py) 323 | values ('157', '许为梧', 'XWW'); 324 | insert into sys_user(id, name, py) 325 | values ('158', '阎皓河', 'YZH'); 326 | insert into sys_user(id, name, py) 327 | values ('159', '阎思华', 'YSH'); 328 | insert into sys_user(id, name, py) 329 | values ('160', '杨爱秀', 'YAX'); 330 | insert into sys_user(id, name, py) 331 | values ('161', '杨昆飞', 'YKF'); 332 | insert into sys_user(id, name, py) 333 | values ('162', '杨良林', 'YLL'); 334 | insert into sys_user(id, name, py) 335 | values ('163', '杨少君', 'YSJ'); 336 | insert into sys_user(id, name, py) 337 | values ('164', '杨玉丽', 'YYL'); 338 | insert into sys_user(id, name, py) 339 | values ('165', '杨之安', 'YZA'); 340 | insert into sys_user(id, name, py) 341 | values ('166', '尤榕锋', 'YZF'); 342 | insert into sys_user(id, name, py) 343 | values ('167', '余俊珠', 'YJZ'); 344 | insert into sys_user(id, name, py) 345 | values ('168', '袁江蔓', 'YJM'); 346 | insert into sys_user(id, name, py) 347 | values ('169', '张必翰', 'ZBH'); 348 | insert into sys_user(id, name, py) 349 | values ('170', '张昌颜', 'ZCY'); 350 | insert into sys_user(id, name, py) 351 | values ('171', '张恩星', 'ZEX'); 352 | insert into sys_user(id, name, py) 353 | values ('172', '张飞强', 'ZFQ'); 354 | insert into sys_user(id, name, py) 355 | values ('173', '张凤焯', 'ZFZ'); 356 | insert into sys_user(id, name, py) 357 | values ('174', '张国强', 'ZGQ'); 358 | insert into sys_user(id, name, py) 359 | values ('175', '张计欣', 'ZJX'); 360 | insert into sys_user(id, name, py) 361 | values ('176', '张家颖', 'ZJY'); 362 | insert into sys_user(id, name, py) 363 | values ('177', '张金安', 'ZJA'); 364 | insert into sys_user(id, name, py) 365 | values ('178', '张莉', 'ZL'); 366 | insert into sys_user(id, name, py) 367 | values ('179', '张米龙', 'ZML'); 368 | insert into sys_user(id, name, py) 369 | values ('180', '张善渊', 'ZSY'); 370 | insert into sys_user(id, name, py) 371 | values ('181', '张万敏', 'ZWM'); 372 | insert into sys_user(id, name, py) 373 | values ('182', '张晓林', 'ZXL'); 374 | insert into sys_user(id, name, py) 375 | values ('183', '张秀高', 'ZXG'); 376 | --------------------------------------------------------------------------------