|
...
|
...
|
@@ -115,9 +115,9 @@ public class QuestionEmbeddingMapper { |
|
|
|
}
|
|
|
|
|
|
|
|
// 查询所有记录
|
|
|
|
public Integer findQuestionCount(QuestionEmbedding questionEmbedding) {
|
|
|
|
|
|
|
|
StringBuilder sql = new StringBuilder("select COUNT(1) AS total_count from question_embedding where 1 = 1");
|
|
|
|
public List<QuestionEmbedding> findQuestion(QuestionEmbedding questionEmbedding) {
|
|
|
|
List<QuestionEmbedding> results = new ArrayList<>();
|
|
|
|
StringBuilder sql = new StringBuilder("select * from question_embedding where 1 = 1");
|
|
|
|
List<Object> params = new ArrayList<>();
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(questionEmbedding.getQuestion())){
|
|
...
|
...
|
@@ -135,15 +135,16 @@ public class QuestionEmbeddingMapper { |
|
|
|
|
|
|
|
try (ResultSet rs = stmt.executeQuery()) {
|
|
|
|
while (rs.next()) {
|
|
|
|
return rs.getInt("total_count");
|
|
|
|
results.add(mapRowToQuestionEmbedding(rs));
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
log.error("查询所有记录失败", e);
|
|
|
|
throw new RuntimeException("查询数据时发生数据库错误", e);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return results;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 根据ID查询单个记录
|
...
|
...
|
|