CcLlmKbCatMapper.xml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.fs.aicall.mapper.CcLlmKbCatMapper">
  6. <resultMap type="CcLlmKbCat" id="CcLlmKbCatResult">
  7. <result property="id" column="id" />
  8. <result property="cat" column="cat" />
  9. <result property="description" column="description" />
  10. </resultMap>
  11. <sql id="selectCcLlmKbCatVo">
  12. select id, cat, description from cc_llm_kb_cat
  13. </sql>
  14. <select id="selectCcLlmKbCatList" parameterType="CcLlmKbCat" resultMap="CcLlmKbCatResult">
  15. <include refid="selectCcLlmKbCatVo"/>
  16. <where>
  17. <if test="cat != null and cat != ''"> and cat = #{cat}</if>
  18. <if test="description != null and description != ''"> and description = #{description}</if>
  19. </where>
  20. </select>
  21. <select id="selectCcLlmKbCatById" parameterType="Long" resultMap="CcLlmKbCatResult">
  22. <include refid="selectCcLlmKbCatVo"/>
  23. where id = #{id}
  24. </select>
  25. <insert id="insertCcLlmKbCat" parameterType="CcLlmKbCat" useGeneratedKeys="true" keyProperty="id">
  26. insert into cc_llm_kb_cat
  27. <trim prefix="(" suffix=")" suffixOverrides=",">
  28. <if test="cat != null">cat,</if>
  29. <if test="description != null">description,</if>
  30. </trim>
  31. <trim prefix="values (" suffix=")" suffixOverrides=",">
  32. <if test="cat != null">#{cat},</if>
  33. <if test="description != null">#{description},</if>
  34. </trim>
  35. </insert>
  36. <update id="updateCcLlmKbCat" parameterType="CcLlmKbCat">
  37. update cc_llm_kb_cat
  38. <trim prefix="SET" suffixOverrides=",">
  39. <if test="cat != null">cat = #{cat},</if>
  40. <if test="description != null">description = #{description},</if>
  41. </trim>
  42. where id = #{id}
  43. </update>
  44. <delete id="deleteCcLlmKbCatById" parameterType="Long">
  45. delete from cc_llm_kb_cat where id = #{id}
  46. </delete>
  47. <delete id="deleteCcLlmKbCatByIds" parameterType="String">
  48. delete from cc_llm_kb_cat where id in
  49. <foreach item="id" collection="array" open="(" separator="," close=")">
  50. #{id}
  51. </foreach>
  52. </delete>
  53. </mapper>