MomentSendMessageMapper.xml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.tzld.piaoquan.growth.common.dao.mapper.MomentSendMessageMapper">
  4. <resultMap id="BaseResultMap" type="com.tzld.piaoquan.growth.common.model.po.MomentSendMessage">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="pre_send_date" jdbcType="VARCHAR" property="preSendDate" />
  7. <result column="staff_id" jdbcType="BIGINT" property="staffId" />
  8. <result column="content" jdbcType="VARCHAR" property="content" />
  9. <result column="attachment_ids" jdbcType="VARCHAR" property="attachmentIds" />
  10. <result column="is_send" jdbcType="INTEGER" property="isSend" />
  11. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  12. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  13. </resultMap>
  14. <sql id="Example_Where_Clause">
  15. <where>
  16. <foreach collection="oredCriteria" item="criteria" separator="or">
  17. <if test="criteria.valid">
  18. <trim prefix="(" prefixOverrides="and" suffix=")">
  19. <foreach collection="criteria.criteria" item="criterion">
  20. <choose>
  21. <when test="criterion.noValue">
  22. and ${criterion.condition}
  23. </when>
  24. <when test="criterion.singleValue">
  25. and ${criterion.condition} #{criterion.value}
  26. </when>
  27. <when test="criterion.betweenValue">
  28. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  29. </when>
  30. <when test="criterion.listValue">
  31. and ${criterion.condition}
  32. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  33. #{listItem}
  34. </foreach>
  35. </when>
  36. </choose>
  37. </foreach>
  38. </trim>
  39. </if>
  40. </foreach>
  41. </where>
  42. </sql>
  43. <sql id="Update_By_Example_Where_Clause">
  44. <where>
  45. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  46. <if test="criteria.valid">
  47. <trim prefix="(" prefixOverrides="and" suffix=")">
  48. <foreach collection="criteria.criteria" item="criterion">
  49. <choose>
  50. <when test="criterion.noValue">
  51. and ${criterion.condition}
  52. </when>
  53. <when test="criterion.singleValue">
  54. and ${criterion.condition} #{criterion.value}
  55. </when>
  56. <when test="criterion.betweenValue">
  57. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  58. </when>
  59. <when test="criterion.listValue">
  60. and ${criterion.condition}
  61. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  62. #{listItem}
  63. </foreach>
  64. </when>
  65. </choose>
  66. </foreach>
  67. </trim>
  68. </if>
  69. </foreach>
  70. </where>
  71. </sql>
  72. <sql id="Base_Column_List">
  73. id, pre_send_date, staff_id, content, attachment_ids, is_send, create_time, update_time
  74. </sql>
  75. <select id="selectByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.MomentSendMessageExample" resultMap="BaseResultMap">
  76. select
  77. <if test="distinct">
  78. distinct
  79. </if>
  80. <include refid="Base_Column_List" />
  81. from we_com_moment_send_message
  82. <if test="_parameter != null">
  83. <include refid="Example_Where_Clause" />
  84. </if>
  85. <if test="orderByClause != null">
  86. order by ${orderByClause}
  87. </if>
  88. <if test="page != null">
  89. limit #{page.offset} , #{page.pageSize}
  90. </if>
  91. </select>
  92. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  93. select
  94. <include refid="Base_Column_List" />
  95. from we_com_moment_send_message
  96. where id = #{id,jdbcType=BIGINT}
  97. </select>
  98. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  99. delete from we_com_moment_send_message
  100. where id = #{id,jdbcType=BIGINT}
  101. </delete>
  102. <delete id="deleteByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.MomentSendMessageExample">
  103. delete from we_com_moment_send_message
  104. <if test="_parameter != null">
  105. <include refid="Example_Where_Clause" />
  106. </if>
  107. </delete>
  108. <insert id="insert" parameterType="com.tzld.piaoquan.growth.common.model.po.MomentSendMessage">
  109. insert into we_com_moment_send_message (id, pre_send_date, staff_id,
  110. content, attachment_ids, is_send,
  111. create_time, update_time)
  112. values (#{id,jdbcType=BIGINT}, #{preSendDate,jdbcType=VARCHAR}, #{staffId,jdbcType=BIGINT},
  113. #{content,jdbcType=VARCHAR}, #{attachmentIds,jdbcType=VARCHAR}, #{isSend,jdbcType=INTEGER},
  114. #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
  115. </insert>
  116. <insert id="insertSelective" parameterType="com.tzld.piaoquan.growth.common.model.po.MomentSendMessage">
  117. insert into we_com_moment_send_message
  118. <trim prefix="(" suffix=")" suffixOverrides=",">
  119. <if test="id != null">
  120. id,
  121. </if>
  122. <if test="preSendDate != null">
  123. pre_send_date,
  124. </if>
  125. <if test="staffId != null">
  126. staff_id,
  127. </if>
  128. <if test="content != null">
  129. content,
  130. </if>
  131. <if test="attachmentIds != null">
  132. attachment_ids,
  133. </if>
  134. <if test="isSend != null">
  135. is_send,
  136. </if>
  137. <if test="createTime != null">
  138. create_time,
  139. </if>
  140. <if test="updateTime != null">
  141. update_time,
  142. </if>
  143. </trim>
  144. <trim prefix="values (" suffix=")" suffixOverrides=",">
  145. <if test="id != null">
  146. #{id,jdbcType=BIGINT},
  147. </if>
  148. <if test="preSendDate != null">
  149. #{preSendDate,jdbcType=VARCHAR},
  150. </if>
  151. <if test="staffId != null">
  152. #{staffId,jdbcType=BIGINT},
  153. </if>
  154. <if test="content != null">
  155. #{content,jdbcType=VARCHAR},
  156. </if>
  157. <if test="attachmentIds != null">
  158. #{attachmentIds,jdbcType=VARCHAR},
  159. </if>
  160. <if test="isSend != null">
  161. #{isSend,jdbcType=INTEGER},
  162. </if>
  163. <if test="createTime != null">
  164. #{createTime,jdbcType=TIMESTAMP},
  165. </if>
  166. <if test="updateTime != null">
  167. #{updateTime,jdbcType=TIMESTAMP},
  168. </if>
  169. </trim>
  170. </insert>
  171. <select id="countByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.MomentSendMessageExample" resultType="java.lang.Long">
  172. select count(*) from we_com_moment_send_message
  173. <if test="_parameter != null">
  174. <include refid="Example_Where_Clause" />
  175. </if>
  176. </select>
  177. <update id="updateByExampleSelective" parameterType="map">
  178. update we_com_moment_send_message
  179. <set>
  180. <if test="record.id != null">
  181. id = #{record.id,jdbcType=BIGINT},
  182. </if>
  183. <if test="record.preSendDate != null">
  184. pre_send_date = #{record.preSendDate,jdbcType=VARCHAR},
  185. </if>
  186. <if test="record.staffId != null">
  187. staff_id = #{record.staffId,jdbcType=BIGINT},
  188. </if>
  189. <if test="record.content != null">
  190. content = #{record.content,jdbcType=VARCHAR},
  191. </if>
  192. <if test="record.attachmentIds != null">
  193. attachment_ids = #{record.attachmentIds,jdbcType=VARCHAR},
  194. </if>
  195. <if test="record.isSend != null">
  196. is_send = #{record.isSend,jdbcType=INTEGER},
  197. </if>
  198. <if test="record.createTime != null">
  199. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  200. </if>
  201. <if test="record.updateTime != null">
  202. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  203. </if>
  204. </set>
  205. <if test="_parameter != null">
  206. <include refid="Update_By_Example_Where_Clause" />
  207. </if>
  208. </update>
  209. <update id="updateByExample" parameterType="map">
  210. update we_com_moment_send_message
  211. set id = #{record.id,jdbcType=BIGINT},
  212. pre_send_date = #{record.preSendDate,jdbcType=VARCHAR},
  213. staff_id = #{record.staffId,jdbcType=BIGINT},
  214. content = #{record.content,jdbcType=VARCHAR},
  215. attachment_ids = #{record.attachmentIds,jdbcType=VARCHAR},
  216. is_send = #{record.isSend,jdbcType=INTEGER},
  217. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  218. update_time = #{record.updateTime,jdbcType=TIMESTAMP}
  219. <if test="_parameter != null">
  220. <include refid="Update_By_Example_Where_Clause" />
  221. </if>
  222. </update>
  223. <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.growth.common.model.po.MomentSendMessage">
  224. update we_com_moment_send_message
  225. <set>
  226. <if test="preSendDate != null">
  227. pre_send_date = #{preSendDate,jdbcType=VARCHAR},
  228. </if>
  229. <if test="staffId != null">
  230. staff_id = #{staffId,jdbcType=BIGINT},
  231. </if>
  232. <if test="content != null">
  233. content = #{content,jdbcType=VARCHAR},
  234. </if>
  235. <if test="attachmentIds != null">
  236. attachment_ids = #{attachmentIds,jdbcType=VARCHAR},
  237. </if>
  238. <if test="isSend != null">
  239. is_send = #{isSend,jdbcType=INTEGER},
  240. </if>
  241. <if test="createTime != null">
  242. create_time = #{createTime,jdbcType=TIMESTAMP},
  243. </if>
  244. <if test="updateTime != null">
  245. update_time = #{updateTime,jdbcType=TIMESTAMP},
  246. </if>
  247. </set>
  248. where id = #{id,jdbcType=BIGINT}
  249. </update>
  250. <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.growth.common.model.po.MomentSendMessage">
  251. update we_com_moment_send_message
  252. set pre_send_date = #{preSendDate,jdbcType=VARCHAR},
  253. staff_id = #{staffId,jdbcType=BIGINT},
  254. content = #{content,jdbcType=VARCHAR},
  255. attachment_ids = #{attachmentIds,jdbcType=VARCHAR},
  256. is_send = #{isSend,jdbcType=INTEGER},
  257. create_time = #{createTime,jdbcType=TIMESTAMP},
  258. update_time = #{updateTime,jdbcType=TIMESTAMP}
  259. where id = #{id,jdbcType=BIGINT}
  260. </update>
  261. </mapper>