id id,
id chat_id,
history_code,
user_id,
COALESCE(user_nickname, '') user_nickname,
COALESCE(user_avatar, '') user_avatar,
COALESCE(robot_code, '') robot_code,
role,
content,
create_time,
update_time
INSERT INTO ai_chat (history_code, content
, user_id
, user_nickname
, user_avatar
, robot_code
, role
)
VALUES (#{history_code}, #{content}
, #{user_id}
, #{user_nickname}
, #{user_avatar}
, #{robot_code}
, #{role}
)
DELETE FROM ai_chat WHERE history_code = #{history_code}