QwForbiddenMessageMapper.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.qw.mapper.QwForbiddenMessageMapper">
  6. <resultMap type="QwForbiddenMessage" id="QwForbiddenMessageResult">
  7. <result property="id" column="id" />
  8. <result property="messageId" column="message_id" />
  9. <result property="conversationId" column="conversation_id" />
  10. <result property="content" column="content" />
  11. <result property="companyUserId" column="company_user_id" />
  12. <result property="companyId" column="company_id" />
  13. <result property="createTime" column="create_time" />
  14. <result property="account" column="account" />
  15. <result property="sendTime" column="send_time" />
  16. <result property="wordId" column="word_id" />
  17. </resultMap>
  18. <sql id="selectQwForbiddenMessageVo">
  19. select id,send_time,account, message_id, conversation_id, content, company_user_id, company_id, create_time from qw_forbidden_message
  20. </sql>
  21. <select id="selectQwForbiddenMessageList" parameterType="QwForbiddenMessage" resultMap="QwForbiddenMessageResult">
  22. <include refid="selectQwForbiddenMessageVo"/>
  23. <where>
  24. <if test="account != null and account != ''"> and account = #{account}</if>
  25. <if test="sendTime != null "> and send_time = #{sendTime}</if>
  26. <if test="messageId != null "> and message_id = #{messageId}</if>
  27. <if test="conversationId != null and conversationId != ''"> and conversation_id = #{conversationId}</if>
  28. <if test="content != null and content != ''"> and content = #{content}</if>
  29. <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
  30. <if test="companyId != null "> and company_id = #{companyId}</if>
  31. </where>
  32. </select>
  33. <select id="selectQwForbiddenMessageById" parameterType="Long" resultMap="QwForbiddenMessageResult">
  34. <include refid="selectQwForbiddenMessageVo"/>
  35. where id = #{id}
  36. </select>
  37. <insert id="insertQwForbiddenMessage" parameterType="QwForbiddenMessage" useGeneratedKeys="true" keyProperty="id">
  38. insert into qw_forbidden_message
  39. <trim prefix="(" suffix=")" suffixOverrides=",">
  40. <if test="messageId != null">message_id,</if>
  41. <if test="conversationId != null">conversation_id,</if>
  42. <if test="content != null">content,</if>
  43. <if test="sendTime != null">send_time,</if>
  44. <if test="companyUserId != null">company_user_id,</if>
  45. <if test="companyId != null">company_id,</if>
  46. <if test="wordId != null">word_id,</if>
  47. <if test="createTime != null">create_time,</if>
  48. <if test="account != null">account,</if>
  49. </trim>
  50. <trim prefix="values (" suffix=")" suffixOverrides=",">
  51. <if test="messageId != null">#{messageId},</if>
  52. <if test="conversationId != null">#{conversationId},</if>
  53. <if test="content != null">#{content},</if>
  54. <if test="sendTime != null">#{sendTime},</if>
  55. <if test="companyUserId != null">#{companyUserId},</if>
  56. <if test="companyId != null">#{companyId},</if>
  57. <if test="wordId != null">#{wordId},</if>
  58. <if test="createTime != null">#{createTime},</if>
  59. <if test="account != null">#{account},</if>
  60. </trim>
  61. </insert>
  62. <update id="updateQwForbiddenMessage" parameterType="QwForbiddenMessage">
  63. update qw_forbidden_message
  64. <trim prefix="SET" suffixOverrides=",">
  65. <if test="messageId != null">message_id = #{messageId},</if>
  66. <if test="conversationId != null">conversation_id = #{conversationId},</if>
  67. <if test="content != null">content = #{content},</if>
  68. <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
  69. <if test="companyId != null">company_id = #{companyId},</if>
  70. <if test="wordId != null">word_id = #{wordId},</if>
  71. <if test="createTime != null">create_time = #{createTime},</if>
  72. <if test="account != null">account = #{account},</if>
  73. <if test="sendTime != null">send_time = #{sendTime},</if>
  74. </trim>
  75. where id = #{id}
  76. </update>
  77. <delete id="deleteQwForbiddenMessageById" parameterType="Long">
  78. delete from qw_forbidden_message where id = #{id}
  79. </delete>
  80. <delete id="deleteQwForbiddenMessageByIds" parameterType="String">
  81. delete from qw_forbidden_message where id in
  82. <foreach item="id" collection="array" open="(" separator="," close=")">
  83. #{id}
  84. </foreach>
  85. </delete>
  86. </mapper>