|
|
@@ -18,13 +18,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="userContent" column="user_content" />
|
|
|
<result property="companyUserContent" column="company_user_content" />
|
|
|
<result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
<result property="questionStatisticsId" column="question_statistics_id" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectFastgptChatQuestionVo">
|
|
|
- select id, session_id, msg_id, ext_id, user_id, company_id, company_user_id, role_id, nick_name, user_type, user_content, company_user_content, create_time, question_statistics_id from fastgpt_chat_question
|
|
|
+ select id, session_id, msg_id, ext_id, user_id, company_id, company_user_id, role_id, nick_name, user_type, user_content, company_user_content, create_time, update_time, question_statistics_id from fastgpt_chat_question
|
|
|
</sql>
|
|
|
|
|
|
+ <select id="selectFastgptChatQuestionDetailVOList" parameterType="FastgptChatQuestion" resultType="com.fs.fastGpt.vo.FastgptChatQuestionDetailVO">
|
|
|
+ select
|
|
|
+ q.id,
|
|
|
+ q.session_id,
|
|
|
+ q.msg_id,
|
|
|
+ q.ext_id,
|
|
|
+ q.user_id,
|
|
|
+ q.company_id,
|
|
|
+ q.company_user_id,
|
|
|
+ q.role_id,
|
|
|
+ q.nick_name,
|
|
|
+ q.user_type,
|
|
|
+ q.user_content,
|
|
|
+ q.company_user_content,
|
|
|
+ q.create_time,
|
|
|
+ q.update_time,
|
|
|
+ q.question_statistics_id,
|
|
|
+ c.company_name,
|
|
|
+ cu.nick_name as company_user_nick_name,
|
|
|
+ ec.id as external_contact_id,
|
|
|
+ ec.name as external_contact_name
|
|
|
+ from fastgpt_chat_question q
|
|
|
+ left join company c on c.company_id = q.company_id
|
|
|
+ left join company_user cu on cu.user_id = q.company_user_id
|
|
|
+ left join qw_external_contact ec on ec.id = q.ext_id
|
|
|
+ <where>
|
|
|
+ <if test="questionStatisticsId != null"> and q.question_statistics_id = #{questionStatisticsId}</if>
|
|
|
+ </where>
|
|
|
+ order by q.create_time desc, q.id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="selectFastgptChatQuestionList" parameterType="FastgptChatQuestion" resultMap="FastgptChatQuestionResult">
|
|
|
<include refid="selectFastgptChatQuestionVo"/>
|
|
|
<where>
|
|
|
@@ -63,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="userContent != null">user_content,</if>
|
|
|
<if test="companyUserContent != null">company_user_content,</if>
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
<if test="questionStatisticsId != null">question_statistics_id,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
@@ -78,6 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="userContent != null">#{userContent},</if>
|
|
|
<if test="companyUserContent != null">#{companyUserContent},</if>
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
<if test="questionStatisticsId != null">#{questionStatisticsId},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
@@ -97,6 +131,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="userContent != null">user_content = #{userContent},</if>
|
|
|
<if test="companyUserContent != null">company_user_content = #{companyUserContent},</if>
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
<if test="questionStatisticsId != null">question_statistics_id = #{questionStatisticsId},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|