CrawlerBaseMapper.xml 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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.crawler.CrawlerBaseMapper">
  4. <insert id="batchInsertAccountCorrelation">
  5. INSERT INTO account_correlation (date_str, gh_id, account_name, rel_gh_id, rel_account_name, status, correlation)
  6. VALUES
  7. <foreach collection="list" item="item" separator=",">
  8. (#{item.dateStr}, #{item.ghId}, #{item.accountName}, #{item.relGhId}, #{item.relAccountName}, #{item.status}, #{item.correlation})
  9. </foreach>
  10. </insert>
  11. <insert id="batchInsertLongArticlesRootSourceId">
  12. INSERT INTO long_articles_root_source_id (rootSourceId, accountName, ghId, articleTitle, requestTime, trace_id,
  13. push_type, video_id)
  14. VALUES
  15. <foreach collection="list" item="item" separator=",">
  16. (#{item.rootSourceId}, #{item.accountName}, #{item.ghId}, #{item.articleTitle}, #{item.requestTime},
  17. #{item.traceId}, #{item.pushType}, #{item.videoId})
  18. </foreach>
  19. </insert>
  20. <insert id="batchInsertAccountAvgInfo">
  21. INSERT INTO account_avg_info_v3
  22. (gh_id, position, update_time, account_name, fans, read_avg, like_avg, status, account_type, account_mode,
  23. account_source, account_status, business_type, read_rate_avg)
  24. VALUES
  25. <foreach collection="list" item="item" separator=",">
  26. (#{item.ghId}, #{item.position}, #{item.updateTime}, #{item.accountName}, #{item.fans}, #{item.readAvg},
  27. #{item.likeAvg}, #{item.status}, #{item.accountType}, #{item.accountMode}, #{item.accountSource},
  28. #{item.accountStatus}, #{item.businessType}, #{item.readRateAvg})
  29. </foreach>
  30. </insert>
  31. <delete id="deleteAccountAvgInfoByGhIdAndUpdateTime">
  32. delete from account_avg_info_v3 where gh_id = #{ghId} and update_time = #{date}
  33. </delete>
  34. <update id="updateAccountAvgInfoStatus">
  35. update account_avg_info_v3 set status = 0 where gh_id = #{ghId} and update_time != #{date}
  36. </update>
  37. <update id="updateArticleAigcId">
  38. update official_articles_v2
  39. set publish_content_id = #{publishContentId},
  40. channel_content_id = #{channelContentId}
  41. where wx_sn = #{wxsn}
  42. </update>
  43. <update id="updateArticleSourceRootId">
  44. update official_articles_v2
  45. set source_publish_content_id = #{sourcePublishContentId},
  46. root_publish_content_id = #{rootPublishContentId},
  47. root_produce_content_id = #{rootProduceContentId}
  48. where wx_sn = #{wxsn}
  49. </update>
  50. <select id="getWaitingFindArticle"
  51. resultType="com.tzld.longarticle.recommend.server.model.entity.crawler.Article">
  52. select * from official_articles_v2 where publish_timestamp > #{timestamp} order by publish_timestamp limit 100
  53. </select>
  54. </mapper>