diff --git a/chat/core/src/main/resources/mapper/ChatQueryDOMapper.xml b/chat/core/src/main/resources/mapper/ChatQueryDOMapper.xml index 72cbbc4b4..1cba2a902 100644 --- a/chat/core/src/main/resources/mapper/ChatQueryDOMapper.xml +++ b/chat/core/src/main/resources/mapper/ChatQueryDOMapper.xml @@ -3,6 +3,7 @@ + @@ -44,7 +45,7 @@ - question_id, create_time, user_name, query_state, chat_id, score, feedback + question_id, agent_id, create_time, user_name, query_state, chat_id, score, feedback query_text, query_result @@ -65,142 +66,23 @@ order by ${orderByClause} - - + + delete from s2_chat_query where question_id = #{questionId,jdbcType=BIGINT} - insert into s2_chat_query (question_id, create_time, user_name, + insert into s2_chat_query (question_id, agent_id, create_time, user_name, query_state, chat_id, score, feedback, query_text, query_result ) - values (#{questionId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{userName,jdbcType=VARCHAR}, + values (#{questionId,jdbcType=BIGINT}, #{agentId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{userName,jdbcType=VARCHAR}, #{queryState,jdbcType=INTEGER}, #{chatId,jdbcType=BIGINT}, #{score,jdbcType=INTEGER}, #{feedback,jdbcType=VARCHAR}, #{queryText,jdbcType=LONGVARCHAR}, #{queryResult,jdbcType=LONGVARCHAR} ) - - insert into s2_chat_query - - - question_id, - - - create_time, - - - user_name, - - - query_state, - - - chat_id, - - - score, - - - feedback, - - - query_text, - - - query_result, - - - - - #{questionId,jdbcType=BIGINT}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{userName,jdbcType=VARCHAR}, - - - #{queryState,jdbcType=INTEGER}, - - - #{chatId,jdbcType=BIGINT}, - - - #{score,jdbcType=INTEGER}, - - - #{feedback,jdbcType=VARCHAR}, - - - #{queryText,jdbcType=LONGVARCHAR}, - - - #{queryResult,jdbcType=LONGVARCHAR}, - - - - - - update s2_chat_query - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - user_name = #{userName,jdbcType=VARCHAR}, - - - query_state = #{queryState,jdbcType=INTEGER}, - - - chat_id = #{chatId,jdbcType=BIGINT}, - - - score = #{score,jdbcType=INTEGER}, - - - feedback = #{feedback,jdbcType=VARCHAR}, - - - query_text = #{queryText,jdbcType=LONGVARCHAR}, - - - query_result = #{queryResult,jdbcType=LONGVARCHAR}, - - - where question_id = #{questionId,jdbcType=BIGINT} - + update s2_chat_query @@ -231,14 +113,4 @@ where question_id = #{questionId,jdbcType=BIGINT} - - update s2_chat_query - set create_time = #{createTime,jdbcType=TIMESTAMP}, - user_name = #{userName,jdbcType=VARCHAR}, - query_state = #{queryState,jdbcType=INTEGER}, - chat_id = #{chatId,jdbcType=BIGINT}, - score = #{score,jdbcType=INTEGER}, - feedback = #{feedback,jdbcType=VARCHAR} - where question_id = #{questionId,jdbcType=BIGINT} - diff --git a/chat/core/src/main/resources/mapper/custom/ShowCaseCustomMapper.xml b/chat/core/src/main/resources/mapper/custom/ShowCaseCustomMapper.xml index adaf36822..7dcb1d213 100644 --- a/chat/core/src/main/resources/mapper/custom/ShowCaseCustomMapper.xml +++ b/chat/core/src/main/resources/mapper/custom/ShowCaseCustomMapper.xml @@ -59,7 +59,7 @@ join ( select distinct chat_id from s2_chat_query - where query_state = 0 and agent_id = ${agentId} + where query_state = 1 and agent_id = ${agentId} order by chat_id desc limit #{start}, #{limit} ) q2