123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- <?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.longArticle.LongArticleBaseMapper">
- <delete id="deleteByDateStrGreaterThanEqual">
- delete from datastat_sort_strategy where date_str >= #{dateStr}
- </delete>
- <delete id="deleteByDateStrBetween">
- delete from datastat_sort_strategy where date_str between #{dateStrBegin} and #{dateStrEnd} and type = #{type}
- </delete>
- <select id="countGetOffVideos" resultType="java.lang.Long">
- select count(1) from get_off_videos limit #{offset}, #{pageSize}
- </select>
- <insert id="batchInsertDatastatSortStrategy">
- INSERT INTO datastat_sort_strategy
- (date_str, publish_time, account_mode, account_source, account_type, account_status, bussiness_type,
- account_name, strategy, fans, view_count, avg_view_count, first_view_count, first_avg_view_count,
- first_level, fission0, fission1, fission2, second_first_level, second_fission0, second_fission1,
- second_fission2, third_first_level, third_fission0, third_fission1, third_fission2,
- read_rate, read_fans_rate, first_read_rate, fission0_first_rate, fission1_fission0_rate,
- fission0_read_avg_rate, his_read_rate, his_first_read_rate, his_fission0_first_rate, position, gh_id, title,
- link, wx_sn, fission0_read_avg_100_rate, fission0_read_avg_500_rate, fission0_read_avg_1000_rate,
- crawler_plan_name, crawler_plan_tag, produce_plan_name, produce_plan_tag, publish_plan_name,
- publish_mini_program_insert_strategy, publish_mini_program_insert_use_type, publish_mini_program_num,
- source_produce_plan_name, account_create_timestamp, publish_timestamp, type)
- VALUES
- <foreach collection="list" item="item" separator=",">
- (#{item.dateStr}, #{item.publishTime}, #{item.accountMode}, #{item.accountSource}, #{item.accountType},
- #{item.accountStatus}, #{item.businessType}, #{item.accountName}, #{item.strategy}, #{item.fans},
- #{item.viewCount}, #{item.avgViewCount}, #{item.firstViewCount}, #{item.firstAvgViewCount},
- #{item.firstLevel}, #{item.fission0}, #{item.fission1}, #{item.fission2}, #{item.secondFirstLevel},
- #{item.secondFission0}, #{item.secondFission1}, #{item.secondFission2}, #{item.thirdFirstLevel},
- #{item.thirdFission0}, #{item.thirdFission1}, #{item.thirdFission2}, #{item.readRate},
- #{item.readFansRate}, #{item.firstReadRate}, #{item.fission0FirstRate}, #{item.fission1Fission0Rate},
- #{item.fission0ReadAvgRate}, #{item.hisReadRate}, #{item.hisFirstReadRate}, #{item.hisFission0FirstRate},
- #{item.position}, #{item.ghId}, #{item.title}, #{item.link},
- #{item.wxSn}, #{item.fission0ReadAvg100Rate}, #{item.fission0ReadAvg500Rate},
- #{item.fission0ReadAvg1000Rate}, #{item.crawlerPlanName}, #{item.crawlerPlanTag},
- #{item.producePlanName}, #{item.producePlanTag}, #{item.publishPlanName},
- #{item.publishMiniProgramInsertStrategy}, #{item.publishMiniProgramInsertUseType},
- #{item.publishMiniProgramNum}, #{item.sourceProducePlanName}, #{item.accountCreateTimestamp},
- #{item.publishTimestamp}, #{item.type})
- </foreach>
- </insert>
- <insert id="batchInsertArticlePoolPromotionSource">
- insert into article_pool_promotion_source
- (channel_content_id, source_publish_content_id, root_publish_content_id, root_produce_content_id, title,
- title_md5, level, status, deleted, create_timestamp, update_timestamp)
- values
- <foreach collection="list" item="item" separator=",">
- (#{item.channelContentId}, #{item.sourcePublishContentId}, #{item.rootPublishContentId},
- #{item.rootProduceContentId}, #{item.title}, #{item.titleMd5}, #{item.level}, #{item.status},
- #{item.deleted}, #{item.createTimestamp}, #{item.updateTimestamp})
- </foreach>
- </insert>
- <update id="updateRootProduceContentLevel">
- update article_pool_promotion_source set level = #{level} where root_produce_content_id = #{rootProduceContentId}
- </update>
- <delete id="deleteDatastatScoreByDtIn">
- delete from datastat_score where dt in
- <foreach collection="dateStrList" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </delete>
- <insert id="batchInsertDatastatScore">
- INSERT INTO datastat_score
- (dt, gh_id, account_name, `index`, title, strategy, score, similarity, view_count_rate,
- his_fission_avg_read_rate_rate, his_fission_avg_read_sum_rate, his_fission_de_weight_avg_read_sum_rate,
- read_count, read_avg, read_avg_rate, category, category_score, first_pub_interval, publish_content_id,
- crawler_channel_content_id, source_id)
- VALUES
- <foreach collection="list" item="item" separator=",">
- (#{item.dt}, #{item.ghId}, #{item.accountName}, #{item.index}, #{item.title}, #{item.strategy},
- #{item.score}, #{item.similarity}, #{item.viewCountRate}, #{item.hisFissionAvgReadRateRate},
- #{item.hisFissionAvgReadSumRate}, #{item.hisFissionDeWeightAvgReadSumRate}, #{item.readCount},
- #{item.readAvg}, #{item.readAvgRate}, #{item.category}, #{item.categoryScore}, #{item.firstPubInterval},
- #{item.publishContentId}, #{item.crawlerChannelContentId}, #{item.sourceId})
- </foreach>
- </insert>
- <insert id="batchInsertArticleCategory">
- INSERT INTO article_category
- (produce_content_id, channel_content_id, crawler_plan_id, title, title_md5, create_timestamp)
- VALUES
- <foreach collection="list" item="item" separator=",">
- (#{item.produceContentId}, #{item.channelContentId}, #{item.crawlerPlanId}, #{item.title}, #{item.titleMd5},
- #{item.createTimestamp})
- </foreach>
- </insert>
- <select id="getArticlePromotion"
- resultType="com.tzld.longarticle.recommend.server.model.entity.longArticle.DatastatSortStrategy">
- select *
- from datastat_sort_strategy
- where view_count >= #{viewCount}
- and type = 9
- and read_rate >= #{viewCountRate}
- and fans > #{fans}
- and date_str > #{dateStr}
- and position in
- <foreach collection="positions" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </select>
- <insert id="batchInsertLongArticlesRootSourceId">
- INSERT INTO long_articles_root_source_id (root_source_id, account_name, gh_id, article_title, request_time,
- trace_id, push_type, video_id)
- VALUES
- <foreach collection="list" item="item" index="index" separator=",">
- (#{item.rootSourceId}, #{item.accountName}, #{item.ghId}, #{item.articleTitle}, #{item.requestTime},
- #{item.traceId}, #{item.pushType}, #{item.videoId})
- </foreach>
- </insert>
- <select id="getGetOffVideos" resultType="com.tzld.longarticle.recommend.server.model.dto.GetOffVideos">
- select * from get_off_videos where video_id in
- <foreach collection="videoIds" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </select>
- <insert id="batchInsertGetOffVideos">
- INSERT INTO get_off_videos (video_id, publish_time, video_status, trace_id, get_off_time, check_status)
- VALUES
- <foreach collection="list" item="item" separator=",">
- (#{item.videoId}, #{item.publishTime}, #{item.videoStatus}, #{item.traceId}, #{item.getOffTime}, #{item.checkStatus})
- </foreach>
- </insert>
- <insert id="batchInsertLongArticlesCrawlerVideos" parameterType="list">
- INSERT INTO long_articles_crawler_videos (content_id, out_video_id, platform, video_title, play_count,
- like_count, share_count, publish_time, crawler_time, duration,
- video_url, cover_url, download_status, video_oss_path, cover_oss_path,
- user_id, trace_id, score)
- VALUES
- <foreach collection="list" item="item" separator=",">
- (#{item.contentId}, #{item.outVideoId}, #{item.platform}, #{item.videoTitle}, #{item.playCount},
- #{item.likeCount}, #{item.shareCount}, #{item.publishTime}, #{item.crawlerTime}, #{item.duration},
- #{item.videoUrl}, #{item.coverUrl}, #{item.downloadStatus}, #{item.videoOssPath}, #{item.coverOssPath},
- #{item.userId}, #{item.traceId}, #{item.score})
- </foreach>
- </insert>
- <insert id="batchInsertLongArticlesText" parameterType="list">
- INSERT INTO long_articles_text (content_id, article_title, article_text, kimi_title, kimi_summary,
- kimi_keys, kimi_status)
- VALUES
- <foreach collection="list" item="item" separator=",">
- (#{item.contentId}, #{item.articleTitle}, #{item.articleText}, #{item.kimiTitle}, #{item.kimiSummary},
- #{item.kimiKeys}, #{item.kimiStatus})
- </foreach>
- </insert>
- <select id="getLongArticlesTextByContentIds" resultType="java.lang.String">
- select content_id from long_articles_text where content_id in
- <foreach collection="contentIds" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </select>
- <select id="getNeedUpdateRecords"
- resultType="com.tzld.longarticle.recommend.server.model.dto.LongArticlesText">
- select * from long_articles_text where kimi_title is null
- </select>
- <select id="getLongArticlesRootSourceId"
- resultType="com.tzld.longarticle.recommend.server.model.entity.longArticle.LongArticlesRootSourceId">
- select * from long_articles_root_source_id where root_source_id in
- <foreach collection="rootSourceIdList" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </select>
- <update id="updateLongArticlesText">
- update long_articles_text
- set kimi_title = #{kimiTitle},
- kimi_summary = #{kimiSummary},
- kimi_keys = #{kimiKeys}
- where content_id = #{contentId}
- </update>
- <update id="updateLongArticleMatchVideosResponse">
- update long_articles_match_videos
- set response = #{response}
- where trace_id = #{traceId}
- </update>
- <select id="getLongArticlesMatchVideos"
- resultType="com.tzld.longarticle.recommend.server.model.dto.LongArticlesMatchVideos">
- select * from long_articles_match_videos where trace_id in
- <foreach collection="traceIds" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </select>
- <select id="getLongArticlesCrawlerVideos"
- resultType="com.tzld.longarticle.recommend.server.model.dto.LongArticlesCrawlerVideos">
- select * from long_articles_crawler_videos where content_id in
- <foreach collection="contentIds" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- and download_status = 2
- </select>
- <select id="getNeedMatchVideos"
- resultType="com.tzld.longarticle.recommend.server.model.dto.LongArticlesMatchVideos">
- select * from long_articles_match_videos where flow_pool_level is null and id > #{id} order by id limit #{pageSize}
- </select>
- <select id="countNeedMatchVideos" resultType="java.lang.Integer">
- select count(1) from long_articles_match_videos where id > 3962393 and flow_pool_level is null
- </select>
- <insert id="batchInsertLongArticlesMatchVideos" parameterType="list">
- INSERT INTO long_articles_match_videos (trace_id, content_id, flow_pool_level, gh_id, account_name,
- content_status, success_status, request_timestamp, response,
- process_times)
- VALUES
- <foreach collection="list" item="item" separator=",">
- (#{item.traceId}, #{item.contentId}, #{item.flowPoolLevel}, #{item.ghId}, #{item.accountName},
- #{item.contentStatus}, #{item.successStatus}, #{item.requestTimestamp}, #{item.response},
- #{item.processTimes})
- </foreach>
- </insert>
- <select id="getPublishSingleVideoSource"
- resultType="com.tzld.longarticle.recommend.server.model.entity.longArticle.PublishSingleVideoSource">
- select content_trace_id, article_title, cover_url, flow_pool_level
- from publish_single_video_source
- where bad_status = 0 and audit_status = 1
- <if test="flowPoolLevel!= null ">
- and flow_pool_level = #{flowPoolLevel}
- </if>
- </select>
- <select id="getFilterColdLongArticleTitle" resultType="java.lang.String">
- select title from cold_start_title_pool where status in (-1, 1)
- </select>
- <insert id="batchInsertArticleTitleHisCache">
- insert into article_title_his_cache
- (source_id, type, title, title_md5, channel_content_id, root_publish_timestamp, crawler_title,
- category, his_publish_article_list, create_timestamp)
- values
- <foreach collection="list" item="item" separator=",">
- (#{item.sourceId}, #{item.type}, #{item.title}, #{item.titleMd5}, #{item.channelContentId},
- #{item.rootPublishTimestamp}, #{item.crawlerTitle}, #{item.category}, #{item.hisPublishArticleList},
- #{item.createTimestamp})
- </foreach>
- </insert>
- </mapper>
|