综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CmcChatMapper.xml 3.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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.ruoyi.llm.mapper.CmcChatMapper">
  6. <resultMap type="CmcChat" id="CmcChatResult">
  7. <result property="chatId" column="chat_id" />
  8. <result property="topicId" column="topic_id" />
  9. <result property="userId" column="user_id" />
  10. <result property="input" column="input" />
  11. <result property="inputTime" column="input_time" />
  12. <result property="output" column="output" />
  13. <result property="outputTime" column="output_time" />
  14. </resultMap>
  15. <sql id="selectCmcChatVo">
  16. select chat_id, topic_id, user_id, input, input_time, output, output_time from cmc_chat
  17. </sql>
  18. <select id="selectCmcChatList" parameterType="CmcChat" resultMap="CmcChatResult">
  19. <include refid="selectCmcChatVo"/>
  20. <where>
  21. <if test="topicId != null and topicId != ''"> and topic_id = #{topicId}</if>
  22. <if test="userId != null "> and user_id = #{userId}</if>
  23. <if test="input != null and input != ''"> and input = #{input}</if>
  24. <if test="inputTime != null "> and input_time = #{inputTime}</if>
  25. <if test="output != null and output != ''"> and output = #{output}</if>
  26. <if test="outputTime != null "> and output_time = #{outputTime}</if>
  27. </where>
  28. </select>
  29. <select id="selectCmcChatByChatId" parameterType="String" resultMap="CmcChatResult">
  30. <include refid="selectCmcChatVo"/>
  31. where chat_id = #{chatId}
  32. </select>
  33. <insert id="insertCmcChat" parameterType="CmcChat">
  34. insert into cmc_chat
  35. <trim prefix="(" suffix=")" suffixOverrides=",">
  36. <if test="chatId != null">chat_id,</if>
  37. <if test="topicId != null">topic_id,</if>
  38. <if test="userId != null">user_id,</if>
  39. <if test="input != null">input,</if>
  40. <if test="inputTime != null">input_time,</if>
  41. <if test="output != null">output,</if>
  42. <if test="outputTime != null">output_time,</if>
  43. </trim>
  44. <trim prefix="values (" suffix=")" suffixOverrides=",">
  45. <if test="chatId != null">#{chatId},</if>
  46. <if test="topicId != null">#{topicId},</if>
  47. <if test="userId != null">#{userId},</if>
  48. <if test="input != null">#{input},</if>
  49. <if test="inputTime != null">#{inputTime},</if>
  50. <if test="output != null">#{output},</if>
  51. <if test="outputTime != null">#{outputTime},</if>
  52. </trim>
  53. </insert>
  54. <update id="updateCmcChat" parameterType="CmcChat">
  55. update cmc_chat
  56. <trim prefix="SET" suffixOverrides=",">
  57. <if test="topicId != null">topic_id = #{topicId},</if>
  58. <if test="userId != null">user_id = #{userId},</if>
  59. <if test="input != null">input = #{input},</if>
  60. <if test="inputTime != null">input_time = #{inputTime},</if>
  61. <if test="output != null">output = #{output},</if>
  62. <if test="outputTime != null">output_time = #{outputTime},</if>
  63. </trim>
  64. where chat_id = #{chatId}
  65. </update>
  66. <delete id="deleteCmcChatByChatId" parameterType="String">
  67. delete from cmc_chat where chat_id = #{chatId}
  68. </delete>
  69. <delete id="deleteCmcChatByChatIds" parameterType="String">
  70. delete from cmc_chat where chat_id in
  71. <foreach item="chatId" collection="array" open="(" separator="," close=")">
  72. #{chatId}
  73. </foreach>
  74. </delete>
  75. </mapper>