123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.tzld.longarticle.recommend.server.mapper.crawler.CrawlerBaseMapper">
- <insert id="batchInsertAccountCorrelation">
- INSERT INTO account_correlation (date_str, gh_id, account_name, rel_gh_id, rel_account_name, status, correlation)
- VALUES
- <foreach collection="list" item="item" separator=",">
- (#{item.dateStr}, #{item.ghId}, #{item.accountName}, #{item.relGhId}, #{item.relAccountName}, #{item.status}, #{item.correlation})
- </foreach>
- </insert>
- <select id="countGetOffVideos" resultType="java.lang.Integer">
- select count(1) from get_off_videos where publish_time > 1727239202
- </select>
- <select id="pageGetOffVideos" resultType="com.tzld.longarticle.recommend.server.model.dto.GetOffVideos">
- select * from get_off_videos order by video_id limit #{offset}, #{pageSize}
- </select>
- <select id="countLongArticlesRootSourceId" resultType="java.lang.Integer">
- select count(1) from long_articles_root_source_id where requestTime > 1727192229
- </select>
- <select id="pageLongArticlesRootSourceId" resultType="com.tzld.longarticle.recommend.server.model.entity.longArticle.LongArticlesRootSourceId">
- select * from long_articles_root_source_id where requestTime > 1727192229 order by rootSourceId limit #{offset}, #{pageSize}
- </select>
- <select id="countArticleMatchVideos" resultType="java.lang.Integer">
- select count(1) from article_match_videos where DATE(update_time) >= '2024-09-20'
- </select>
- <select id="pageArticleMatchVideos"
- resultType="com.tzld.longarticle.recommend.server.model.dto.ArticleMatchVideos">
- select * from article_match_videos order by video_id
- </select>
- <select id="countLongArticlesVideos" resultType="java.lang.Integer">
- select count(1) from long_articles_video where content_status = 2 and success = 0
- </select>
- <select id="pageLongArticlesVideos"
- resultType="com.tzld.longarticle.recommend.server.model.dto.LongArticlesVideoDTO">
- select * from long_articles_video where content_status = 2 and success = 0 and id > #{id} order by id limit #{pageSize}
- </select>
- <select id="getLongArticlesText" resultType="com.tzld.longarticle.recommend.server.model.entity.longArticle.LongArticlesText">
- select content_id, kimi_title, kimi_summary, kimi_keys from long_articles_video where kimi_summary is not null group by content_id
- </select>
- <select id="getLongArticlesVideo"
- resultType="com.tzld.longarticle.recommend.server.model.dto.LongArticlesVideoDTO">
- select * from long_articles_video where trace_id in
- <foreach collection="traceIds" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </select>
- <insert id="batchInsertAccountAvgInfo">
- INSERT INTO account_avg_info_v3
- (gh_id, position, update_time, account_name, fans, read_avg, like_avg, status, account_type, account_mode,
- account_source, account_status, business_type, read_rate_avg)
- VALUES
- <foreach collection="list" item="item" separator=",">
- (#{item.ghId}, #{item.position}, #{item.updateTime}, #{item.accountName}, #{item.fans}, #{item.readAvg},
- #{item.likeAvg}, #{item.status}, #{item.accountType}, #{item.accountMode}, #{item.accountSource},
- #{item.accountStatus}, #{item.businessType}, #{item.readRateAvg})
- </foreach>
- </insert>
- <delete id="deleteAccountAvgInfoByGhIdAndUpdateTime">
- delete from account_avg_info_v3 where gh_id = #{ghId} and update_time = #{date}
- </delete>
- <update id="updateAccountAvgInfoStatus">
- update account_avg_info_v3 set status = 0 where gh_id = #{ghId} and update_time != #{date}
- </update>
- <select id="getAllByWxSnIn"
- resultType="com.tzld.longarticle.recommend.server.model.entity.crawler.ArticleDetailInfo">
- select wx_sn, recall_dt, first_level, fission_0, fission_0_head, fission_0_recommend, fission_1, fission_1_head,
- fission_1_recommend, fission_2, fission_2_head, fission_2_recommend
- from long_articles_detail_info
- where wx_sn in
- <foreach collection="wxSnList" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </select>
- <select id="getAllByGhIdIn"
- resultType="com.tzld.longarticle.recommend.server.model.entity.crawler.AccountAvgInfo">
- select gh_id, position, update_time, fans, read_avg, read_avg_ci_upper, open_rate_avg
- from account_avg_info_v3
- where gh_id in
- <foreach collection="ghIdList" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </select>
- <select id="getByGhIdInAndPublishTimestampLessThanAndTypeEquals"
- resultType="com.tzld.longarticle.recommend.server.model.entity.crawler.Article">
- select ghId, accountName, ItemIndex, title, ContentUrl, wx_sn, publish_timestamp, show_view_count
- from official_articles_v2
- where ghId in
- <foreach collection="ghIds" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- and publish_timestamp < #{publishTimestamp}
- and type = #{type}
- </select>
- <select id="getNeedResetUserGroupGhIds" resultType="java.lang.String">
- select distinct t.gzh_id
- from (select gzh_id, user_group_id, count(1)
- from article_user_group
- GROUP BY gzh_id, user_group_id having count(1) > 10000) t
- </select>
- </mapper>
|