| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?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.aicall.mapper.CcLlmKbMapper">
-
- <resultMap type="CcLlmKb" id="CcLlmKbResult">
- <result property="id" column="id" />
- <result property="title" column="title" />
- <result property="content" column="content" />
- <result property="catId" column="cat_id" />
- </resultMap>
- <sql id="selectCcLlmKbVo">
- select id, title, content, cat_id from cc_llm_kb
- </sql>
- <select id="selectCcLlmKbList" parameterType="CcLlmKb" resultMap="CcLlmKbResult">
- <include refid="selectCcLlmKbVo"/>
- <where>
- <if test="title != null and title != ''"> and title = #{title}</if>
- <if test="content != null and content != ''"> and content = #{content}</if>
- <if test="catId != null "> and cat_id = #{catId}</if>
- </where>
- </select>
-
- <select id="selectCcLlmKbById" parameterType="Long" resultMap="CcLlmKbResult">
- <include refid="selectCcLlmKbVo"/>
- where id = #{id}
- </select>
- <insert id="insertCcLlmKb" parameterType="CcLlmKb">
- insert into cc_llm_kb
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="title != null and title != ''">title,</if>
- <if test="content != null and content != ''">content,</if>
- <if test="catId != null">cat_id,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="title != null and title != ''">#{title},</if>
- <if test="content != null and content != ''">#{content},</if>
- <if test="catId != null">#{catId},</if>
- </trim>
- </insert>
- <update id="updateCcLlmKb" parameterType="CcLlmKb">
- update cc_llm_kb
- <trim prefix="SET" suffixOverrides=",">
- <if test="title != null and title != ''">title = #{title},</if>
- <if test="content != null and content != ''">content = #{content},</if>
- <if test="catId != null">cat_id = #{catId},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteCcLlmKbById" parameterType="Long">
- delete from cc_llm_kb where id = #{id}
- </delete>
- <delete id="deleteCcLlmKbByIds" parameterType="String">
- delete from cc_llm_kb where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="selectCountByCatId" parameterType="Long">
- select count(1) from cc_llm_kb where cat_id = #{catId}
- </select>
- <delete id="deleteCcLlmKbByCatId" parameterType="Long">
- delete from cc_llm_kb where cat_id = #{catId}
- </delete>
- <!-- 批量插入 -->
- <insert id="insertBatch" parameterType="java.util.List">
- INSERT INTO cc_llm_kb
- (title, content, cat_id)
- VALUES
- <foreach collection="list" item="e" separator=",">
- (#{e.title},
- #{e.content},
- #{e.catId})
- </foreach>
- </insert>
- </mapper>
|