fix: 变更材料列表查询逻辑

This commit is contained in:
han0
2024-09-09 09:52:02 +08:00
parent a6f795a23d
commit 886a1c0018

View File

@@ -67,14 +67,15 @@ public class MaterialController {
@ApiOperation("获取材料列表")
@GetMapping("/")
public HttpResponse list (
@ApiParam(value = "关键字") @RequestParam(value="key_word", required=false) String keyWord
// @ApiParam(value = "父节点id") @RequestParam("parent_id") String parentId
@ApiParam(value = "关键字") @RequestParam(value="key_word", required=false) String keyWord,
@ApiParam(value = "类型") @RequestParam("type") String type
) {
LambdaQueryWrapper<Material> query = new LambdaQueryWrapper<>();
// query.eq(Material::getIsTree, 0);
// if (parentId != null) {
// query.eq(Material::getParentId, parentId);
// }
query.eq(Material::getType, type);
if (keyWord != null && ObjectUtil.isNotEmpty(keyWord)) {
query.like(Material::getName, keyWord);
}