LongArticleBaseMapper.xml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  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.longArticle.LongArticleBaseMapper">
  4. <delete id="deleteByDateStrGreaterThanEqual">
  5. delete from datastat_sort_strategy where date_str >= #{dateStr}
  6. </delete>
  7. <delete id="deleteByDateStrBetween">
  8. delete from datastat_sort_strategy where date_str between #{dateStrBegin} and #{dateStrEnd} and type = #{type}
  9. </delete>
  10. <select id="countGetOffVideos" resultType="java.lang.Long">
  11. select count(1) from get_off_videos limit #{offset}, #{pageSize}
  12. </select>
  13. <insert id="batchInsertDatastatSortStrategy">
  14. INSERT INTO datastat_sort_strategy
  15. (date_str, publish_time, account_mode, account_source, account_type, account_status, bussiness_type,
  16. account_name, strategy, fans, view_count, avg_view_count, first_view_count, first_avg_view_count,
  17. first_level, fission0, fission0_head, fission0_recommend, fission1, fission1_head, fission1_recommend, fission2,
  18. fission2_head, fission2_recommend, second_first_level, second_fission0, second_fission0_head,
  19. second_fission0_recommend, second_fission1, second_fission1_head, second_fission1_recommend,
  20. second_fission2, second_fission2_head, second_fission2_recommend, third_first_level, third_fission0,
  21. third_fission0_head, third_fission0_recommend, third_fission1, third_fission1_head, third_fission1_recommend,
  22. third_fission2,third_fission2_head, third_fission2_recommend,
  23. read_rate, read_fans_rate, first_read_rate, fission0_first_rate, fission0_head_first_rate, fission0_recommend_first_rate, fission1_fission0_rate,
  24. fission0_read_avg_rate, his_read_rate, his_first_read_rate, his_fission0_first_rate, position, gh_id, title,
  25. link, wx_sn, fission0_read_avg_100_rate, fission0_read_avg_500_rate, fission0_read_avg_1000_rate,
  26. crawler_plan_name, crawler_plan_tag, produce_plan_name, produce_plan_tag, publish_plan_name,
  27. publish_mini_program_insert_strategy, publish_mini_program_insert_use_type, publish_mini_program_num,
  28. source_produce_plan_name, account_create_timestamp, publish_timestamp, type, source_type, source_id)
  29. VALUES
  30. <foreach collection="list" item="item" separator=",">
  31. (#{item.dateStr}, #{item.publishTime}, #{item.accountMode}, #{item.accountSource}, #{item.accountType},
  32. #{item.accountStatus}, #{item.businessType}, #{item.accountName}, #{item.strategy}, #{item.fans},
  33. #{item.viewCount}, #{item.avgViewCount}, #{item.firstViewCount}, #{item.firstAvgViewCount},
  34. #{item.firstLevel}, #{item.fission0},#{item.fission0Head},#{item.fission0Recommend}, #{item.fission1},
  35. #{item.fission1Head},#{item.fission1Recommend}, #{item.fission2},#{item.fission2Head},
  36. #{item.fission2Recommend}, #{item.secondFirstLevel}, #{item.secondFission0},
  37. #{item.secondFission0Head}, #{item.secondFission0Recommend}, #{item.secondFission1},
  38. #{item.secondFission1Head}, #{item.secondFission1Recommend}, #{item.secondFission2},
  39. #{item.secondFission2Head}, #{item.secondFission2Recommend}, #{item.thirdFirstLevel},
  40. #{item.thirdFission0}, #{item.thirdFission0Head}, #{item.thirdFission0Recommend},
  41. #{item.thirdFission1}, #{item.thirdFission1Head}, #{item.thirdFission1Recommend},
  42. #{item.thirdFission2}, #{item.thirdFission2Head}, #{item.thirdFission2Recommend}, #{item.readRate},
  43. #{item.readFansRate}, #{item.firstReadRate}, #{item.fission0FirstRate}, #{item.fission0HeadFirstRate},
  44. #{item.fission0RecommendFirstRate}, #{item.fission1Fission0Rate},
  45. #{item.fission0ReadAvgRate}, #{item.hisReadRate}, #{item.hisFirstReadRate}, #{item.hisFission0FirstRate},
  46. #{item.position}, #{item.ghId}, #{item.title}, #{item.link},
  47. #{item.wxSn}, #{item.fission0ReadAvg100Rate}, #{item.fission0ReadAvg500Rate},
  48. #{item.fission0ReadAvg1000Rate}, #{item.crawlerPlanName}, #{item.crawlerPlanTag},
  49. #{item.producePlanName}, #{item.producePlanTag}, #{item.publishPlanName},
  50. #{item.publishMiniProgramInsertStrategy}, #{item.publishMiniProgramInsertUseType},
  51. #{item.publishMiniProgramNum}, #{item.sourceProducePlanName}, #{item.accountCreateTimestamp},
  52. #{item.publishTimestamp}, #{item.type}, #{item.sourceType}, #{item.sourceId})
  53. </foreach>
  54. </insert>
  55. <insert id="batchInsertArticlePoolPromotionSource">
  56. insert into article_pool_promotion_source
  57. (channel_content_id, source_publish_content_id, root_publish_content_id, root_produce_content_id, title,
  58. title_md5, level, status, deleted, create_timestamp, update_timestamp)
  59. values
  60. <foreach collection="list" item="item" separator=",">
  61. (#{item.channelContentId}, #{item.sourcePublishContentId}, #{item.rootPublishContentId},
  62. #{item.rootProduceContentId}, #{item.title}, #{item.titleMd5}, #{item.level}, #{item.status},
  63. #{item.deleted}, #{item.createTimestamp}, #{item.updateTimestamp})
  64. </foreach>
  65. </insert>
  66. <update id="updateRootProduceContentLevel">
  67. update article_pool_promotion_source set level = #{level} where root_produce_content_id = #{rootProduceContentId}
  68. </update>
  69. <delete id="deleteDatastatScoreByDtIn">
  70. delete from datastat_score where dt in
  71. <foreach collection="dateStrList" item="item" open="(" close=")" separator=",">
  72. #{item}
  73. </foreach>
  74. </delete>
  75. <insert id="batchInsertDatastatScore">
  76. INSERT INTO datastat_score
  77. (dt, gh_id, account_name, `index`, title, strategy, score, similarity, view_count_rate,
  78. his_fission_avg_read_rate_rate, his_fission_avg_read_sum_rate, his_fission_de_weight_avg_read_sum_rate,
  79. read_count, read_avg, read_avg_rate, category, category_score, first_pub_interval, publish_content_id,
  80. crawler_channel_content_id, source_id, publish_timestamp)
  81. VALUES
  82. <foreach collection="list" item="item" separator=",">
  83. (#{item.dt}, #{item.ghId}, #{item.accountName}, #{item.index}, #{item.title}, #{item.strategy},
  84. #{item.score}, #{item.similarity}, #{item.viewCountRate}, #{item.hisFissionAvgReadRateRate},
  85. #{item.hisFissionAvgReadSumRate}, #{item.hisFissionDeWeightAvgReadSumRate}, #{item.readCount},
  86. #{item.readAvg}, #{item.readAvgRate}, #{item.category}, #{item.categoryScore}, #{item.firstPubInterval},
  87. #{item.publishContentId}, #{item.crawlerChannelContentId}, #{item.sourceId}, #{item.publishTimestamp})
  88. </foreach>
  89. </insert>
  90. <select id="getArticlePromotion"
  91. resultType="com.tzld.longarticle.recommend.server.model.entity.longArticle.DatastatSortStrategy">
  92. select *
  93. from datastat_sort_strategy
  94. where view_count >= #{viewCount}
  95. and type = 9
  96. and read_rate >= #{viewCountRate}
  97. and fans > #{fans}
  98. and date_str > #{dateStr}
  99. and position in
  100. <foreach collection="positions" item="item" open="(" close=")" separator=",">
  101. #{item}
  102. </foreach>
  103. </select>
  104. <select id="getArticlePromotionCandidates"
  105. resultType="com.tzld.longarticle.recommend.server.model.entity.longArticle.DatastatSortStrategy">
  106. select *
  107. from datastat_sort_strategy
  108. where type = 9
  109. and fans > #{fans}
  110. and date_str > #{dateStr}
  111. and position in
  112. <foreach collection="positions" item="item" open="(" close=")" separator=",">
  113. #{item}
  114. </foreach>
  115. </select>
  116. <insert id="batchInsertLongArticlesRootSourceId">
  117. INSERT INTO long_articles_root_source_id (root_source_id, account_name, gh_id, article_title, request_time,
  118. trace_id, push_type, video_id)
  119. VALUES
  120. <foreach collection="list" item="item" index="index" separator=",">
  121. (#{item.rootSourceId}, #{item.accountName}, #{item.ghId}, #{item.articleTitle}, #{item.requestTime},
  122. #{item.traceId}, #{item.pushType}, #{item.videoId})
  123. </foreach>
  124. </insert>
  125. <select id="getGetOffVideos" resultType="com.tzld.longarticle.recommend.server.model.dto.GetOffVideos">
  126. select * from get_off_videos where video_id in
  127. <foreach collection="videoIds" item="item" open="(" close=")" separator=",">
  128. #{item}
  129. </foreach>
  130. </select>
  131. <insert id="batchInsertGetOffVideos">
  132. INSERT INTO get_off_videos (video_id, publish_time, video_status, trace_id, get_off_time, check_status)
  133. VALUES
  134. <foreach collection="list" item="item" separator=",">
  135. (#{item.videoId}, #{item.publishTime}, #{item.videoStatus}, #{item.traceId}, #{item.getOffTime}, #{item.checkStatus})
  136. </foreach>
  137. </insert>
  138. <insert id="batchInsertLongArticlesCrawlerVideos" parameterType="list">
  139. INSERT INTO long_articles_crawler_videos (content_id, out_video_id, platform, video_title, play_count,
  140. like_count, share_count, publish_time, crawler_time, duration,
  141. video_url, cover_url, download_status, video_oss_path, cover_oss_path,
  142. user_id, trace_id, score)
  143. VALUES
  144. <foreach collection="list" item="item" separator=",">
  145. (#{item.contentId}, #{item.outVideoId}, #{item.platform}, #{item.videoTitle}, #{item.playCount},
  146. #{item.likeCount}, #{item.shareCount}, #{item.publishTime}, #{item.crawlerTime}, #{item.duration},
  147. #{item.videoUrl}, #{item.coverUrl}, #{item.downloadStatus}, #{item.videoOssPath}, #{item.coverOssPath},
  148. #{item.userId}, #{item.traceId}, #{item.score})
  149. </foreach>
  150. </insert>
  151. <insert id="batchInsertLongArticlesText" parameterType="list">
  152. INSERT INTO long_articles_text (content_id, article_title, article_text, kimi_title, kimi_summary,
  153. kimi_keys, kimi_status)
  154. VALUES
  155. <foreach collection="list" item="item" separator=",">
  156. (#{item.contentId}, #{item.articleTitle}, #{item.articleText}, #{item.kimiTitle}, #{item.kimiSummary},
  157. #{item.kimiKeys}, #{item.kimiStatus})
  158. </foreach>
  159. </insert>
  160. <select id="getLongArticlesTextByContentIds" resultType="java.lang.String">
  161. select content_id from long_articles_text where content_id in
  162. <foreach collection="contentIds" item="item" open="(" close=")" separator=",">
  163. #{item}
  164. </foreach>
  165. </select>
  166. <select id="getNeedUpdateRecords"
  167. resultType="com.tzld.longarticle.recommend.server.model.entity.longArticle.LongArticlesText">
  168. select * from long_articles_text where kimi_title is null
  169. </select>
  170. <select id="getLongArticlesRootSourceId"
  171. resultType="com.tzld.longarticle.recommend.server.model.entity.longArticle.LongArticlesRootSourceId">
  172. select * from long_articles_root_source_id where root_source_id in
  173. <foreach collection="rootSourceIdList" item="item" open="(" close=")" separator=",">
  174. #{item}
  175. </foreach>
  176. </select>
  177. <update id="updateLongArticlesText">
  178. update long_articles_text
  179. set kimi_title = #{kimiTitle},
  180. kimi_summary = #{kimiSummary},
  181. kimi_keys = #{kimiKeys}
  182. where content_id = #{contentId}
  183. </update>
  184. <update id="updateLongArticleMatchVideosResponse">
  185. update long_articles_match_videos
  186. set response = #{response}
  187. where trace_id = #{traceId}
  188. </update>
  189. <select id="getLongArticlesMatchVideos"
  190. resultType="com.tzld.longarticle.recommend.server.model.dto.LongArticlesMatchVideos">
  191. select * from long_articles_match_videos where trace_id in
  192. <foreach collection="traceIds" item="item" open="(" close=")" separator=",">
  193. #{item}
  194. </foreach>
  195. </select>
  196. <select id="getLongArticlesCrawlerVideos"
  197. resultType="com.tzld.longarticle.recommend.server.model.dto.LongArticlesCrawlerVideos">
  198. select * from long_articles_crawler_videos where content_id in
  199. <foreach collection="contentIds" item="item" open="(" close=")" separator=",">
  200. #{item}
  201. </foreach>
  202. and download_status = 2
  203. </select>
  204. <select id="getNeedMatchVideos"
  205. resultType="com.tzld.longarticle.recommend.server.model.dto.LongArticlesMatchVideos">
  206. select * from long_articles_match_videos where flow_pool_level is null and id > #{id} order by id limit #{pageSize}
  207. </select>
  208. <select id="countNeedMatchVideos" resultType="java.lang.Integer">
  209. select count(1) from long_articles_match_videos where id > 3962393 and flow_pool_level is null
  210. </select>
  211. <insert id="batchInsertLongArticlesMatchVideos" parameterType="list">
  212. INSERT INTO long_articles_match_videos (trace_id, content_id, flow_pool_level, gh_id, account_name,
  213. content_status, success_status, request_timestamp, response,
  214. process_times)
  215. VALUES
  216. <foreach collection="list" item="item" separator=",">
  217. (#{item.traceId}, #{item.contentId}, #{item.flowPoolLevel}, #{item.ghId}, #{item.accountName},
  218. #{item.contentStatus}, #{item.successStatus}, #{item.requestTimestamp}, #{item.response},
  219. #{item.processTimes})
  220. </foreach>
  221. </insert>
  222. <select id="getPublishSingleVideoSource"
  223. resultType="com.tzld.longarticle.recommend.server.model.entity.longArticle.PublishSingleVideoSource">
  224. select content_trace_id, article_title, cover_url, flow_pool_level
  225. from publish_single_video_source
  226. where bad_status = 0 and audit_status = 1 and status = 2
  227. <if test="flowPoolLevel!= null ">
  228. and flow_pool_level = #{flowPoolLevel}
  229. </if>
  230. </select>
  231. <select id="getFilterColdLongArticleTitle" resultType="java.lang.String">
  232. select title from cold_start_title_pool where status in (-1, 1)
  233. </select>
  234. <insert id="batchInsertArticleTitleHisCache">
  235. insert into article_title_his_cache
  236. (source_id, type, title, title_md5, kimi_safe_score, channel_content_id, root_publish_timestamp, crawler_title,
  237. category, his_publish_article_list, create_timestamp, plan_id)
  238. values
  239. <foreach collection="list" item="item" separator=",">
  240. (#{item.sourceId}, #{item.type}, #{item.title}, #{item.titleMd5}, #{item.kimiSafeScore},
  241. #{item.channelContentId}, #{item.rootPublishTimestamp}, #{item.crawlerTitle}, #{item.category},
  242. #{item.hisPublishArticleList}, #{item.createTimestamp}, #{item.planId})
  243. </foreach>
  244. </insert>
  245. <select id="getExistsOssPath" resultType="java.lang.String">
  246. select distinct oss_path from long_articles_video_audit where type = #{type}
  247. </select>
  248. <select id="getExistsVideoId" resultType="java.lang.Long">
  249. select video_id from long_articles_video_audit where type = #{type} and create_timestamp > #{todayStart}
  250. </select>
  251. <update id="updateVideoPoolContentBad">
  252. update publish_single_video_source set bad_status = 1 where content_trace_id = #{contentTraceId};
  253. </update>
  254. <insert id="batchInsertArticleReMatchRecord">
  255. insert into article_re_match_record
  256. (trace_id, content_id, oss_path, status, old_response, create_timestamp)
  257. values
  258. <foreach collection="list" item="item" separator=",">
  259. (#{item.traceId}, #{item.contentId}, #{item.ossPath}, #{item.status}, #{item.oldResponse},
  260. #{item.createTimestamp})
  261. </foreach>
  262. </insert>
  263. <select id="getDisAuditDeleteGhid" resultType="java.lang.String">
  264. select distinct gh_id from long_article_audit_delete where create_timestamp > 1736157600000 and status = 2 and fail_reason like 'reach max api daily quota%'
  265. </select>
  266. <select id="countMatchSuccessCount" resultType="java.lang.Long">
  267. select count(content_id)
  268. from long_articles_text
  269. where start_processing_time between #{start} and #{end} and result_status = 1
  270. </select>
  271. <select id="getMatchSuccessContentId" resultType="java.lang.String">
  272. select content_id
  273. from long_articles_text
  274. where start_processing_time between #{start} and #{end} and result_status = 1
  275. </select>
  276. <select id="countMatchCount" resultType="java.lang.Long">
  277. select count(content_id)
  278. from long_articles_text
  279. where start_processing_time between #{start} and #{end}
  280. </select>
  281. <select id="getMatchContentId" resultType="java.lang.String">
  282. select content_id
  283. from long_articles_text
  284. where start_processing_time between #{start} and #{end}
  285. </select>
  286. <select id="getPassContentIds" resultType="java.lang.String">
  287. select content_id from long_articles_title_audit where status = 1 limit 100
  288. </select>
  289. <insert id="batchInsertLongArticleAuditDelete">
  290. insert into long_article_audit_delete
  291. (gh_id, msg_id, `index`, push_id, push_type, publish_content_id, status, delete_reason, create_timestamp)
  292. values
  293. <foreach collection="list" item="item" separator=",">
  294. (#{item.ghId}, #{item.msgId}, #{item.index}, #{item.pushId}, #{item.pushType}, #{item.publishContentId},
  295. #{item.status}, #{item.deleteReason}, #{item.createTimestamp})
  296. </foreach>
  297. </insert>
  298. <select id="getTopContent"
  299. resultType="com.tzld.longarticle.recommend.server.model.entity.longArticle.DatastatSortStrategy">
  300. select dss.*
  301. from datastat_sort_strategy dss
  302. join (select title, max(read_rate) as read_rate
  303. from datastat_sort_strategy
  304. where date_str &lt; #{dateStr}
  305. and type = 9
  306. and read_rate > 1
  307. and view_count > 10000
  308. and position in (1, 2)
  309. and title not in (select title from article_unsafe_title where status = 1)
  310. and first_level is not null
  311. and strategy is not null
  312. GROUP BY title) top on dss.title = top.title and dss.read_rate = top.read_rate
  313. </select>
  314. <select id="getVideoEndScreenTransformationTask"
  315. resultType="com.tzld.longarticle.recommend.server.model.entity.longArticle.VideoEndScreenTransformationTask">
  316. select * from video_end_screen_transformation_task where video_origin_id = #{videoOriginId}
  317. </select>
  318. <insert id="saveVideoEndScreenTransformationTask">
  319. insert into video_end_screen_transformation_task
  320. (video_origin_id, title, oss_path)
  321. values
  322. (#{videoOriginId}, #{title}, #{ossPath})
  323. </insert>
  324. <select id="getAccountDailyVideoAuditCount"
  325. resultType="com.tzld.longarticle.recommend.server.model.vo.DailyAuditProduceExport">
  326. select audit.audit_account as name, audit.cnt as auditCount, auditPass.cnt as auditPassCount,
  327. videoAudit.cnt as videoAuditCount, videoAuditPass.cnt as videoAuditPassCount
  328. from (select audit_account, count(1) as cnt
  329. from long_articles_title_audit
  330. where audit_timestamp between #{startTimeStamp} and #{endTimeStamp}
  331. group by audit_account) audit
  332. left join (select audit_account, count(1) as cnt
  333. from long_articles_title_audit
  334. where audit_timestamp between #{startTimeStamp} and #{endTimeStamp}
  335. and status = 1
  336. group by audit_account) auditPass
  337. on audit.audit_account = auditPass.audit_account
  338. left join (select audit_account, count(1) as cnt
  339. from long_articles_crawler_videos
  340. where audit_timestamp between #{startTimeStamp} and #{endTimeStamp}
  341. group by audit_account) videoAudit
  342. on audit.audit_account = videoAudit.audit_account
  343. left join (select audit_account, count(1) as cnt
  344. from long_articles_crawler_videos
  345. where audit_timestamp between #{startTimeStamp} and #{endTimeStamp}
  346. and status = 1
  347. group by audit_account) videoAuditPass
  348. on audit.audit_account = videoAuditPass.audit_account
  349. </select>
  350. <select id="getCategoryMatchCount"
  351. resultType="com.tzld.longarticle.recommend.server.model.vo.CategoryGroupFunnelExport">
  352. select success.category, success.cnt as matchSuccessCount, total.cnt as matchCount
  353. from (select ac.category, count(1) as cnt
  354. from long_articles_text lat
  355. join article_category ac on lat.content_id = ac.produce_content_id
  356. where lat.start_processing_time between #{start} and #{end}
  357. and lat.result_status = 1
  358. group by ac.category) success
  359. left join (select ac.category, count(1) as cnt
  360. from long_articles_text lat
  361. join article_category ac on lat.content_id = ac.produce_content_id
  362. where lat.start_processing_time between #{start} and #{end}
  363. and lat.result_status in (1, 2)
  364. group by ac.category) total on total.category = success.category
  365. </select>
  366. <select id="getCategoryTitleAuditCount"
  367. resultType="com.tzld.longarticle.recommend.server.model.vo.CategoryGroupFunnelExport">
  368. select success.category, success.cnt as videoAuditPassCount, total.cnt as videoAuditCount
  369. from (select ac.category, count(1) as cnt
  370. from long_articles_title_audit lata
  371. join article_category ac on lata.content_id = ac.produce_content_id
  372. where lata.audit_timestamp between #{start} and #{end}
  373. and lata.`status` = 1
  374. group by ac.category) success
  375. left join (select ac.category, count(1) as cnt
  376. from long_articles_title_audit lata
  377. join article_category ac on lata.content_id = ac.produce_content_id
  378. where lata.audit_timestamp between #{start} and #{end}
  379. and lata.`status` in (1, 2)
  380. group by ac.category) total on total.category = success.category
  381. </select>
  382. <insert id="batchInsertPublishContentGzhWaiting">
  383. insert into publish_content_gzh_waiting
  384. (id, plan_id, publish_account_id, source_type, source_id, title, create_timestamp, content_pool_type,
  385. crawler_channel_content_id, crawler_link, crawler_title, crawler_view_count, crawler_timestamp, status,
  386. update_timestamp)
  387. values
  388. <foreach collection="list" item="item" separator=",">
  389. (#{item.id}, #{item.planId}, #{item.publishAccountId}, #{item.sourceType}, #{item.sourceId}, #{item.title},
  390. #{item.createTimestamp}, #{item.contentPoolType}, #{item.crawlerChannelContentId}, #{item.crawlerLink},
  391. #{item.crawlerTitle}, #{item.crawlerViewCount}, #{item.crawlerTimestamp}, #{item.status}, #{item.updateTimestamp})
  392. </foreach>
  393. </insert>
  394. <update id="updatePublishContentGzhWaitingStatus">
  395. update publish_content_gzh_waiting
  396. set status = #{status},
  397. update_timestamp = #{updateTimestamp}
  398. where plan_id = #{planId}
  399. and publish_account_id = #{accountId}
  400. and id not in
  401. <foreach collection="contentIds" item="item" open="(" close=")" separator=",">
  402. #{item}
  403. </foreach>
  404. </update>
  405. <update id="updatePublishContentGzhWaitingStatusByIds">
  406. update publish_content_gzh_waiting
  407. set status = #{status},
  408. update_timestamp = #{updateTimestamp}
  409. where id in
  410. <foreach collection="contentIds" item="item" open="(" close=")" separator=",">
  411. #{item}
  412. </foreach>
  413. </update>
  414. <select id="getGroupPublishPlanAccounts"
  415. resultType="com.tzld.longarticle.recommend.server.model.dto.aigc.PublishPlanAccountDTO">
  416. select plan_id as planId, publish_account_id as accountId, count(1) as cnt
  417. from publish_content_gzh_waiting
  418. GROUP BY plan_id, publish_account_id
  419. </select>
  420. <select id="getMinGzhWaitingPublishContent" resultType="java.lang.Long">
  421. select min(update_timestamp)
  422. from publish_content_gzh_waiting
  423. where plan_id = #{planId}
  424. and publish_account_id = #{accountId}
  425. and status = 1
  426. </select>
  427. <select id="getPublishContentGzhWaiting"
  428. resultType="com.tzld.longarticle.recommend.server.model.dto.Content">
  429. select id, source_type, source_id, title, content_pool_type
  430. from publish_content_gzh_waiting
  431. where plan_id = #{planId}
  432. and publish_account_id = #{accountId}
  433. and status = 1
  434. </select>
  435. </mapper>