Commit dbdb31f497419d9c35d7bdb3d2ea05a1ef8f2c39
1 parent
ef8f0d691f
Exists in
master
and in
1 other branch
字典列表展示-改为条件模糊查询
Showing 1 changed file with 10 additions and 1 deletions
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/RegionsController.java
View file @
dbdb31f
| ... | ... | @@ -10,6 +10,7 @@ |
| 10 | 10 | import com.lyms.talkonlineweb.result.BaseResponse; |
| 11 | 11 | import com.lyms.talkonlineweb.service.LymsDictService; |
| 12 | 12 | import com.lyms.talkonlineweb.service.RegionsService; |
| 13 | +import com.lyms.talkonlineweb.util.StringUtil; | |
| 13 | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | 15 | import org.springframework.web.bind.annotation.*; |
| 15 | 16 | |
| ... | ... | @@ -85,7 +86,15 @@ |
| 85 | 86 | public BaseResponse sltDepartLst(LymsDict dict, int current, int size){ |
| 86 | 87 | BaseResponse baseResponse=new BaseResponse(); |
| 87 | 88 | Page<LymsDict> page=new Page<>(current,size); |
| 88 | - Page<LymsDict> departPage=lymsDictService.page(page, Wrappers.query(dict).orderByDesc("sort")); | |
| 89 | + QueryWrapper query=new QueryWrapper(); | |
| 90 | + query.orderByDesc("sort"); | |
| 91 | + if(null!=dict.getVtype()){ | |
| 92 | + query.eq("vtype", dict.getVtype()); | |
| 93 | + } | |
| 94 | + if(StringUtil.isNotEmpty(dict.getValue())){ | |
| 95 | + query.like("value", dict.getValue()); | |
| 96 | + } | |
| 97 | + Page<LymsDict> departPage=lymsDictService.page(page,query); | |
| 89 | 98 | baseResponse.setObject(departPage); |
| 90 | 99 | |
| 91 | 100 | return baseResponse; |