| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?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.takai.ai.mapper.TakaiKnowledgeMapper">
-
- <resultMap type="com.takai.ai.domain.entity.TakaiKnowledge" id="BmKnowledgeResult">
- <id property="knowledgeId" column="knowledge_id" />
- <result property="embeddingId" column="embedding_id" />
- <result property="name" column="name" />
- <result property="description" column="description" />
- <result property="background" column="background" />
- <result property="icon" column="icon" />
- <result property="wordNum" column="word_num" />
- <result property="length" column="length" />
- <result property="documentSize" column="document_size" />
- <result property="remark" column="remark" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- </resultMap>
-
- <sql id="selectSql">
- select knowledge_id, embedding_id, name, description, background, icon, word_num, length,document_size, create_by, create_time,update_time, remark
- from bm_knowledge
- </sql>
- <select id="selectKnowledgeList" parameterType="TakaiKnowledge" resultMap="BmKnowledgeResult">
- <include refid="selectSql"/>
- <where>
- <if test="knowledgeId != null and knowledgeId != ''">
- AND knowledge_id = #{knowledgeId}
- </if>
- </where>
- order by create_time asc
- </select>
-
- <select id="selectTargetKnowledge" parameterType="TakaiKnowledge" resultMap="BmKnowledgeResult">
- <include refid="selectSql"/>
- where knowledge_id = #{knowledgeId}
- </select>
-
- <insert id="insertKnowledge" parameterType="TakaiKnowledge">
- insert into bm_knowledge(
- <if test="knowledgeId != null and knowledgeId != ''">knowledge_id,</if>
- <if test="embeddingId != null and embeddingId != ''">embedding_id,</if>
- <if test="name != null and name != ''">name,</if>
- <if test="description != null and description != ''">description,</if>
- <if test="background != null and background != ''">background,</if>
- <if test="icon != null and icon != ''">icon,</if>
- <if test="wordNum != null">word_num,</if>
- <if test="length != null">length,</if>
- <if test="documentSize != null">document_size,</if>
- <if test="remark != null and remark != ''">remark,</if>
- <if test="createBy != null and createBy != ''">create_by,</if>
- create_time
- )values(
- <if test="knowledgeId != null and knowledgeId != ''">#{knowledgeId},</if>
- <if test="embeddingId != null and embeddingId != ''">#{embeddingId},</if>
- <if test="name != null and name != ''">#{name},</if>
- <if test="description != null and description != ''">#{description},</if>
- <if test="background != null and background != ''">#{background},</if>
- <if test="icon != null and icon != ''">#{icon},</if>
- <if test="wordNum != null">#{wordNum},</if>
- <if test="length != null">#{length},</if>
- <if test="documentSize != null">#{documentSize},</if>
- <if test="remark != null and remark != ''">#{remark},</if>
- <if test="createBy != null and createBy != ''">#{createBy},</if>
- sysdate()
- )
- </insert>
- <update id="updateKnowledge" parameterType="BmKnowledge">
- update bm_knowledge
- <set>
- <if test="knowledgeId != null and knowledgeId != ''">knowledge_id = #{knowledgeId},</if>
- <if test="embeddingId != null">embedding_id = #{embeddingId},</if>
- <if test="name != null and name != ''">name = #{name},</if>
- <if test="description != null and description != ''">description = #{description},</if>
- <if test="background != null and background != ''">background = #{background},</if>
- <if test="icon != null and icon != ''">icon = #{icon},</if>
- <if test="wordNum != null">word_num = #{wordNum},</if>
- <if test="length != null">length = #{length},</if>
- <if test="documentSize != null">document_size = #{documentSize},</if>
- <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- <if test="remark != null">remark = #{remark},</if>
- update_time = sysdate()
- </set>
- where knowledge_id = #{knowledgeId}
- </update>
- <delete id="delKnowledge" parameterType="String">
- delete from bm_knowledge where knowledge_id = #{knowledgeId}
- </delete>
-
- </mapper>
|