Commit a3b2e42eeaed2308c6cdc9b21f78a7c3c4254080
Exists in
master
Merge remote-tracking branch 'origin/master'
Showing 2 changed files
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DoctorController.java
View file @
a3b2e42
... | ... | @@ -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); |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsDoctorMapper.java
View file @
a3b2e42
... | ... | @@ -16,13 +16,13 @@ |
16 | 16 | "SELECT COUNT(1) dall,SUM(d.`stat`) dsum,(COUNT(1)-SUM(d.`stat`)) rcnt FROM lyms_doctor d", |
17 | 17 | "where 1=1", |
18 | 18 | "<when test='hid!=null' >", |
19 | - "and hid=#{hid}", | |
19 | + "and d.hid=#{hid}", | |
20 | 20 | "</when>", |
21 | 21 | "<when test='dpid!=null' >", |
22 | - "and dpid=#{dpid}", | |
22 | + "and d.dpid=#{dpid}", | |
23 | 23 | "</when>", |
24 | 24 | "<when test='dname!=null' >", |
25 | - "and dname like '%#{dname}%' ", | |
25 | + "and d.dname like CONCAT('%',#{dname},'%') ", | |
26 | 26 | "</when>", |
27 | 27 | "</script>"}) |
28 | 28 | Map<String, Object> statDoctor(@Param("hid") Integer hid,@Param("dpid") Integer dpid,@Param("dname") String dname); |