FastGptChatReplaceTextMapper.xml 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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.fastGpt.mapper.FastGptChatReplaceTextMapper">
  6. <resultMap type="FastGptChatReplaceText" id="FastGptChatReplaceTextResult">
  7. <result property="id" column="id" />
  8. <result property="type" column="type" />
  9. <result property="content" column="content" />
  10. <result property="changeCount" column="change_count" />
  11. <result property="status" column="status" />
  12. <result property="sort" column="sort" />
  13. <result property="createTime" column="create_time" />
  14. </resultMap>
  15. <sql id="selectFastGptChatReplaceTextVo">
  16. select id, type, content, change_count, status, sort, create_time from fastgpt_chat_replace_text
  17. </sql>
  18. <select id="selectFastGptChatReplaceTextList" parameterType="FastGptChatReplaceText" resultMap="FastGptChatReplaceTextResult">
  19. <include refid="selectFastGptChatReplaceTextVo"/>
  20. <where>
  21. <if test="type != null "> and type = #{type}</if>
  22. <if test="content != null and content != ''"> and content like concat('%', #{content}, '%')</if>
  23. <if test="status != null "> and status = #{status}</if>
  24. <if test="sort != null "> and sort = #{sort}</if>
  25. </where>
  26. order by sort desc,id desc
  27. </select>
  28. <select id="selectFastGptChatReplaceTextById" parameterType="Long" resultMap="FastGptChatReplaceTextResult">
  29. <include refid="selectFastGptChatReplaceTextVo"/>
  30. where id = #{id}
  31. </select>
  32. <insert id="insertFastGptChatReplaceText" parameterType="FastGptChatReplaceText" useGeneratedKeys="true" keyProperty="id">
  33. insert into fastgpt_chat_replace_text
  34. <trim prefix="(" suffix=")" suffixOverrides=",">
  35. <if test="type != null">type,</if>
  36. <if test="content != null">content,</if>
  37. <if test="changeCount != null">change_count,</if>
  38. <if test="status != null">status,</if>
  39. <if test="sort != null">sort,</if>
  40. <if test="createTime != null">create_time,</if>
  41. </trim>
  42. <trim prefix="values (" suffix=")" suffixOverrides=",">
  43. <if test="type != null">#{type},</if>
  44. <if test="content != null">#{content},</if>
  45. <if test="changeCount != null">#{changeCount},</if>
  46. <if test="status != null">#{status},</if>
  47. <if test="sort != null">#{sort},</if>
  48. <if test="createTime != null">#{createTime},</if>
  49. </trim>
  50. </insert>
  51. <update id="updateFastGptChatReplaceText" parameterType="FastGptChatReplaceText">
  52. update fastgpt_chat_replace_text
  53. <trim prefix="SET" suffixOverrides=",">
  54. <if test="type != null">type = #{type},</if>
  55. <if test="content != null">content = #{content},</if>
  56. <if test="changeCount != null">change_count = #{changeCount},</if>
  57. <if test="status != null">status = #{status},</if>
  58. <if test="sort != null">sort = #{sort},</if>
  59. <if test="createTime != null">create_time = #{createTime},</if>
  60. </trim>
  61. where id = #{id}
  62. </update>
  63. <delete id="deleteFastGptChatReplaceTextById" parameterType="Long">
  64. delete from fastgpt_chat_replace_text where id = #{id}
  65. </delete>
  66. <delete id="deleteFastGptChatReplaceTextByIds" parameterType="String">
  67. delete from fastgpt_chat_replace_text where id in
  68. <foreach item="id" collection="array" open="(" separator="," close=")">
  69. #{id}
  70. </foreach>
  71. </delete>
  72. </mapper>