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.DbConfigService;
|
||||||
import com.mini.capi.biz.service.SyncTablesViewService;
|
import com.mini.capi.biz.service.SyncTablesViewService;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@@ -32,11 +33,14 @@ public class dataPageController {
|
|||||||
|
|
||||||
@GetMapping("/getTableList")
|
@GetMapping("/getTableList")
|
||||||
public List<SyncTablesView> getTableList(String dbId, String targetTable) {
|
public List<SyncTablesView> getTableList(String dbId, String targetTable) {
|
||||||
QueryWrapper<SyncTablesView> queryWrapper = new QueryWrapper<>();
|
return tablesViewService.list(
|
||||||
queryWrapper.eq(dbId != null && !dbId.isBlank(), "db_id", dbId)
|
new QueryWrapper<SyncTablesView>()
|
||||||
.like(targetTable != null && !targetTable.isBlank(), "target_table", targetTable)
|
.eq(StringUtils.hasText(dbId), "db_id", dbId)
|
||||||
.orderByDesc("create_time")
|
.and(StringUtils.hasText(targetTable),
|
||||||
;
|
w -> w.like("target_table", targetTable)
|
||||||
return tablesViewService.list(queryWrapper);
|
.or()
|
||||||
|
.like("task_name", targetTable))
|
||||||
|
.orderByDesc("create_time")
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user