From b9e9f9b9f9da75cfa249b81476112d691cec4609 Mon Sep 17 00:00:00 2001 From: wuchunlei Date: Tue, 5 Aug 2025 09:50:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=91=E5=AE=A4=E5=92=8C=E5=8C=BB=E6=A1=88?= =?UTF-8?q?=E6=94=B6=E9=9B=86=E9=87=8C=E7=9A=84=E7=A7=91=E5=AE=A4=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/common/entity/TaihuTalent.java | 6 +++++- .../controller/TaihuTalentController.java | 14 +++++++++----- .../controller/TaihuTalentController.java | 17 +++++++++-------- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/peanut/modules/common/entity/TaihuTalent.java b/src/main/java/com/peanut/modules/common/entity/TaihuTalent.java index 0073c67e..17985046 100644 --- a/src/main/java/com/peanut/modules/common/entity/TaihuTalent.java +++ b/src/main/java/com/peanut/modules/common/entity/TaihuTalent.java @@ -1,5 +1,6 @@ package com.peanut.modules.common.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; @@ -22,7 +23,7 @@ public class TaihuTalent implements Serializable { private String name; //科室 - private String department; + private Integer deptLabelId; //职称 private String title; @@ -52,4 +53,7 @@ public class TaihuTalent implements Serializable { @TableLogic private Integer delFlag; + + @TableField(exist = false) + private String department; } diff --git a/src/main/java/com/peanut/modules/master/controller/TaihuTalentController.java b/src/main/java/com/peanut/modules/master/controller/TaihuTalentController.java index 888149be..650ebd9b 100644 --- a/src/main/java/com/peanut/modules/master/controller/TaihuTalentController.java +++ b/src/main/java/com/peanut/modules/master/controller/TaihuTalentController.java @@ -4,12 +4,10 @@ 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.CourseEntity; -import com.peanut.modules.common.entity.CourseToTaihumed; -import com.peanut.modules.common.entity.CourseToTalent; -import com.peanut.modules.common.entity.TaihuTalent; +import com.peanut.modules.common.entity.*; import com.peanut.modules.common.service.CourseToTaihumedService; import com.peanut.modules.common.service.CourseToTalentService; +import com.peanut.modules.common.service.MedicalRecordsLabelService; import com.peanut.modules.common.service.TaihuTalentService; import com.peanut.modules.common.to.ParamTo; import com.peanut.modules.master.service.CourseService; @@ -38,6 +36,8 @@ public class TaihuTalentController { private CourseToTalentService courseToTalentService; @Autowired private CourseToTaihumedService courseToTaihumedService; + @Autowired + private MedicalRecordsLabelService medicalRecordsLabelService; //太湖英才课程列表 @@ -108,7 +108,10 @@ public class TaihuTalentController { //太湖英才列表 @RequestMapping("/getTaihuTalents") public R getTaihuTalents(@RequestBody Map params){ - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + MPJLambdaWrapper wrapper = new MPJLambdaWrapper<>(); + wrapper.leftJoin(MedicalRecordsLabel.class,MedicalRecordsLabel::getId,TaihuTalent::getDeptLabelId); + wrapper.selectAll(TaihuTalent.class); + wrapper.selectAs(MedicalRecordsLabel::getTitle,TaihuTalent::getDepartment); wrapper.like(StringUtils.isNotEmpty(params.get("name").toString()),TaihuTalent::getName,params.get("name")); wrapper.like(StringUtils.isNotEmpty(params.get("region").toString()),TaihuTalent::getRegion,params.get("region")); wrapper.orderByDesc(TaihuTalent::getCreateTime); @@ -145,6 +148,7 @@ public class TaihuTalentController { @RequestMapping("/taihuTalentInfo") public R taihuTalentInfo(@RequestBody Map params){ TaihuTalent taihuTalent = taihuTalentService.getById(params.get("id").toString()); + taihuTalent.setDepartment(medicalRecordsLabelService.getById(taihuTalent.getDeptLabelId()).getTitle()); return R.ok().put("taihuTalent",taihuTalent); } diff --git a/src/main/java/com/peanut/modules/taihumed/controller/TaihuTalentController.java b/src/main/java/com/peanut/modules/taihumed/controller/TaihuTalentController.java index 5ec3f80a..e9f9886a 100644 --- a/src/main/java/com/peanut/modules/taihumed/controller/TaihuTalentController.java +++ b/src/main/java/com/peanut/modules/taihumed/controller/TaihuTalentController.java @@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.github.yulichang.wrapper.MPJLambdaWrapper; import com.peanut.common.utils.R; import com.peanut.modules.common.entity.*; -import com.peanut.modules.common.service.MedicalRecordsService; -import com.peanut.modules.common.service.TaihuTalentService; -import com.peanut.modules.common.service.UserCertificateLabelService; -import com.peanut.modules.common.service.UserCertificateService; +import com.peanut.modules.common.service.*; import com.peanut.modules.master.service.CourseService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; @@ -33,15 +30,18 @@ public class TaihuTalentController { private CourseService courseService; @Autowired private MedicalRecordsService medicalRecordsService; + @Autowired + private MedicalRecordsLabelService medicalRecordsLabelService; //太湖英才列表 @RequestMapping("/getTaihuTalents") public R getTaihuTalents(@RequestBody Map params){ - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + MPJLambdaWrapper wrapper = new MPJLambdaWrapper<>(); + wrapper.leftJoin(MedicalRecordsLabel.class,MedicalRecordsLabel::getId,TaihuTalent::getDeptLabelId); + wrapper.selectAll(TaihuTalent.class); + wrapper.selectAs(MedicalRecordsLabel::getTitle,TaihuTalent::getDepartment); wrapper.like(StringUtils.isNotEmpty(params.get("name").toString()),TaihuTalent::getName,params.get("name")); - if (params.containsKey("department")){ - wrapper.like(StringUtils.isNotEmpty(params.get("department").toString()),TaihuTalent::getDepartment,params.get("department")); - } + wrapper.eq(StringUtils.isNotEmpty(params.get("deptLabelId").toString()),TaihuTalent::getDeptLabelId,params.get("deptLabelId")); wrapper.like(StringUtils.isNotEmpty(params.get("region").toString()),TaihuTalent::getRegion,params.get("region")); wrapper.orderByAsc(TaihuTalent::getCreateTime); List list = taihuTalentService.list(wrapper); @@ -68,6 +68,7 @@ public class TaihuTalentController { @RequestMapping("/taihuTalentInfo") public R taihuTalentInfo(@RequestBody Map params){ TaihuTalent taihuTalent = taihuTalentService.getById(params.get("id").toString()); + taihuTalent.setDepartment(medicalRecordsLabelService.getById(taihuTalent.getDeptLabelId()).getTitle()); List labels = userCertificateLabelService.list(new LambdaQueryWrapper() .eq(UserCertificateLabel::getPid,0)); List filterLabels = new ArrayList<>();