diff --git a/src/main/java/com/peanut/modules/common/service/impl/ClassEntityServiceImpl.java b/src/main/java/com/peanut/modules/common/service/impl/ClassEntityServiceImpl.java index b233832b..b90f8c02 100644 --- a/src/main/java/com/peanut/modules/common/service/impl/ClassEntityServiceImpl.java +++ b/src/main/java/com/peanut/modules/common/service/impl/ClassEntityServiceImpl.java @@ -350,7 +350,7 @@ public class ClassEntityServiceImpl extends ServiceImpl userCertificateList = userCertificateDao.selectList(new LambdaQueryWrapper() - .orderByDesc(UserCertificate::getId)); + .orderByDesc(UserCertificate::getCreateTime)); String res = ""; if (userCertificateList.size() > 0){ UserCertificate u0 = userCertificateList.get(0); diff --git a/src/main/java/com/peanut/modules/master/controller/UserCertificateController.java b/src/main/java/com/peanut/modules/master/controller/UserCertificateController.java index bd033e2d..6a7179bc 100644 --- a/src/main/java/com/peanut/modules/master/controller/UserCertificateController.java +++ b/src/main/java/com/peanut/modules/master/controller/UserCertificateController.java @@ -2,7 +2,9 @@ package com.peanut.modules.master.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.yulichang.wrapper.MPJLambdaWrapper; import com.peanut.common.utils.R; +import com.peanut.modules.common.entity.MyUserEntity; import com.peanut.modules.common.entity.UserCertificate; import com.peanut.modules.common.entity.UserCertificateLabel; import com.peanut.modules.common.service.MyUserService; @@ -42,10 +44,14 @@ public class UserCertificateController { //标签下证书列表 @RequestMapping("/userCertificateListByLabel") public R userCertificateListByLabel(@RequestBody Map params) { + MPJLambdaWrapper wrapper = new MPJLambdaWrapper(); + wrapper.leftJoin(MyUserEntity.class,MyUserEntity::getId,UserCertificate::getUserId); + wrapper.selectAll(UserCertificate.class); + wrapper.eq(UserCertificate::getLabelId,params.get("labelId")); + wrapper.like(MyUserEntity::getTel,params.get("tel")); + wrapper.like(UserCertificate::getTitle,params.get("title")); Page certificatePage = userCertificateService.page(new Page<>( - Long.parseLong(params.get("current").toString()), - Long.parseLong(params.get("limit").toString())),new LambdaQueryWrapper() - .eq(UserCertificate::getLabelId,params.get("labelId"))); + Long.parseLong(params.get("current").toString()),Long.parseLong(params.get("limit").toString())),wrapper); for (UserCertificate certificate:certificatePage.getRecords()){ certificate.setUser(myUserService.getById(certificate.getUserId())); } @@ -56,7 +62,7 @@ public class UserCertificateController { @RequestMapping("/saveUserCertificateLabel") public R saveUserCertificate(@RequestBody UserCertificateLabel label) { userCertificateLabelService.save(label); - return R.ok(); + return R.ok().put("labelId",label.getId()); } //修改标签 @@ -78,7 +84,7 @@ public class UserCertificateController { } } userCertificateLabelService.updateById(label); - return R.ok(); + return R.ok().put("labelId",label.getId()); } //删除标签