FastGptChatMsgLogsMapper.xml 4.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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.FastGptChatMsgLogsMapper">
  6. <resultMap type="FastGptChatMsgLogs" id="FastGptChatMsgLogsResult">
  7. <result property="logsId" column="logs_id" />
  8. <result property="msgId" column="msg_id" />
  9. <result property="logsType" column="logs_type" />
  10. <result property="content" column="content" />
  11. <result property="companyUserId" column="company_user_id" />
  12. <result property="createTime" column="create_time" />
  13. <result property="sContent" column="s_content" />
  14. <result property="userContent" column="user_content" />
  15. <result property="createBy" column="create_by" />
  16. <result property="companyId" column="company_id" />
  17. </resultMap>
  18. <sql id="selectFastGptChatMsgLogsVo">
  19. select logs_id, msg_id, logs_type, content, company_user_id, create_time, s_content, user_content, create_by, company_id from fastgpt_chat_msg_logs
  20. </sql>
  21. <select id="selectFastGptChatMsgLogsList" parameterType="FastGptChatMsgLogs" resultMap="FastGptChatMsgLogsResult">
  22. <include refid="selectFastGptChatMsgLogsVo"/>
  23. <where>
  24. <if test="msgId != null "> and msg_id = #{msgId}</if>
  25. <if test="logsType != null "> and logs_type = #{logsType}</if>
  26. <if test="content != null and content != ''"> and content = #{content}</if>
  27. <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
  28. <if test="sContent != null and sContent != ''"> and s_content = #{sContent}</if>
  29. <if test="userContent != null and userContent != ''"> and user_content = #{userContent}</if>
  30. <if test="companyId != null "> and company_id = #{companyId}</if>
  31. </where>
  32. </select>
  33. <select id="selectFastGptChatMsgLogsByLogsId" parameterType="Long" resultMap="FastGptChatMsgLogsResult">
  34. <include refid="selectFastGptChatMsgLogsVo"/>
  35. where logs_id = #{logsId}
  36. </select>
  37. <insert id="insertFastGptChatMsgLogs" parameterType="FastGptChatMsgLogs" useGeneratedKeys="true" keyProperty="logsId">
  38. insert into fastgpt_chat_msg_logs
  39. <trim prefix="(" suffix=")" suffixOverrides=",">
  40. <if test="msgId != null">msg_id,</if>
  41. <if test="logsType != null">logs_type,</if>
  42. <if test="content != null">content,</if>
  43. <if test="companyUserId != null">company_user_id,</if>
  44. <if test="createTime != null">create_time,</if>
  45. <if test="sContent != null">s_content,</if>
  46. <if test="userContent != null">user_content,</if>
  47. <if test="createBy != null">create_by,</if>
  48. <if test="companyId != null">company_id,</if>
  49. </trim>
  50. <trim prefix="values (" suffix=")" suffixOverrides=",">
  51. <if test="msgId != null">#{msgId},</if>
  52. <if test="logsType != null">#{logsType},</if>
  53. <if test="content != null">#{content},</if>
  54. <if test="companyUserId != null">#{companyUserId},</if>
  55. <if test="createTime != null">#{createTime},</if>
  56. <if test="sContent != null">#{sContent},</if>
  57. <if test="userContent != null">#{userContent},</if>
  58. <if test="createBy != null">#{createBy},</if>
  59. <if test="companyId != null">#{companyId},</if>
  60. </trim>
  61. </insert>
  62. <update id="updateFastGptChatMsgLogs" parameterType="FastGptChatMsgLogs">
  63. update fastgpt_chat_msg_logs
  64. <trim prefix="SET" suffixOverrides=",">
  65. <if test="msgId != null">msg_id = #{msgId},</if>
  66. <if test="logsType != null">logs_type = #{logsType},</if>
  67. <if test="content != null">content = #{content},</if>
  68. <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
  69. <if test="createTime != null">create_time = #{createTime},</if>
  70. <if test="sContent != null">s_content = #{sContent},</if>
  71. <if test="userContent != null">user_content = #{userContent},</if>
  72. <if test="createBy != null">create_by = #{createBy},</if>
  73. <if test="companyId != null">company_id = #{companyId},</if>
  74. </trim>
  75. where logs_id = #{logsId}
  76. </update>
  77. <delete id="deleteFastGptChatMsgLogsByLogsId" parameterType="Long">
  78. delete from fastgpt_chat_msg_logs where logs_id = #{logsId}
  79. </delete>
  80. <delete id="deleteFastGptChatMsgLogsByLogsIds" parameterType="String">
  81. delete from fastgpt_chat_msg_logs where logs_id in
  82. <foreach item="logsId" collection="array" open="(" separator="," close=")">
  83. #{logsId}
  84. </foreach>
  85. </delete>
  86. </mapper>