feat: mybatisplus分页失效修复
This commit is contained in:
parent
496df13b1e
commit
0756092e4d
4
pom.xml
4
pom.xml
|
|
@ -215,10 +215,6 @@
|
||||||
<groupId>org.mybatis</groupId>
|
<groupId>org.mybatis</groupId>
|
||||||
<artifactId>mybatis-spring</artifactId>
|
<artifactId>mybatis-spring</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
<exclusion>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.chaozhanggui.system.cashierservice.config;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class MyBatisPlusConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public PaginationInterceptor paginationInterceptor() {
|
||||||
|
return new PaginationInterceptor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -122,7 +122,7 @@ public class TbShopPermission extends Model<TbShopPermission> {
|
||||||
* @return 主键值
|
* @return 主键值
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected Serializable pkVal() {
|
public Serializable pkVal() {
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ public class TbShopStaffPermission extends Model<TbShopStaffPermission> {
|
||||||
* @return 主键值
|
* @return 主键值
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected Serializable pkVal() {
|
public Serializable pkVal() {
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -494,7 +494,8 @@ public class TbCallServiceImpl implements TbCallService {
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
LambdaQueryChainWrapper<TbCallQueue> query = callQueueService.lambdaQuery()
|
|
||||||
|
LambdaQueryWrapper<TbCallQueue> query = new LambdaQueryWrapper<TbCallQueue>()
|
||||||
.eq(TbCallQueue::getShopId, shopId)
|
.eq(TbCallQueue::getShopId, shopId)
|
||||||
.eq(TbCallQueue::getCreateDay, DateUtil.today())
|
.eq(TbCallQueue::getCreateDay, DateUtil.today())
|
||||||
.in(TbCallQueue::getCallTableId, tableIds);
|
.in(TbCallQueue::getCallTableId, tableIds);
|
||||||
|
|
@ -504,10 +505,10 @@ public class TbCallServiceImpl implements TbCallService {
|
||||||
}else {
|
}else {
|
||||||
query.in(TbCallQueue::getState, 0, 1);
|
query.in(TbCallQueue::getState, 0, 1);
|
||||||
}
|
}
|
||||||
Page<TbCallQueue> pageInfo = query
|
|
||||||
.orderByAsc(TbCallQueue::getCreateTime)
|
Page<TbCallQueue> pageInfo = callQueueService.page(new Page<>(page, size),
|
||||||
.orderByDesc(TbCallQueue::getState)
|
query.orderByAsc(TbCallQueue::getCreateTime)
|
||||||
.page(new Page<>(page, size));
|
.orderByDesc(TbCallQueue::getState));
|
||||||
|
|
||||||
List<TbCallQueue> list1 = pageInfo.getRecords();
|
List<TbCallQueue> list1 = pageInfo.getRecords();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue