From 53d58c98cda6c84bc4268f658ac92611334e8afe Mon Sep 17 00:00:00 2001 From: wyn <1074145239@qq.com> Date: Tue, 12 May 2026 14:48:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E6=B3=A8=E5=86=8C=E6=97=B6=E9=97=B4=E5=92=8C=E8=BF=81?= =?UTF-8?q?=E7=A7=BB=E6=97=B6=E9=97=B4=20=E5=B9=B6=E5=8F=AF=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/book/controller/MyUserController.java | 15 +++++++++++++++ .../com/peanut/modules/book/to/PageIdDto.java | 4 ++++ .../modules/common/entity/MyUserEntity.java | 2 ++ 3 files changed, 21 insertions(+) diff --git a/src/main/java/com/peanut/modules/book/controller/MyUserController.java b/src/main/java/com/peanut/modules/book/controller/MyUserController.java index bc7e3b0..425f76a 100644 --- a/src/main/java/com/peanut/modules/book/controller/MyUserController.java +++ b/src/main/java/com/peanut/modules/book/controller/MyUserController.java @@ -101,6 +101,21 @@ public class MyUserController { wrapper.eq(UserVip::getState,0); } } + wrapper.leftJoin(UserMigration.class,UserMigration::getUserId,MyUserEntity::getId); + wrapper.selectAll(MyUserEntity.class); + wrapper.selectAs(UserMigration::getCreateTime,"migrationTime"); + + wrapper.leftJoin(UserMigration.class,UserMigration::getUserId,MyUserEntity::getId); + wrapper.selectAll(MyUserEntity.class); + wrapper.selectAs(UserMigration::getCreateTime,"migrationTime"); + boolean isAsc = p.getSortValue().equals("")?false:(p.getSortValue().equals("ascending")?true:true); + String sortKey = p.getSortKey().equals("")?"createTime":p.getSortKey(); + if(sortKey.equals("migrationTime")){ + wrapper.orderBy(true, isAsc, UserMigration::getCreateTime); + }else{ + wrapper.orderBy(true, isAsc, MyUserEntity::getCreateTime); + } + wrapper.orderByDesc(MyUserEntity::getCreateTime); Page myUserEntityPage = userService.getBaseMapper().selectPage(new Page(p.getPage(), p.getLimit()), wrapper); for (MyUserEntity myUserEntity : myUserEntityPage.getRecords()) { diff --git a/src/main/java/com/peanut/modules/book/to/PageIdDto.java b/src/main/java/com/peanut/modules/book/to/PageIdDto.java index bb31be0..fcc829b 100644 --- a/src/main/java/com/peanut/modules/book/to/PageIdDto.java +++ b/src/main/java/com/peanut/modules/book/to/PageIdDto.java @@ -16,4 +16,8 @@ public class PageIdDto implements Serializable { private Integer limit; private Integer page; + + private String sortKey; + + private String sortValue; } diff --git a/src/main/java/com/peanut/modules/common/entity/MyUserEntity.java b/src/main/java/com/peanut/modules/common/entity/MyUserEntity.java index eb62afd..779ae9d 100644 --- a/src/main/java/com/peanut/modules/common/entity/MyUserEntity.java +++ b/src/main/java/com/peanut/modules/common/entity/MyUserEntity.java @@ -165,5 +165,7 @@ public class MyUserEntity implements Serializable { private List userEbookVip; @TableField(exist = false) private String contributionScore; + @TableField(exist = false) + private String migrationTime; }