npe
This commit is contained in:
parent
a64b56dd14
commit
604ddc049e
|
@ -58,11 +58,26 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
@Override
|
||||
public QueryWrapper<ResourceEntity> getWrapper(Map<String, Object> params) {
|
||||
QueryWrapper<ResourceEntity> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("type", params.get("type").toString())
|
||||
.like(StringUtils.isNotBlank(params.get("name").toString()),"name", params.get("name").toString())
|
||||
.orderByDesc("create_date")
|
||||
.eq(StringUtils.isNotBlank(params.get("creator").toString()),"creator", params.get("creator").toString())
|
||||
.eq("del_flag", 0);
|
||||
params.keySet().stream().filter(index -> null != params.get(index)).forEach(index -> {
|
||||
switch (index) {
|
||||
case "type":
|
||||
wrapper.eq("type", params.get("type").toString());
|
||||
break;
|
||||
case "name":
|
||||
wrapper.like(StringUtils.isNotBlank(params.get("name").toString()),"name", params.get("name").toString());
|
||||
break;
|
||||
case "creator":
|
||||
wrapper.eq(StringUtils.isNotBlank(params.get("creator").toString()),"creator", params.get("creator").toString());
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
// wrapper.eq("type", params.get("type").toString())
|
||||
// .like(StringUtils.isNotBlank(params.get("name").toString()),"name", params.get("name").toString())
|
||||
// .orderByDesc("create_date")
|
||||
// .eq(StringUtils.isNotBlank(params.get("creator").toString()),"creator", params.get("creator").toString())
|
||||
// .eq("del_flag", 0);
|
||||
wrapper.orderByDesc("create_date").eq("del_flag", 0);
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue