Mybatisplus integrates the sqlite3 database and uses the selectPage method to perform page wise queries,but can not search the total of data

50 views Asked by At

enter image description here Mybatisplus integrates the sqlite3 database and uses the selectPage method to perform page wise queries,but can not search the total of data

When I used MySQL before, there was no problem writing it this way, so I'm not sure if it's a problem with integrating SQLite

1

There are 1 answers

1
Troye Puth HelloDam On

I'm sorry it was my negligence, not SQLite's reason, it turned out to be just my integration of MybatisPlus, I forgot to configure the paging plugin, the configuration is as follows, but different versions may be different, you can go to see the official website:

  @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        //  如果有多数据源可以不配具体类型 否则都建议配上具体的DbType
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.SQLITE));
        return interceptor;
    }