43 lines
1.4 KiB
XML
43 lines
1.4 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<!DOCTYPE mapper
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="cn.unizk.mapper.ConversationMapper">
|
|
|
|
|
|
|
|
<insert id="insertConversation" parameterType="cn.unizk.entity.po.Conversation" useGeneratedKeys="true" keyProperty="id">
|
|
insert into conversation
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
session_id, user_id,qa_json,symptom_summary
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
#{sessionId}, #{userId},#{qaJson},#{symptomSummary}
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateConversation" parameterType="cn.unizk.entity.po.Conversation">
|
|
update conversation
|
|
<set>
|
|
<if test="status != null">
|
|
status = #{status},
|
|
</if>
|
|
<if test="aiDiagnosis != null">
|
|
ai_diagnosis = #{aiDiagnosis},
|
|
</if>
|
|
<if test="aiTreatment != null">
|
|
ai_treatment = #{aiTreatment},
|
|
</if>
|
|
</set>
|
|
where session_id = #{sessionId}
|
|
</update>
|
|
|
|
|
|
<select id="selectBySessionId" resultType="cn.unizk.entity.po.Conversation">
|
|
select * from conversation where session_id = #{sessionId} ORDER BY create_time DESC
|
|
-- ORDER BY create_time DESC LIMIT 1;
|
|
</select>
|
|
|
|
|
|
</mapper>
|