From 0756092e4dc615a59fd3a0445b372a2dbb28e925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=9D=BE?= <8605635+zhang3064194730@user.noreply.gitee.com> Date: Wed, 11 Dec 2024 11:35:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20mybatisplus=E5=88=86=E9=A1=B5=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 4 ---- .../cashierservice/config/MyBatisPlusConfig.java | 15 +++++++++++++++ .../cashierservice/entity/TbShopPermission.java | 2 +- .../entity/TbShopStaffPermission.java | 2 +- .../service/impl/TbCallServiceImpl.java | 11 ++++++----- 5 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/config/MyBatisPlusConfig.java diff --git a/pom.xml b/pom.xml index 7888a17..da55549 100644 --- a/pom.xml +++ b/pom.xml @@ -215,10 +215,6 @@ org.mybatis mybatis-spring - - org.springframework.boot - spring-boot-starter-jdbc - diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/config/MyBatisPlusConfig.java b/src/main/java/com/chaozhanggui/system/cashierservice/config/MyBatisPlusConfig.java new file mode 100644 index 0000000..a8c8b60 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/config/MyBatisPlusConfig.java @@ -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(); + } +} + diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopPermission.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopPermission.java index 380a643..4268934 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopPermission.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopPermission.java @@ -122,7 +122,7 @@ public class TbShopPermission extends Model { * @return 主键值 */ @Override - protected Serializable pkVal() { + public Serializable pkVal() { return this.id; } } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopStaffPermission.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopStaffPermission.java index 46c4a31..42e87df 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopStaffPermission.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopStaffPermission.java @@ -70,7 +70,7 @@ public class TbShopStaffPermission extends Model { * @return 主键值 */ @Override - protected Serializable pkVal() { + public Serializable pkVal() { return this.id; } } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/impl/TbCallServiceImpl.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/impl/TbCallServiceImpl.java index 9b3286f..32583b7 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/impl/TbCallServiceImpl.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/impl/TbCallServiceImpl.java @@ -494,7 +494,8 @@ public class TbCallServiceImpl implements TbCallService { .collect(Collectors.toList()); } - LambdaQueryChainWrapper query = callQueueService.lambdaQuery() + + LambdaQueryWrapper query = new LambdaQueryWrapper() .eq(TbCallQueue::getShopId, shopId) .eq(TbCallQueue::getCreateDay, DateUtil.today()) .in(TbCallQueue::getCallTableId, tableIds); @@ -504,10 +505,10 @@ public class TbCallServiceImpl implements TbCallService { }else { query.in(TbCallQueue::getState, 0, 1); } - Page pageInfo = query - .orderByAsc(TbCallQueue::getCreateTime) - .orderByDesc(TbCallQueue::getState) - .page(new Page<>(page, size)); + + Page pageInfo = callQueueService.page(new Page<>(page, size), + query.orderByAsc(TbCallQueue::getCreateTime) + .orderByDesc(TbCallQueue::getState)); List list1 = pageInfo.getRecords();