Commit 1cad302db491481627436705c7ce315dd4be29c7

Authored by shiyang
1 parent a87174b255
Exists in master

update

Showing 1 changed file with 16 additions and 5 deletions

talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DoctorController.java View file @ 1cad302
... ... @@ -59,8 +59,16 @@
59 59 @GetMapping("sltDoctorLst")
60 60 public BaseResponse sltDoctorLst(LymsDoctor doctor, int current, int size){
61 61 BaseResponse baseResponse=new BaseResponse();
  62 + LambdaQueryWrapper<LymsDoctor> queryWrapper = new QueryWrapper().lambda();
  63 + if(StringUtil.isNotEmpty(doctor.getDname())){
  64 + String dname=doctor.getDname();//解决多条件查询时需要某一个值做非等值查询。需要制空,然后在特殊处理
  65 + doctor.setDname(null);
  66 + queryWrapper.setEntity(doctor).like(LymsDoctor::getDname, dname);
  67 + }else {
  68 + queryWrapper.setEntity(doctor);
  69 + }
62 70 Page<LymsDoctor> page=new Page<>(current,size);
63   - Page<LymsDoctor> doctorPagePage=lymsDoctorService.page(page, Wrappers.query(doctor).orderByDesc("updated_time","createdtime"));
  71 + Page<LymsDoctor> doctorPagePage=lymsDoctorService.page(page, queryWrapper.orderByDesc(LymsDoctor::getCreatedtime,LymsDoctor::getUpdatedTime));
64 72 conDocCode(doctorPagePage);
65 73 baseResponse.setObject(doctorPagePage);
66 74  
67 75  
... ... @@ -252,11 +260,14 @@
252 260 public BaseResponse appGetDoctorList(AppgetdoctorlistInfo appgetdoctorlistInfo, int current, int size){
253 261 BaseResponse baseResponse=new BaseResponse();
254 262 LambdaQueryWrapper<AppgetdoctorlistInfo> queryWrapper = new QueryWrapper().lambda();
255   - queryWrapper.setEntity(appgetdoctorlistInfo);
256 263 if(StringUtil.isNotEmpty(appgetdoctorlistInfo.getSearchinfo())){
257   - queryWrapper.like(AppgetdoctorlistInfo::getDname, appgetdoctorlistInfo.getSearchinfo())
258   - .or().like(AppgetdoctorlistInfo::getDpname,appgetdoctorlistInfo.getSearchinfo())
259   - .or().like(AppgetdoctorlistInfo::getLvlname, appgetdoctorlistInfo.getSearchinfo());
  264 + String searchinfo=appgetdoctorlistInfo.getSearchinfo();//解决多条件查询时需要某一个值做非等值查询。需要制空,然后在特殊处理
  265 + appgetdoctorlistInfo.setSearchinfo(null);
  266 + queryWrapper.setEntity(appgetdoctorlistInfo).like(AppgetdoctorlistInfo::getDname, searchinfo)
  267 + .or().like(AppgetdoctorlistInfo::getDpname, searchinfo)
  268 + .or().like(AppgetdoctorlistInfo::getLvlname, searchinfo);
  269 + }else {
  270 + queryWrapper.setEntity(appgetdoctorlistInfo);
260 271 }
261 272 Page<AppgetdoctorlistInfo> page=new Page<>(current,size);
262 273 Page<AppgetdoctorlistInfo> appgetdoctorlistInfoPage=appgetdoctorlistInfoService.page(page,queryWrapper);