diff --git a/src/main/java/com/mini/capi/sys/pageController/dataPageController.java b/src/main/java/com/mini/capi/sys/pageController/dataPageController.java index 86688e6..16d41d0 100644 --- a/src/main/java/com/mini/capi/sys/pageController/dataPageController.java +++ b/src/main/java/com/mini/capi/sys/pageController/dataPageController.java @@ -6,6 +6,7 @@ import com.mini.capi.biz.domain.SyncTablesView; import com.mini.capi.biz.service.DbConfigService; import com.mini.capi.biz.service.SyncTablesViewService; import jakarta.annotation.Resource; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -32,11 +33,14 @@ public class dataPageController { @GetMapping("/getTableList") public List getTableList(String dbId, String targetTable) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq(dbId != null && !dbId.isBlank(), "db_id", dbId) - .like(targetTable != null && !targetTable.isBlank(), "target_table", targetTable) - .orderByDesc("create_time") - ; - return tablesViewService.list(queryWrapper); + return tablesViewService.list( + new QueryWrapper() + .eq(StringUtils.hasText(dbId), "db_id", dbId) + .and(StringUtils.hasText(targetTable), + w -> w.like("target_table", targetTable) + .or() + .like("task_name", targetTable)) + .orderByDesc("create_time") + ); } }