fix(material): 修复关键字查询导致无结果的问题
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package mjkf.xinke.main.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jgy.xxs.core.common.util.CommonUtil;
|
||||
import com.jgy.xxs.core.http.exp.NcHttpException;
|
||||
import com.jgy.xxs.core.http.resp.HttpResponse;
|
||||
@@ -70,7 +70,7 @@ public class MaterialController {
|
||||
if (parentId != null) {
|
||||
query.eq(Material::getParentId, parentId);
|
||||
}
|
||||
if (keyWord != null) {
|
||||
if (keyWord != null && ObjectUtil.isNotEmpty(keyWord)) {
|
||||
query.and(q -> q
|
||||
.like(Material::getCategory1, keyWord).or()
|
||||
.like(Material::getCategory2, keyWord).or()
|
||||
|
Reference in New Issue
Block a user