CgiReplyBucketDataMapper.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  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.CgiReplyBucketDataMapper">
  4. <resultMap id="BaseResultMap" type="com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="strategy" jdbcType="VARCHAR" property="strategy" />
  7. <result column="sort" jdbcType="INTEGER" property="sort" />
  8. <result column="strategy_dt" jdbcType="VARCHAR" property="strategyDt" />
  9. <result column="gh_id" jdbcType="VARCHAR" property="ghId" />
  10. <result column="msg_type" jdbcType="INTEGER" property="msgType" />
  11. <result column="title" jdbcType="VARCHAR" property="title" />
  12. <result column="cover_url" jdbcType="VARCHAR" property="coverUrl" />
  13. <result column="mini_app_id" jdbcType="VARCHAR" property="miniAppId" />
  14. <result column="mini_page_path" jdbcType="VARCHAR" property="miniPagePath" />
  15. <result column="mini_video_id" jdbcType="BIGINT" property="miniVideoId" />
  16. <result column="root_source_id" jdbcType="VARCHAR" property="rootSourceId" />
  17. <result column="page_path_url_id" jdbcType="BIGINT" property="pagePathUrlId" />
  18. <result column="news_publish_content_id" jdbcType="VARCHAR" property="newsPublishContentId" />
  19. <result column="plan_id" jdbcType="VARCHAR" property="planId" />
  20. <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
  21. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  22. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  23. </resultMap>
  24. <sql id="Example_Where_Clause">
  25. <where>
  26. <foreach collection="oredCriteria" item="criteria" separator="or">
  27. <if test="criteria.valid">
  28. <trim prefix="(" prefixOverrides="and" suffix=")">
  29. <foreach collection="criteria.criteria" item="criterion">
  30. <choose>
  31. <when test="criterion.noValue">
  32. and ${criterion.condition}
  33. </when>
  34. <when test="criterion.singleValue">
  35. and ${criterion.condition} #{criterion.value}
  36. </when>
  37. <when test="criterion.betweenValue">
  38. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  39. </when>
  40. <when test="criterion.listValue">
  41. and ${criterion.condition}
  42. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  43. #{listItem}
  44. </foreach>
  45. </when>
  46. </choose>
  47. </foreach>
  48. </trim>
  49. </if>
  50. </foreach>
  51. </where>
  52. </sql>
  53. <sql id="Update_By_Example_Where_Clause">
  54. <where>
  55. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  56. <if test="criteria.valid">
  57. <trim prefix="(" prefixOverrides="and" suffix=")">
  58. <foreach collection="criteria.criteria" item="criterion">
  59. <choose>
  60. <when test="criterion.noValue">
  61. and ${criterion.condition}
  62. </when>
  63. <when test="criterion.singleValue">
  64. and ${criterion.condition} #{criterion.value}
  65. </when>
  66. <when test="criterion.betweenValue">
  67. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  68. </when>
  69. <when test="criterion.listValue">
  70. and ${criterion.condition}
  71. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  72. #{listItem}
  73. </foreach>
  74. </when>
  75. </choose>
  76. </foreach>
  77. </trim>
  78. </if>
  79. </foreach>
  80. </where>
  81. </sql>
  82. <sql id="Base_Column_List">
  83. id, strategy, sort, strategy_dt, gh_id, msg_type, title, cover_url, mini_app_id,
  84. mini_page_path, mini_video_id, root_source_id, page_path_url_id, news_publish_content_id,
  85. plan_id, is_delete, create_time, update_time
  86. </sql>
  87. <select id="selectByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample" resultMap="BaseResultMap">
  88. select
  89. <if test="distinct">
  90. distinct
  91. </if>
  92. <include refid="Base_Column_List" />
  93. from cgi_reply_bucket_data
  94. <if test="_parameter != null">
  95. <include refid="Example_Where_Clause" />
  96. </if>
  97. <if test="orderByClause != null">
  98. order by ${orderByClause}
  99. </if>
  100. <if test="page != null">
  101. limit #{page.offset} , #{page.pageSize}
  102. </if>
  103. </select>
  104. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  105. select
  106. <include refid="Base_Column_List" />
  107. from cgi_reply_bucket_data
  108. where id = #{id,jdbcType=BIGINT}
  109. </select>
  110. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  111. delete from cgi_reply_bucket_data
  112. where id = #{id,jdbcType=BIGINT}
  113. </delete>
  114. <delete id="deleteByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample">
  115. delete from cgi_reply_bucket_data
  116. <if test="_parameter != null">
  117. <include refid="Example_Where_Clause" />
  118. </if>
  119. </delete>
  120. <insert id="insert" parameterType="com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData">
  121. insert into cgi_reply_bucket_data (id, strategy, sort,
  122. strategy_dt, gh_id, msg_type,
  123. title, cover_url, mini_app_id,
  124. mini_page_path, mini_video_id, root_source_id,
  125. page_path_url_id, news_publish_content_id, plan_id,
  126. is_delete, create_time, update_time
  127. )
  128. values (#{id,jdbcType=BIGINT}, #{strategy,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER},
  129. #{strategyDt,jdbcType=VARCHAR}, #{ghId,jdbcType=VARCHAR}, #{msgType,jdbcType=INTEGER},
  130. #{title,jdbcType=VARCHAR}, #{coverUrl,jdbcType=VARCHAR}, #{miniAppId,jdbcType=VARCHAR},
  131. #{miniPagePath,jdbcType=VARCHAR}, #{miniVideoId,jdbcType=BIGINT}, #{rootSourceId,jdbcType=VARCHAR},
  132. #{pagePathUrlId,jdbcType=BIGINT}, #{newsPublishContentId,jdbcType=VARCHAR}, #{planId,jdbcType=VARCHAR},
  133. #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
  134. )
  135. </insert>
  136. <insert id="insertSelective" parameterType="com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData">
  137. <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
  138. SELECT LAST_INSERT_ID()
  139. </selectKey>
  140. insert into cgi_reply_bucket_data
  141. <trim prefix="(" suffix=")" suffixOverrides=",">
  142. <if test="id != null">
  143. id,
  144. </if>
  145. <if test="strategy != null">
  146. strategy,
  147. </if>
  148. <if test="sort != null">
  149. sort,
  150. </if>
  151. <if test="strategyDt != null">
  152. strategy_dt,
  153. </if>
  154. <if test="ghId != null">
  155. gh_id,
  156. </if>
  157. <if test="msgType != null">
  158. msg_type,
  159. </if>
  160. <if test="title != null">
  161. title,
  162. </if>
  163. <if test="coverUrl != null">
  164. cover_url,
  165. </if>
  166. <if test="miniAppId != null">
  167. mini_app_id,
  168. </if>
  169. <if test="miniPagePath != null">
  170. mini_page_path,
  171. </if>
  172. <if test="miniVideoId != null">
  173. mini_video_id,
  174. </if>
  175. <if test="rootSourceId != null">
  176. root_source_id,
  177. </if>
  178. <if test="pagePathUrlId != null">
  179. page_path_url_id,
  180. </if>
  181. <if test="newsPublishContentId != null">
  182. news_publish_content_id,
  183. </if>
  184. <if test="planId != null">
  185. plan_id,
  186. </if>
  187. <if test="isDelete != null">
  188. is_delete,
  189. </if>
  190. <if test="createTime != null">
  191. create_time,
  192. </if>
  193. <if test="updateTime != null">
  194. update_time,
  195. </if>
  196. </trim>
  197. <trim prefix="values (" suffix=")" suffixOverrides=",">
  198. <if test="id != null">
  199. #{id,jdbcType=BIGINT},
  200. </if>
  201. <if test="strategy != null">
  202. #{strategy,jdbcType=VARCHAR},
  203. </if>
  204. <if test="sort != null">
  205. #{sort,jdbcType=INTEGER},
  206. </if>
  207. <if test="strategyDt != null">
  208. #{strategyDt,jdbcType=VARCHAR},
  209. </if>
  210. <if test="ghId != null">
  211. #{ghId,jdbcType=VARCHAR},
  212. </if>
  213. <if test="msgType != null">
  214. #{msgType,jdbcType=INTEGER},
  215. </if>
  216. <if test="title != null">
  217. #{title,jdbcType=VARCHAR},
  218. </if>
  219. <if test="coverUrl != null">
  220. #{coverUrl,jdbcType=VARCHAR},
  221. </if>
  222. <if test="miniAppId != null">
  223. #{miniAppId,jdbcType=VARCHAR},
  224. </if>
  225. <if test="miniPagePath != null">
  226. #{miniPagePath,jdbcType=VARCHAR},
  227. </if>
  228. <if test="miniVideoId != null">
  229. #{miniVideoId,jdbcType=BIGINT},
  230. </if>
  231. <if test="rootSourceId != null">
  232. #{rootSourceId,jdbcType=VARCHAR},
  233. </if>
  234. <if test="pagePathUrlId != null">
  235. #{pagePathUrlId,jdbcType=BIGINT},
  236. </if>
  237. <if test="newsPublishContentId != null">
  238. #{newsPublishContentId,jdbcType=VARCHAR},
  239. </if>
  240. <if test="planId != null">
  241. #{planId,jdbcType=VARCHAR},
  242. </if>
  243. <if test="isDelete != null">
  244. #{isDelete,jdbcType=INTEGER},
  245. </if>
  246. <if test="createTime != null">
  247. #{createTime,jdbcType=TIMESTAMP},
  248. </if>
  249. <if test="updateTime != null">
  250. #{updateTime,jdbcType=TIMESTAMP},
  251. </if>
  252. </trim>
  253. </insert>
  254. <select id="countByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample" resultType="java.lang.Long">
  255. select count(*) from cgi_reply_bucket_data
  256. <if test="_parameter != null">
  257. <include refid="Example_Where_Clause" />
  258. </if>
  259. </select>
  260. <update id="updateByExampleSelective" parameterType="map">
  261. update cgi_reply_bucket_data
  262. <set>
  263. <if test="record.id != null">
  264. id = #{record.id,jdbcType=BIGINT},
  265. </if>
  266. <if test="record.strategy != null">
  267. strategy = #{record.strategy,jdbcType=VARCHAR},
  268. </if>
  269. <if test="record.sort != null">
  270. sort = #{record.sort,jdbcType=INTEGER},
  271. </if>
  272. <if test="record.strategyDt != null">
  273. strategy_dt = #{record.strategyDt,jdbcType=VARCHAR},
  274. </if>
  275. <if test="record.ghId != null">
  276. gh_id = #{record.ghId,jdbcType=VARCHAR},
  277. </if>
  278. <if test="record.msgType != null">
  279. msg_type = #{record.msgType,jdbcType=INTEGER},
  280. </if>
  281. <if test="record.title != null">
  282. title = #{record.title,jdbcType=VARCHAR},
  283. </if>
  284. <if test="record.coverUrl != null">
  285. cover_url = #{record.coverUrl,jdbcType=VARCHAR},
  286. </if>
  287. <if test="record.miniAppId != null">
  288. mini_app_id = #{record.miniAppId,jdbcType=VARCHAR},
  289. </if>
  290. <if test="record.miniPagePath != null">
  291. mini_page_path = #{record.miniPagePath,jdbcType=VARCHAR},
  292. </if>
  293. <if test="record.miniVideoId != null">
  294. mini_video_id = #{record.miniVideoId,jdbcType=BIGINT},
  295. </if>
  296. <if test="record.rootSourceId != null">
  297. root_source_id = #{record.rootSourceId,jdbcType=VARCHAR},
  298. </if>
  299. <if test="record.pagePathUrlId != null">
  300. page_path_url_id = #{record.pagePathUrlId,jdbcType=BIGINT},
  301. </if>
  302. <if test="record.newsPublishContentId != null">
  303. news_publish_content_id = #{record.newsPublishContentId,jdbcType=VARCHAR},
  304. </if>
  305. <if test="record.planId != null">
  306. plan_id = #{record.planId,jdbcType=VARCHAR},
  307. </if>
  308. <if test="record.isDelete != null">
  309. is_delete = #{record.isDelete,jdbcType=INTEGER},
  310. </if>
  311. <if test="record.createTime != null">
  312. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  313. </if>
  314. <if test="record.updateTime != null">
  315. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  316. </if>
  317. </set>
  318. <if test="_parameter != null">
  319. <include refid="Update_By_Example_Where_Clause" />
  320. </if>
  321. </update>
  322. <update id="updateByExample" parameterType="map">
  323. update cgi_reply_bucket_data
  324. set id = #{record.id,jdbcType=BIGINT},
  325. strategy = #{record.strategy,jdbcType=VARCHAR},
  326. sort = #{record.sort,jdbcType=INTEGER},
  327. strategy_dt = #{record.strategyDt,jdbcType=VARCHAR},
  328. gh_id = #{record.ghId,jdbcType=VARCHAR},
  329. msg_type = #{record.msgType,jdbcType=INTEGER},
  330. title = #{record.title,jdbcType=VARCHAR},
  331. cover_url = #{record.coverUrl,jdbcType=VARCHAR},
  332. mini_app_id = #{record.miniAppId,jdbcType=VARCHAR},
  333. mini_page_path = #{record.miniPagePath,jdbcType=VARCHAR},
  334. mini_video_id = #{record.miniVideoId,jdbcType=BIGINT},
  335. root_source_id = #{record.rootSourceId,jdbcType=VARCHAR},
  336. page_path_url_id = #{record.pagePathUrlId,jdbcType=BIGINT},
  337. news_publish_content_id = #{record.newsPublishContentId,jdbcType=VARCHAR},
  338. plan_id = #{record.planId,jdbcType=VARCHAR},
  339. is_delete = #{record.isDelete,jdbcType=INTEGER},
  340. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  341. update_time = #{record.updateTime,jdbcType=TIMESTAMP}
  342. <if test="_parameter != null">
  343. <include refid="Update_By_Example_Where_Clause" />
  344. </if>
  345. </update>
  346. <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData">
  347. update cgi_reply_bucket_data
  348. <set>
  349. <if test="strategy != null">
  350. strategy = #{strategy,jdbcType=VARCHAR},
  351. </if>
  352. <if test="sort != null">
  353. sort = #{sort,jdbcType=INTEGER},
  354. </if>
  355. <if test="strategyDt != null">
  356. strategy_dt = #{strategyDt,jdbcType=VARCHAR},
  357. </if>
  358. <if test="ghId != null">
  359. gh_id = #{ghId,jdbcType=VARCHAR},
  360. </if>
  361. <if test="msgType != null">
  362. msg_type = #{msgType,jdbcType=INTEGER},
  363. </if>
  364. <if test="title != null">
  365. title = #{title,jdbcType=VARCHAR},
  366. </if>
  367. <if test="coverUrl != null">
  368. cover_url = #{coverUrl,jdbcType=VARCHAR},
  369. </if>
  370. <if test="miniAppId != null">
  371. mini_app_id = #{miniAppId,jdbcType=VARCHAR},
  372. </if>
  373. <if test="miniPagePath != null">
  374. mini_page_path = #{miniPagePath,jdbcType=VARCHAR},
  375. </if>
  376. <if test="miniVideoId != null">
  377. mini_video_id = #{miniVideoId,jdbcType=BIGINT},
  378. </if>
  379. <if test="rootSourceId != null">
  380. root_source_id = #{rootSourceId,jdbcType=VARCHAR},
  381. </if>
  382. <if test="pagePathUrlId != null">
  383. page_path_url_id = #{pagePathUrlId,jdbcType=BIGINT},
  384. </if>
  385. <if test="newsPublishContentId != null">
  386. news_publish_content_id = #{newsPublishContentId,jdbcType=VARCHAR},
  387. </if>
  388. <if test="planId != null">
  389. plan_id = #{planId,jdbcType=VARCHAR},
  390. </if>
  391. <if test="isDelete != null">
  392. is_delete = #{isDelete,jdbcType=INTEGER},
  393. </if>
  394. <if test="createTime != null">
  395. create_time = #{createTime,jdbcType=TIMESTAMP},
  396. </if>
  397. <if test="updateTime != null">
  398. update_time = #{updateTime,jdbcType=TIMESTAMP},
  399. </if>
  400. </set>
  401. where id = #{id,jdbcType=BIGINT}
  402. </update>
  403. <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData">
  404. update cgi_reply_bucket_data
  405. set strategy = #{strategy,jdbcType=VARCHAR},
  406. sort = #{sort,jdbcType=INTEGER},
  407. strategy_dt = #{strategyDt,jdbcType=VARCHAR},
  408. gh_id = #{ghId,jdbcType=VARCHAR},
  409. msg_type = #{msgType,jdbcType=INTEGER},
  410. title = #{title,jdbcType=VARCHAR},
  411. cover_url = #{coverUrl,jdbcType=VARCHAR},
  412. mini_app_id = #{miniAppId,jdbcType=VARCHAR},
  413. mini_page_path = #{miniPagePath,jdbcType=VARCHAR},
  414. mini_video_id = #{miniVideoId,jdbcType=BIGINT},
  415. root_source_id = #{rootSourceId,jdbcType=VARCHAR},
  416. page_path_url_id = #{pagePathUrlId,jdbcType=BIGINT},
  417. news_publish_content_id = #{newsPublishContentId,jdbcType=VARCHAR},
  418. plan_id = #{planId,jdbcType=VARCHAR},
  419. is_delete = #{isDelete,jdbcType=INTEGER},
  420. create_time = #{createTime,jdbcType=TIMESTAMP},
  421. update_time = #{updateTime,jdbcType=TIMESTAMP}
  422. where id = #{id,jdbcType=BIGINT}
  423. </update>
  424. <select id="selectVideoId" resultType="java.lang.Long">
  425. select distinct mini_video_id
  426. from cgi_reply_bucket_data
  427. where is_delete = 0 and create_time > #{createTime,jdbcType=TIMESTAMP};
  428. </select>
  429. </mapper>