From 1cad302db491481627436705c7ce315dd4be29c7 Mon Sep 17 00:00:00 2001 From: shiyang Date: Tue, 28 Sep 2021 11:36:47 +0800 Subject: [PATCH] update --- .../talkonlineweb/controller/DoctorController.java | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DoctorController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DoctorController.java index 8f79057..231f9cb 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DoctorController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DoctorController.java @@ -59,8 +59,16 @@ public class DoctorController { @GetMapping("sltDoctorLst") public BaseResponse sltDoctorLst(LymsDoctor doctor, int current, int size){ BaseResponse baseResponse=new BaseResponse(); + LambdaQueryWrapper queryWrapper = new QueryWrapper().lambda(); + if(StringUtil.isNotEmpty(doctor.getDname())){ + String dname=doctor.getDname();//解决多条件查询时需要某一个值做非等值查询。需要制空,然后在特殊处理 + doctor.setDname(null); + queryWrapper.setEntity(doctor).like(LymsDoctor::getDname, dname); + }else { + queryWrapper.setEntity(doctor); + } Page page=new Page<>(current,size); - Page doctorPagePage=lymsDoctorService.page(page, Wrappers.query(doctor).orderByDesc("updated_time","createdtime")); + Page doctorPagePage=lymsDoctorService.page(page, queryWrapper.orderByDesc(LymsDoctor::getCreatedtime,LymsDoctor::getUpdatedTime)); conDocCode(doctorPagePage); baseResponse.setObject(doctorPagePage); @@ -252,11 +260,14 @@ public class DoctorController { public BaseResponse appGetDoctorList(AppgetdoctorlistInfo appgetdoctorlistInfo, int current, int size){ BaseResponse baseResponse=new BaseResponse(); LambdaQueryWrapper queryWrapper = new QueryWrapper().lambda(); - queryWrapper.setEntity(appgetdoctorlistInfo); if(StringUtil.isNotEmpty(appgetdoctorlistInfo.getSearchinfo())){ - queryWrapper.like(AppgetdoctorlistInfo::getDname, appgetdoctorlistInfo.getSearchinfo()) - .or().like(AppgetdoctorlistInfo::getDpname,appgetdoctorlistInfo.getSearchinfo()) - .or().like(AppgetdoctorlistInfo::getLvlname, appgetdoctorlistInfo.getSearchinfo()); + String searchinfo=appgetdoctorlistInfo.getSearchinfo();//解决多条件查询时需要某一个值做非等值查询。需要制空,然后在特殊处理 + appgetdoctorlistInfo.setSearchinfo(null); + queryWrapper.setEntity(appgetdoctorlistInfo).like(AppgetdoctorlistInfo::getDname, searchinfo) + .or().like(AppgetdoctorlistInfo::getDpname, searchinfo) + .or().like(AppgetdoctorlistInfo::getLvlname, searchinfo); + }else { + queryWrapper.setEntity(appgetdoctorlistInfo); } Page page=new Page<>(current,size); Page appgetdoctorlistInfoPage=appgetdoctorlistInfoService.page(page,queryWrapper); -- 1.8.3.1