in seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/dal/dao/impl/DatasourceDaoImpl.java [98:128]
public IPage<Datasource> selectDatasourceByParam(
Page<Datasource> page,
List<Long> availableDatasourceIds,
String searchVal,
String pluginName) {
QueryWrapper<Datasource> datasourceQueryWrapper = new QueryWrapper<>();
if (availableDatasourceIds != null) {
datasourceQueryWrapper.in("id", availableDatasourceIds);
}
datasourceQueryWrapper.eq("workspace_id", getCurrentWorkspaceId());
if (searchVal != null
&& !searchVal.isEmpty()
&& pluginName != null
&& !pluginName.isEmpty()) {
return datasourceMapper.selectPage(
page,
datasourceQueryWrapper
.eq("plugin_name", pluginName)
.like("datasource_name", searchVal));
}
if (searchVal != null && !searchVal.isEmpty()) {
return datasourceMapper.selectPage(
page, datasourceQueryWrapper.like("datasource_name", searchVal));
}
if (pluginName != null && !pluginName.isEmpty()) {
return datasourceMapper.selectPage(
page, datasourceQueryWrapper.eq("plugin_name", pluginName));
}
return datasourceMapper.selectPage(page, datasourceQueryWrapper);
}