Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ public class BusinessKnowledge {
@TableField("synonyms")
private String synonyms; // Synonyms, comma-separated

@TableField("default_recall")
@TableField("is_recall")
private Boolean defaultRecall; // Default recall

@TableField("dataset_id")
@TableField("data_set_id")
private String datasetId; // Associated dataset ID

@TableField("agent_id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,28 @@ public class SemanticModel {
@TableField("agent_id")
private Long agentId; // Agent ID

@TableField("original_field_name")
@TableField("origin_name")
private String originalFieldName; // Original field name

@TableField("agent_field_name")
@TableField("field_name")
private String agentFieldName; // Agent field name

@TableField("field_synonyms")
@TableField("synonyms")
private String fieldSynonyms; // Field name synonyms, comma-separated

@TableField("field_description")
@TableField("description")
private String fieldDescription; // Field description

@TableField("field_type")
@TableField("type")
private String fieldType; // Field type

@TableField("original_description")
@TableField("origin_description")
private String originalDescription; // Original field description

@TableField("default_recall")
@TableField("is_recall")
private Boolean defaultRecall; // Default recall

@TableField("enabled")
@TableField("status")
private Boolean enabled; // Whether enabled

@TableField(value = "created_time", fill = FieldFill.INSERT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ public interface BusinessKnowledgeMapper extends BaseMapper<BusinessKnowledge> {
/**
* Query business knowledge list by dataset ID
*/
@Select("SELECT * FROM business_knowledge WHERE dataset_id = #{datasetId} ORDER BY created_time DESC")
@Select("SELECT * FROM business_knowledge WHERE data_set_id = #{datasetId} ORDER BY created_time DESC")
List<BusinessKnowledge> selectByDatasetId(@Param("datasetId") String datasetId);

/**
* Get all dataset ID list
*/
@Select("SELECT DISTINCT dataset_id FROM business_knowledge WHERE dataset_id IS NOT NULL ORDER BY dataset_id")
@Select("SELECT DISTINCT data_set_id FROM business_knowledge WHERE data_set_id IS NOT NULL ORDER BY data_set_id")
List<String> selectDistinctDatasetIds();

/**
Expand All @@ -61,7 +61,7 @@ public interface BusinessKnowledgeMapper extends BaseMapper<BusinessKnowledge> {
/**
* Query business knowledge by dataset ID and default recall status
*/
@Select("SELECT * FROM business_knowledge WHERE dataset_id = #{datasetId} AND default_recall = #{defaultRecall} ORDER BY created_time DESC")
@Select("SELECT * FROM business_knowledge WHERE data_set_id = #{datasetId} AND is_recall = #{defaultRecall} ORDER BY created_time DESC")
List<BusinessKnowledge> selectByDatasetIdAndDefaultRecall(@Param("datasetId") String datasetId,
@Param("defaultRecall") Boolean defaultRecall);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,27 @@ public interface SemanticModelMapper extends BaseMapper<SemanticModel> {
/**
* Search semantic models by keyword
*/
@Select("SELECT * FROM semantic_model WHERE " + "agent_field_name LIKE CONCAT('%', #{keyword}, '%') OR "
+ "field_description LIKE CONCAT('%', #{keyword}, '%') OR "
+ "field_synonyms LIKE CONCAT('%', #{keyword}, '%') " + "ORDER BY created_time DESC")
@Select("SELECT * FROM semantic_model WHERE " + "field_name LIKE CONCAT('%', #{keyword}, '%') OR "
+ "description LIKE CONCAT('%', #{keyword}, '%') OR " + "synonyms LIKE CONCAT('%', #{keyword}, '%') "
+ "ORDER BY created_time DESC")
List<SemanticModel> searchByKeyword(@Param("keyword") String keyword);

/**
* Batch enable fields
*/
@Update("UPDATE semantic_model SET enabled = 1 WHERE id = #{id}")
@Update("UPDATE semantic_model SET status = 1 WHERE id = #{id}")
int enableById(@Param("id") Long id);

/**
* Batch disable fields
*/
@Update("UPDATE semantic_model SET enabled = 0 WHERE id = #{id}")
@Update("UPDATE semantic_model SET status = 0 WHERE id = #{id}")
int disableById(@Param("id") Long id);

/**
* Query semantic models by agent ID and enabled status
*/
@Select("SELECT * FROM semantic_model WHERE agent_id = #{agentId} AND enabled = #{enabled} ORDER BY created_time DESC")
@Select("SELECT * FROM semantic_model WHERE agent_id = #{agentId} AND status = #{enabled} ORDER BY created_time DESC")
List<SemanticModel> selectByAgentIdAndEnabled(@Param("agentId") Long agentId, @Param("enabled") Boolean enabled);

}
Loading