mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 20:25:12 +00:00
(improvement)(chat) show cases order by feedback score (#273)
Co-authored-by: jolunoluo
This commit is contained in:
@@ -183,7 +183,7 @@ public class ChatServiceImpl implements ChatService {
|
|||||||
.collect(Collectors.groupingBy(ChatParseDO::getQuestionId));
|
.collect(Collectors.groupingBy(ChatParseDO::getQuestionId));
|
||||||
for (QueryResp queryResp : queryResps) {
|
for (QueryResp queryResp : queryResps) {
|
||||||
List<ChatParseDO> chatParseDOList = chatParseMap.get(queryResp.getQuestionId());
|
List<ChatParseDO> chatParseDOList = chatParseMap.get(queryResp.getQuestionId());
|
||||||
if (CollectionUtils.isEmpty(chatParseMap)) {
|
if (CollectionUtils.isEmpty(chatParseDOList)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
List<SemanticParseInfo> parseInfos = chatParseDOList.stream().map(chatParseDO ->
|
List<SemanticParseInfo> parseInfos = chatParseDOList.stream().map(chatParseDO ->
|
||||||
|
|||||||
@@ -58,16 +58,19 @@
|
|||||||
from s2_chat_query q1
|
from s2_chat_query q1
|
||||||
join (
|
join (
|
||||||
select distinct chat_id
|
select distinct chat_id
|
||||||
|
from (
|
||||||
|
select *
|
||||||
from s2_chat_query
|
from s2_chat_query
|
||||||
where query_state = 1 and agent_id = ${agentId} and (score is null or score > 1)
|
where query_state = 1 and agent_id = ${agentId}
|
||||||
<if test="userName != null and userName != ''">
|
<if test="userName != null and userName != ''">
|
||||||
and user_name = #{userName}
|
and user_name = #{userName}
|
||||||
</if>
|
</if>
|
||||||
order by chat_id desc
|
order by score, chat_id desc
|
||||||
|
)
|
||||||
limit #{start}, #{limit}
|
limit #{start}, #{limit}
|
||||||
) q2
|
) q2 on q1.chat_id = q2.chat_id
|
||||||
on q1.chat_id = q2.chat_id
|
where agent_id = ${agentId} and (score is null or score > 1)
|
||||||
where agent_id = ${agentId}
|
order by score desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user