mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-14 22:25:19 +00:00
[improvement](chat) support query/search filter by web domainId and mapping add frequency/detectWord in mapping and metric dimensions orders filter duplicates
This commit is contained in:
@@ -93,6 +93,7 @@ public class DatabaseServiceImpl implements DatabaseService {
|
||||
private QueryResultWithSchemaResp queryWithColumns(String sql, DatabaseResp databaseResp) {
|
||||
QueryResultWithSchemaResp queryResultWithColumns = new QueryResultWithSchemaResp();
|
||||
SqlUtils sqlUtils = this.sqlUtils.init(databaseResp);
|
||||
log.info("query SQL: {}" , sql);
|
||||
sqlUtils.queryInternal(sql, queryResultWithColumns);
|
||||
return queryResultWithColumns;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ public interface DatasourceRepository {
|
||||
|
||||
List<DatasourceDO> getDatasourceList();
|
||||
|
||||
List<DatasourceDO> getDatasourceList(Long classId);
|
||||
List<DatasourceDO> getDatasourceList(Long domainId);
|
||||
|
||||
DatasourceDO getDatasourceById(Long id);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public interface MetricRepository {
|
||||
|
||||
void updateMetric(MetricDO metricDO);
|
||||
|
||||
List<MetricDO> getMetricList(Long classId);
|
||||
List<MetricDO> getMetricList(Long domainId);
|
||||
|
||||
List<MetricDO> getMetricListByIds(List<Long> ids);
|
||||
|
||||
|
||||
@@ -43,9 +43,9 @@ public class DatasourceRepositoryImpl implements DatasourceRepository {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DatasourceDO> getDatasourceList(Long classId) {
|
||||
public List<DatasourceDO> getDatasourceList(Long domainId) {
|
||||
DatasourceDOExample datasourceExample = new DatasourceDOExample();
|
||||
datasourceExample.createCriteria().andDomainIdEqualTo(classId);
|
||||
datasourceExample.createCriteria().andDomainIdEqualTo(domainId);
|
||||
return datasourceMapper.selectByExampleWithBLOBs(datasourceExample);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,9 +13,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.annotation.PreDestroy;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@@ -25,29 +23,12 @@ import org.springframework.util.CollectionUtils;
|
||||
@Repository
|
||||
public class DateInfoRepositoryImpl implements DateInfoRepository {
|
||||
|
||||
// @Autowired
|
||||
// private SqlSessionTemplate sqlSessionTemplate;
|
||||
|
||||
private SqlSession sqlSession;
|
||||
|
||||
private ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
@Autowired
|
||||
private DateInfoMapper dateInfoMapper;
|
||||
|
||||
// @PostConstruct
|
||||
// public void init() {
|
||||
// if (Objects.isNull(sqlSession)) {
|
||||
// sqlSession = sqlSessionTemplate.getSqlSessionFactory().openSession(ExecutorType.BATCH, false);
|
||||
// }
|
||||
// }
|
||||
|
||||
@PreDestroy
|
||||
public void preDestroy() {
|
||||
if (Objects.nonNull(sqlSession)) {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer upsertDateInfo(List<DateInfoReq> dateInfoCommends) {
|
||||
@@ -86,12 +67,6 @@ public class DateInfoRepositoryImpl implements DateInfoRepository {
|
||||
for (DateInfoDO dateInfoDO : dateInfoDOList) {
|
||||
dateInfoMapper.upsertDateInfo(dateInfoDO);
|
||||
}
|
||||
try {
|
||||
sqlSession.commit();
|
||||
return dateInfoDOList.size();
|
||||
} catch (Exception e) {
|
||||
log.warn("e:", e);
|
||||
}
|
||||
log.info("before final, elapsed time:{}", stopwatch.elapsed(TimeUnit.MILLISECONDS));
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user