|
|
@@ -0,0 +1,121 @@
|
|
|
+<?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="com.fs.fastGpt.mapper.FastgptChatQuestionMapper">
|
|
|
+
|
|
|
+ <resultMap type="FastgptChatQuestion" id="FastgptChatQuestionResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="sessionId" column="session_id" />
|
|
|
+ <result property="msgId" column="msg_id" />
|
|
|
+ <result property="extId" column="ext_id" />
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
+ <result property="companyId" column="company_id" />
|
|
|
+ <result property="companyUserId" column="company_user_id" />
|
|
|
+ <result property="roleId" column="role_id" />
|
|
|
+ <result property="nickName" column="nick_name" />
|
|
|
+ <result property="userType" column="user_type" />
|
|
|
+ <result property="userContent" column="user_content" />
|
|
|
+ <result property="companyUserContent" column="company_user_content" />
|
|
|
+ <result property="createTime" column="create_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
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectFastgptChatQuestionList" parameterType="FastgptChatQuestion" resultMap="FastgptChatQuestionResult">
|
|
|
+ <include refid="selectFastgptChatQuestionVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="sessionId != null "> and session_id = #{sessionId}</if>
|
|
|
+ <if test="msgId != null "> and msg_id = #{msgId}</if>
|
|
|
+ <if test="extId != null and extId != ''"> and ext_id = #{extId}</if>
|
|
|
+ <if test="userId != null and userId != ''"> and user_id = #{userId}</if>
|
|
|
+ <if test="companyId != null "> and company_id = #{companyId}</if>
|
|
|
+ <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
|
|
|
+ <if test="roleId != null "> and role_id = #{roleId}</if>
|
|
|
+ <if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
|
|
|
+ <if test="userType != null "> and user_type = #{userType}</if>
|
|
|
+ <if test="userContent != null and userContent != ''"> and user_content = #{userContent}</if>
|
|
|
+ <if test="companyUserContent != null and companyUserContent != ''"> and company_user_content = #{companyUserContent}</if>
|
|
|
+ <if test="questionStatisticsId != null and questionStatisticsId != ''"> and question_statistics_id = #{questionStatisticsId}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectFastgptChatQuestionById" parameterType="Long" resultMap="FastgptChatQuestionResult">
|
|
|
+ <include refid="selectFastgptChatQuestionVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertFastgptChatQuestion" parameterType="FastgptChatQuestion" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into fastgpt_chat_question
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="sessionId != null">session_id,</if>
|
|
|
+ <if test="msgId != null">msg_id,</if>
|
|
|
+ <if test="extId != null">ext_id,</if>
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="companyId != null">company_id,</if>
|
|
|
+ <if test="companyUserId != null">company_user_id,</if>
|
|
|
+ <if test="roleId != null">role_id,</if>
|
|
|
+ <if test="nickName != null">nick_name,</if>
|
|
|
+ <if test="userType != null">user_type,</if>
|
|
|
+ <if test="userContent != null">user_content,</if>
|
|
|
+ <if test="companyUserContent != null">company_user_content,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="questionStatisticsId != null">question_statistics_id,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="sessionId != null">#{sessionId},</if>
|
|
|
+ <if test="msgId != null">#{msgId},</if>
|
|
|
+ <if test="extId != null">#{extId},</if>
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="companyId != null">#{companyId},</if>
|
|
|
+ <if test="companyUserId != null">#{companyUserId},</if>
|
|
|
+ <if test="roleId != null">#{roleId},</if>
|
|
|
+ <if test="nickName != null">#{nickName},</if>
|
|
|
+ <if test="userType != null">#{userType},</if>
|
|
|
+ <if test="userContent != null">#{userContent},</if>
|
|
|
+ <if test="companyUserContent != null">#{companyUserContent},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="questionStatisticsId != null">#{questionStatisticsId},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateFastgptChatQuestion" parameterType="FastgptChatQuestion">
|
|
|
+ update fastgpt_chat_question
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="sessionId != null">session_id = #{sessionId},</if>
|
|
|
+ <if test="msgId != null">msg_id = #{msgId},</if>
|
|
|
+ <if test="extId != null">ext_id = #{extId},</if>
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
+ <if test="companyId != null">company_id = #{companyId},</if>
|
|
|
+ <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
|
|
|
+ <if test="roleId != null">role_id = #{roleId},</if>
|
|
|
+ <if test="nickName != null">nick_name = #{nickName},</if>
|
|
|
+ <if test="userType != null">user_type = #{userType},</if>
|
|
|
+ <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="questionStatisticsId != null">question_statistics_id = #{questionStatisticsId},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteFastgptChatQuestionById" parameterType="Long">
|
|
|
+ delete from fastgpt_chat_question where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteFastgptChatQuestionByIds" parameterType="String">
|
|
|
+ delete from fastgpt_chat_question where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <update id="updateQuestionStatisticsIdById">
|
|
|
+ update fastgpt_chat_question
|
|
|
+ set question_statistics_id = #{questionStatisticsId}
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+</mapper>
|