NewPushMessageCallbackMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  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.longarticle.recommend.server.mapper.growth.NewPushMessageCallbackMapper">
  4. <resultMap id="BaseResultMap" type="com.tzld.longarticle.recommend.server.repository.model.PushMessageCallback">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="gh_id" jdbcType="VARCHAR" property="ghId"/>
  7. <result column="open_id" jdbcType="VARCHAR" property="openId"/>
  8. <result column="timestamp" jdbcType="BIGINT" property="timestamp"/>
  9. <result column="msg_type" jdbcType="INTEGER" property="msgType"/>
  10. <result column="video_id" jdbcType="BIGINT" property="videoId"/>
  11. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  12. </resultMap>
  13. <sql id="Example_Where_Clause">
  14. <where>
  15. <foreach collection="oredCriteria" item="criteria" separator="or">
  16. <if test="criteria.valid">
  17. <trim prefix="(" prefixOverrides="and" suffix=")">
  18. <foreach collection="criteria.criteria" item="criterion">
  19. <choose>
  20. <when test="criterion.noValue">
  21. and ${criterion.condition}
  22. </when>
  23. <when test="criterion.singleValue">
  24. and ${criterion.condition} #{criterion.value}
  25. </when>
  26. <when test="criterion.betweenValue">
  27. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  28. </when>
  29. <when test="criterion.listValue">
  30. and ${criterion.condition}
  31. <foreach close=")" collection="criterion.value" item="listItem" open="("
  32. 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="("
  62. separator=",">
  63. #{listItem}
  64. </foreach>
  65. </when>
  66. </choose>
  67. </foreach>
  68. </trim>
  69. </if>
  70. </foreach>
  71. </where>
  72. </sql>
  73. <sql id="Base_Column_List">
  74. id
  75. , gh_id, open_id, timestamp, msg_type, video_id, create_time
  76. </sql>
  77. <select id="selectByExample"
  78. parameterType="com.tzld.longarticle.recommend.server.repository.model.PushMessageCallbackExample"
  79. resultMap="BaseResultMap">
  80. select
  81. <if test="distinct">
  82. distinct
  83. </if>
  84. <include refid="Base_Column_List"/>
  85. from push_message_callback
  86. <if test="_parameter != null">
  87. <include refid="Example_Where_Clause"/>
  88. </if>
  89. <if test="orderByClause != null">
  90. order by ${orderByClause}
  91. </if>
  92. </select>
  93. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  94. select
  95. <include refid="Base_Column_List"/>
  96. from push_message_callback
  97. where id = #{id,jdbcType=BIGINT}
  98. </select>
  99. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  100. delete
  101. from push_message_callback
  102. where id = #{id,jdbcType=BIGINT}
  103. </delete>
  104. <delete id="deleteByExample"
  105. parameterType="com.tzld.longarticle.recommend.server.repository.model.PushMessageCallbackExample">
  106. delete from push_message_callback
  107. <if test="_parameter != null">
  108. <include refid="Example_Where_Clause"/>
  109. </if>
  110. </delete>
  111. <insert id="insert" parameterType="com.tzld.longarticle.recommend.server.repository.model.PushMessageCallback">
  112. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
  113. SELECT LAST_INSERT_ID()
  114. </selectKey>
  115. insert into push_message_callback (gh_id, open_id, timestamp,
  116. msg_type, video_id, create_time
  117. )
  118. values (#{ghId,jdbcType=VARCHAR}, #{openId,jdbcType=VARCHAR}, #{timestamp,jdbcType=BIGINT},
  119. #{msgType,jdbcType=INTEGER}, #{videoId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}
  120. )
  121. </insert>
  122. <insert id="insertSelective"
  123. parameterType="com.tzld.longarticle.recommend.server.repository.model.PushMessageCallback">
  124. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
  125. SELECT LAST_INSERT_ID()
  126. </selectKey>
  127. insert into push_message_callback
  128. <trim prefix="(" suffix=")" suffixOverrides=",">
  129. <if test="ghId != null">
  130. gh_id,
  131. </if>
  132. <if test="openId != null">
  133. open_id,
  134. </if>
  135. <if test="timestamp != null">
  136. timestamp,
  137. </if>
  138. <if test="msgType != null">
  139. msg_type,
  140. </if>
  141. <if test="videoId != null">
  142. video_id,
  143. </if>
  144. <if test="createTime != null">
  145. create_time,
  146. </if>
  147. </trim>
  148. <trim prefix="values (" suffix=")" suffixOverrides=",">
  149. <if test="ghId != null">
  150. #{ghId,jdbcType=VARCHAR},
  151. </if>
  152. <if test="openId != null">
  153. #{openId,jdbcType=VARCHAR},
  154. </if>
  155. <if test="timestamp != null">
  156. #{timestamp,jdbcType=BIGINT},
  157. </if>
  158. <if test="msgType != null">
  159. #{msgType,jdbcType=INTEGER},
  160. </if>
  161. <if test="videoId != null">
  162. #{videoId,jdbcType=BIGINT},
  163. </if>
  164. <if test="createTime != null">
  165. #{createTime,jdbcType=TIMESTAMP},
  166. </if>
  167. </trim>
  168. </insert>
  169. <select id="countByExample"
  170. parameterType="com.tzld.longarticle.recommend.server.repository.model.PushMessageCallbackExample"
  171. resultType="java.lang.Long">
  172. select count(*) from push_message_callback
  173. <if test="_parameter != null">
  174. <include refid="Example_Where_Clause"/>
  175. </if>
  176. </select>
  177. <update id="updateByExampleSelective" parameterType="map">
  178. update push_message_callback
  179. <set>
  180. <if test="row.id != null">
  181. id = #{row.id,jdbcType=BIGINT},
  182. </if>
  183. <if test="row.ghId != null">
  184. gh_id = #{row.ghId,jdbcType=VARCHAR},
  185. </if>
  186. <if test="row.openId != null">
  187. open_id = #{row.openId,jdbcType=VARCHAR},
  188. </if>
  189. <if test="row.timestamp != null">
  190. timestamp = #{row.timestamp,jdbcType=BIGINT},
  191. </if>
  192. <if test="row.msgType != null">
  193. msg_type = #{row.msgType,jdbcType=INTEGER},
  194. </if>
  195. <if test="row.videoId != null">
  196. video_id = #{row.videoId,jdbcType=BIGINT},
  197. </if>
  198. <if test="row.createTime != null">
  199. create_time = #{row.createTime,jdbcType=TIMESTAMP},
  200. </if>
  201. </set>
  202. <if test="example != null">
  203. <include refid="Update_By_Example_Where_Clause"/>
  204. </if>
  205. </update>
  206. <update id="updateByExample" parameterType="map">
  207. update push_message_callback
  208. set id = #{row.id,jdbcType=BIGINT},
  209. gh_id = #{row.ghId,jdbcType=VARCHAR},
  210. open_id = #{row.openId,jdbcType=VARCHAR},
  211. timestamp = #{row.timestamp,jdbcType=BIGINT},
  212. msg_type = #{row.msgType,jdbcType=INTEGER},
  213. video_id = #{row.videoId,jdbcType=BIGINT},
  214. create_time = #{row.createTime,jdbcType=TIMESTAMP}
  215. <if test="example != null">
  216. <include refid="Update_By_Example_Where_Clause"/>
  217. </if>
  218. </update>
  219. <update id="updateByPrimaryKeySelective"
  220. parameterType="com.tzld.longarticle.recommend.server.repository.model.PushMessageCallback">
  221. update push_message_callback
  222. <set>
  223. <if test="ghId != null">
  224. gh_id = #{ghId,jdbcType=VARCHAR},
  225. </if>
  226. <if test="openId != null">
  227. open_id = #{openId,jdbcType=VARCHAR},
  228. </if>
  229. <if test="timestamp != null">
  230. timestamp = #{timestamp,jdbcType=BIGINT},
  231. </if>
  232. <if test="msgType != null">
  233. msg_type = #{msgType,jdbcType=INTEGER},
  234. </if>
  235. <if test="videoId != null">
  236. video_id = #{videoId,jdbcType=BIGINT},
  237. </if>
  238. <if test="createTime != null">
  239. create_time = #{createTime,jdbcType=TIMESTAMP},
  240. </if>
  241. </set>
  242. where id = #{id,jdbcType=BIGINT}
  243. </update>
  244. <update id="updateByPrimaryKey"
  245. parameterType="com.tzld.longarticle.recommend.server.repository.model.PushMessageCallback">
  246. update push_message_callback
  247. set gh_id = #{ghId,jdbcType=VARCHAR},
  248. open_id = #{openId,jdbcType=VARCHAR},
  249. timestamp = #{timestamp,jdbcType=BIGINT},
  250. msg_type = #{msgType,jdbcType=INTEGER},
  251. video_id = #{videoId,jdbcType=BIGINT},
  252. create_time = #{createTime,jdbcType=TIMESTAMP}
  253. where id = #{id,jdbcType=BIGINT}
  254. </update>
  255. <insert id="insertList" parameterType="java.util.List">
  256. insert into push_message_callback
  257. (
  258. gh_id,
  259. open_id,
  260. timestamp,
  261. msg_type,
  262. video_id,
  263. create_time
  264. )
  265. values
  266. <foreach collection="list" item="item" separator=",">
  267. (
  268. #{item.ghId,jdbcType=VARCHAR},
  269. #{item.openId,jdbcType=VARCHAR},
  270. #{item.timestamp,jdbcType=BIGINT},
  271. #{item.msgType,jdbcType=INTEGER},
  272. #{item.videoId,jdbcType=BIGINT},
  273. #{item.createTime,jdbcType=TIMESTAMP}
  274. )
  275. </foreach>
  276. </insert>
  277. </mapper>