QwGroupMsgMapper.xml 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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.QwGroupMsgMapper">
  6. <resultMap type="QwGroupMsg" id="QwGroupMsgResult">
  7. <result property="id" column="id" />
  8. <result property="msgid" column="msgid" />
  9. <result property="chatType" column="chat_type" />
  10. <result property="selectType" column="select_type" />
  11. <result property="filterCustomers" column="filter_customers" />
  12. <result property="sender" column="sender" />
  13. <result property="allowSelect" column="allow_select" />
  14. <result property="textContent" column="text_content" />
  15. <result property="corpId" column="corp_id" />
  16. <result property="companyId" column="company_id" />
  17. <result property="tagNames" column="tag_names" />
  18. <result property="groupChatNames" column="group_chat_names" />
  19. <result property="fromUserCount" column="from_user_count" />
  20. <result property="toUserCount" column="to_user_count" />
  21. <result property="fromUserNum" column="from_user_num" />
  22. <result property="toUserNum" column="to_user_num" />
  23. <result property="createTime" column="create_time" />
  24. <result property="updateTime" column="update_time" />
  25. <result property="createName" column="create_name" />
  26. <result property="isSend" column="is_send" />
  27. <result property="isTimerSend" column="is_timer_send" />
  28. <result property="timerSend" column="timer_send" />
  29. </resultMap>
  30. <sql id="selectQwGroupMsgVo">
  31. select id, msgid, chat_type,select_type,filter_customers, sender, allow_select, text_content, corp_id, company_id, tag_names, group_chat_names, from_user_count, to_user_count, from_user_num, to_user_num, create_time, update_time, create_name, is_send, is_timer_send, timer_send from qw_group_msg
  32. </sql>
  33. <select id="selectQwGroupMsgList" parameterType="QwGroupMsg" resultMap="QwGroupMsgResult">
  34. <include refid="selectQwGroupMsgVo"/>
  35. <where>
  36. <if test="msgid != null and msgid != ''"> and msgid = #{msgid}</if>
  37. <if test="chatType != null and chatType != ''"> and chat_type = #{chatType}</if>
  38. <if test="selectType != null and selectType != ''"> and select_type = #{selectType}</if>
  39. <if test="filterCustomers != null and filterCustomers != ''"> and filter_customers = #{filterCustomers}</if>
  40. <if test="sender != null and sender != ''"> and sender = #{sender}</if>
  41. <if test="allowSelect != null and allowSelect != ''"> and allow_select = #{allowSelect}</if>
  42. <if test="textContent != null and textContent != ''"> and text_content like concat('%', #{textContent}, '%')</if>
  43. <if test="corpId != null and corpId != ''"> and corp_id = #{corpId}</if>
  44. <if test="companyId != null "> and company_id = #{companyId}</if>
  45. <if test="tagNames != null and tagNames != ''"> and tag_names like concat('%', #{tagNames}, '%')</if>
  46. <if test="groupChatNames != null and groupChatNames != ''"> and group_chat_names like concat('%', #{groupChatNames}, '%')</if>
  47. <if test="fromUserCount != null "> and from_user_count = #{fromUserCount}</if>
  48. <if test="toUserCount != null "> and to_user_count = #{toUserCount}</if>
  49. <if test="fromUserNum != null "> and from_user_num = #{fromUserNum}</if>
  50. <if test="toUserNum != null "> and to_user_num = #{toUserNum}</if>
  51. <if test="createName != null and createName != ''"> and create_name like concat('%', #{createName}, '%')</if>
  52. <if test="isSend != null "> and is_send = #{isSend}</if>
  53. <if test="isTimerSend != null "> and is_timer_send = #{isTimerSend}</if>
  54. <if test="timerSend != null "> and timer_send = #{timerSend}</if>
  55. </where>
  56. </select>
  57. <select id="selectQwGroupMsgById" parameterType="Long" resultMap="QwGroupMsgResult">
  58. <include refid="selectQwGroupMsgVo"/>
  59. where id = #{id}
  60. </select>
  61. <insert id="insertQwGroupMsg" parameterType="QwGroupMsg" useGeneratedKeys="true" keyProperty="id">
  62. insert into qw_group_msg
  63. <trim prefix="(" suffix=")" suffixOverrides=",">
  64. <if test="msgid != null and msgid != ''">msgid,</if>
  65. <if test="chatType != null and chatType != ''">chat_type,</if>
  66. <if test="selectType != null and selectType != ''">select_type,</if>
  67. <if test="filterCustomers != null and filterCustomers != ''">filter_customers,</if>
  68. <if test="sender != null and sender != ''">sender,</if>
  69. <if test="allowSelect != null ">allow_select,</if>
  70. <if test="textContent != null and textContent != ''">text_content,</if>
  71. <if test="corpId != null">corp_id,</if>
  72. <if test="companyId != null">company_id,</if>
  73. <if test="tagNames != null">tag_names,</if>
  74. <if test="groupChatNames != null">group_chat_names,</if>
  75. <if test="fromUserCount != null">from_user_count,</if>
  76. <if test="toUserCount != null">to_user_count,</if>
  77. <if test="fromUserNum != null">from_user_num,</if>
  78. <if test="toUserNum != null">to_user_num,</if>
  79. <if test="createTime != null">create_time,</if>
  80. <if test="updateTime != null">update_time,</if>
  81. <if test="createName != null">create_name,</if>
  82. <if test="isSend != null">is_send,</if>
  83. <if test="isTimerSend != null">is_timer_send,</if>
  84. <if test="timerSend != null">timer_send,</if>
  85. </trim>
  86. <trim prefix="values (" suffix=")" suffixOverrides=",">
  87. <if test="msgid != null and msgid != ''">#{msgid},</if>
  88. <if test="chatType != null and chatType != ''">#{chatType},</if>
  89. <if test="selectType != null and selectType != ''">#{selectType},</if>
  90. <if test="filterCustomers != null and filterCustomers != ''">#{filterCustomers},</if>
  91. <if test="sender != null and sender != ''">#{sender},</if>
  92. <if test="allowSelect != null and allowSelect != ''">#{allowSelect},</if>
  93. <if test="textContent != null and textContent != ''">#{textContent},</if>
  94. <if test="corpId != null">#{corpId},</if>
  95. <if test="companyId != null">#{companyId},</if>
  96. <if test="tagNames != null">#{tagNames},</if>
  97. <if test="groupChatNames != null">#{groupChatNames},</if>
  98. <if test="fromUserCount != null">#{fromUserCount},</if>
  99. <if test="toUserCount != null">#{toUserCount},</if>
  100. <if test="fromUserNum != null">#{fromUserNum},</if>
  101. <if test="toUserNum != null">#{toUserNum},</if>
  102. <if test="createTime != null">#{createTime},</if>
  103. <if test="updateTime != null">#{updateTime},</if>
  104. <if test="createName != null">#{createName},</if>
  105. <if test="isSend != null">#{isSend},</if>
  106. <if test="isTimerSend != null">#{isTimerSend},</if>
  107. <if test="timerSend != null">#{timerSend},</if>
  108. </trim>
  109. </insert>
  110. <update id="updateQwGroupMsg" parameterType="QwGroupMsg">
  111. update qw_group_msg
  112. <trim prefix="SET" suffixOverrides=",">
  113. <if test="msgid != null and msgid != ''">msgid = #{msgid},</if>
  114. <if test="chatType != null and chatType != ''">chat_type = #{chatType},</if>
  115. <if test="selectType != null and selectType != ''">select_type = #{selectType},</if>
  116. <if test="filterCustomers != null and filterCustomers != ''">filter_customers = #{filterCustomers},</if>
  117. <if test="sender != null and sender != ''">sender = #{sender},</if>
  118. <if test="allowSelect != null and allowSelect != ''">allow_select = #{allowSelect},</if>
  119. <if test="textContent != null and textContent != ''">text_content = #{textContent},</if>
  120. <if test="corpId != null">corp_id = #{corpId},</if>
  121. <if test="companyId != null">company_id = #{companyId},</if>
  122. <if test="tagNames != null">tag_names = #{tagNames},</if>
  123. <if test="groupChatNames != null">group_chat_names = #{groupChatNames},</if>
  124. <if test="fromUserCount != null">from_user_count = #{fromUserCount},</if>
  125. <if test="toUserCount != null">to_user_count = #{toUserCount},</if>
  126. <if test="fromUserNum != null">from_user_num = #{fromUserNum},</if>
  127. <if test="toUserNum != null">to_user_num = #{toUserNum},</if>
  128. <if test="createTime != null">create_time = #{createTime},</if>
  129. <if test="updateTime != null">update_time = #{updateTime},</if>
  130. <if test="createName != null">create_name = #{createName},</if>
  131. <if test="isSend != null">is_send = #{isSend},</if>
  132. <if test="isTimerSend != null">is_timer_send = #{isTimerSend},</if>
  133. <if test="timerSend != null">timer_send = #{timerSend},</if>
  134. </trim>
  135. where id = #{id}
  136. </update>
  137. <delete id="deleteQwGroupMsgById" parameterType="Long">
  138. delete from qw_group_msg where id = #{id}
  139. </delete>
  140. <delete id="deleteQwGroupMsgByIds" parameterType="String">
  141. delete from qw_group_msg where id in
  142. <foreach item="id" collection="array" open="(" separator="," close=")">
  143. #{id}
  144. </foreach>
  145. </delete>
  146. </mapper>