API数据表更新
This commit is contained in:
@@ -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<SyncTablesView> getTableList(String dbId, String targetTable) {
|
||||
QueryWrapper<SyncTablesView> 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<SyncTablesView>()
|
||||
.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")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user