|
@@ -2,48 +2,6 @@
|
|
|
<!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.aigc.AigcBaseMapper">
|
|
|
|
|
|
- <select id="getPublishAccountByGhId"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishAccount">
|
|
|
- select * from publish_account where gh_id = #{ghId} limit 1
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getPublishContentByTitle"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.dto.PublishContentDTO">
|
|
|
- select content.id, content.plan_id, content.source_type, content.source_id, content.crawler_channel_content_id,
|
|
|
- content.publish_account_id, content.publish_timestamp, output.output as title
|
|
|
- from publish_content content
|
|
|
- join publish_content_output output
|
|
|
- on content.id = output.publish_content_id and output.content_type = 3 AND output.select_status = 1
|
|
|
- where content.status = 2
|
|
|
- and (content.publish_account_id, output.output) in
|
|
|
- <foreach collection="list" item="item" open="(" close=")" separator=",">
|
|
|
- (#{item.publishAccountId}, #{item.title})
|
|
|
- </foreach>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getMiniProgramTask"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishPlanMiniprogramTask">
|
|
|
- select * from publish_plan_miniprogram_task where
|
|
|
- <foreach collection="list" item="item" open="(" close=")" separator=" or ">
|
|
|
- (plan_id = #{item.planId} and account_ids like CONCAT("%", #{item.accountId}, "%"))
|
|
|
- </foreach>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getProduceContent"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.ProducePlanExeRecord">
|
|
|
- select * from produce_plan_exe_record where plan_exe_id = #{id}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getProducePlan"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.ProducePlan">
|
|
|
- select * from produce_plan where id = #{id}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getProducePlanInputSources"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.ProducePlanInputSource">
|
|
|
- select * from produce_plan_input_source where plan_id = #{planId} and data_status = 1
|
|
|
- </select>
|
|
|
-
|
|
|
<select id="getCrawlerPlanRelByChannelContentIds"
|
|
|
resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.CrawlerPlanResultRel">
|
|
|
select * from crawler_plan_result_rel where channel_source_id in
|
|
@@ -60,115 +18,6 @@
|
|
|
</foreach>
|
|
|
</select>
|
|
|
|
|
|
- <select id="getNotPublishPlan" resultType="com.tzld.longarticle.recommend.server.model.dto.NotPublishPlan">
|
|
|
- SELECT
|
|
|
- plan.id as planId,
|
|
|
- plan.NAME as planName,
|
|
|
- plan.error_msg as errorMsg,
|
|
|
- stat.today_expect_publish_count as expectCount,
|
|
|
- stat.today_publish_count as publishCount,
|
|
|
- setting.publish_push_time as publishPushTime
|
|
|
- FROM publish_plan plan
|
|
|
- JOIN publish_plan_stat stat ON plan.id = stat.plan_id
|
|
|
- JOIN publish_plan_setting setting ON plan.id = setting.plan_id
|
|
|
- WHERE
|
|
|
- stat.today_expect_publish_count > stat.today_publish_count
|
|
|
- AND plan.plan_status = 1
|
|
|
- AND setting.push_type = 2
|
|
|
- and plan.create_timestamp < #{todayStart}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getPublishPlanPushType" resultType="java.lang.Integer">
|
|
|
- select push_type from publish_plan_setting where plan_id = #{planId}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getPublishAccounts"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishAccount">
|
|
|
- SELECT account.*
|
|
|
- FROM publish_plan_account planAccount
|
|
|
- join publish_account account on planAccount.account_id = account.id
|
|
|
- left join publish_content content
|
|
|
- on content.publish_account_id = planAccount.account_id
|
|
|
- and content.plan_id = planAccount.plan_id
|
|
|
- and content.publish_timestamp > #{todayStart}
|
|
|
- WHERE planAccount.plan_id = #{planId} and content.id is null and planAccount.publish_open_flag = 1
|
|
|
- </select>
|
|
|
- <select id="getSourceProduceContentByTitles"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.dto.ProduceContentDTO">
|
|
|
- select record.plan_exe_id as contentId,
|
|
|
- output.output as title,
|
|
|
- record.produce_timestamp as produceTimestamp,
|
|
|
- record.plan_id as producePlanId
|
|
|
- from produce_plan_exe_record record
|
|
|
- join produce_plan_module_output output on record.plan_exe_id = output.plan_exe_id and output.produce_module_type = 3
|
|
|
- join publish_content pc on pc.source_id = record.plan_exe_id and pc.status = 2 and pc.channel = 5
|
|
|
- where output.output in
|
|
|
- <foreach collection="titleList" item="item" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getAccountTypeFans"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.dto.AccountTypeFansDTO">
|
|
|
- SELECT distinct t3.`name`,
|
|
|
- t3.gh_id,
|
|
|
- t3.follower_count,
|
|
|
- t6.account_source_name,
|
|
|
- t6.mode_type,
|
|
|
- t6.account_type,
|
|
|
- t6.`status`
|
|
|
- FROM publish_plan t1
|
|
|
- JOIN publish_plan_account t2 ON t1.id = t2.plan_id
|
|
|
- JOIN publish_account t3 ON t2.account_id = t3.id
|
|
|
- LEFT JOIN publish_account_wx_type t4 on t3.id = t4.account_id
|
|
|
- LEFT JOIN wx_statistics_group_source_account t5 on t3.id = t5.account_id
|
|
|
- LEFT JOIN wx_statistics_group_source t6 on t5.group_source_name = t6.account_source_name
|
|
|
- WHERE t1.plan_status = 1
|
|
|
- AND t3.channel = 5
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getHisPublishByTitles"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.dto.PublishContentDTO">
|
|
|
- select content.*, output.output as title
|
|
|
- from publish_content content
|
|
|
- join publish_content_output output
|
|
|
- on content.id = output.publish_content_id and output.content_type = 3 AND output.select_status = 1
|
|
|
- where content.status = 2
|
|
|
- and output.output in
|
|
|
- <foreach collection="titleList" item="item" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getNearestPublishContent"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishContent">
|
|
|
- select *
|
|
|
- from publish_content
|
|
|
- where publish_account_id = #{publishAccountId}
|
|
|
- and channel = 5
|
|
|
- and status = 2
|
|
|
- <if test="publishTimestamp != null">
|
|
|
- and publish_timestamp <= (#{publishTimestamp} + 3600000)
|
|
|
- </if>
|
|
|
- order by publish_timestamp desc
|
|
|
- <if test="size != null">
|
|
|
- limit #{size}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getLateNearestPublishContent"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishContent">
|
|
|
- select *
|
|
|
- from publish_content
|
|
|
- where publish_account_id = #{publishAccountId}
|
|
|
- and channel = 5
|
|
|
- and status = 2
|
|
|
- <if test="publishTimestamp != null">
|
|
|
- and publish_timestamp > (#{publishTimestamp})
|
|
|
- </if>
|
|
|
- order by publish_timestamp
|
|
|
- </select>
|
|
|
-
|
|
|
<select id="getCrawlerContentByChannelContentId"
|
|
|
resultType="com.tzld.longarticle.recommend.server.model.dto.CrawlerContent">
|
|
|
select cc.channel_content_id, ca.wx_gh as ghId, cc.title, cc.publish_timestamp
|
|
@@ -185,6 +34,7 @@
|
|
|
on record.plan_exe_id = output.plan_exe_id and output.produce_module_type = 3
|
|
|
where record.plan_id = #{planId} and record.status = 2 and audit_status = 1
|
|
|
</select>
|
|
|
+
|
|
|
<select id="getAllByProducePlanId"
|
|
|
resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.ProducePlanExeRecord">
|
|
|
select *
|
|
@@ -195,6 +45,7 @@
|
|
|
</foreach>
|
|
|
and status = 2
|
|
|
</select>
|
|
|
+
|
|
|
<select id="getCrawlerContentByChannelContentIdIn"
|
|
|
resultType="com.tzld.longarticle.recommend.server.model.dto.CrawlerContent">
|
|
|
select cc.channel_content_id, cprr.plan_id as crawlerPlanId, ca.wx_gh as ghId, cc.title, cc.publish_timestamp
|
|
@@ -208,81 +59,6 @@
|
|
|
</foreach>
|
|
|
</select>
|
|
|
|
|
|
- <select id="checkPublishPlanAccount" resultType="com.tzld.longarticle.recommend.server.model.dto.PublishPlanAccountNotifyDTO">
|
|
|
- select ppa.plan_id, pp.name as planName, pa.name as accountName
|
|
|
- from publish_plan_account ppa
|
|
|
- join publish_account pa on ppa.account_id = pa.id
|
|
|
- join publish_plan pp on ppa.plan_id = pp.id
|
|
|
- where pp.plan_status = 1 and pp.channel = 5 and pp.content_modal = 3 and ppa.publish_open_flag = 0
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getPublishContentByTraceIdIn"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.dto.PublishContentMiniprogramDTO">
|
|
|
- select * from publish_content_miniprogram where trace_id in
|
|
|
- <foreach collection="traceIds" item="item" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getPushContentRelByPublishContentIdIn"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.dto.PublishGzhPushContentRelDTO">
|
|
|
- select pgpcr.*
|
|
|
- from publish_gzh_push_content_rel pgpcr
|
|
|
- join publish_gzh_push pgp on pgpcr.push_id = pgp.push_id
|
|
|
- where pgpcr.publish_content_id in
|
|
|
- <foreach collection="publishContentIds" item="item" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getPushByPushIdIn"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.dto.PublishGzhPushDTO">
|
|
|
- select * from publish_gzh_push where push_id in
|
|
|
- <foreach collection="pushIds" item="item" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getGroupPushRelByPushIdIn"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.dto.PublishGzhPushContentRelDTO">
|
|
|
- select * from publish_gzh_push_content_rel where push_id in
|
|
|
- <foreach collection="pushIds" item="item" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- order by id
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getPublishContentById"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.dto.PublishContentDTO">
|
|
|
- select content.id, content.publish_timestamp, content.publish_account_id, output.output as title
|
|
|
- from publish_content content
|
|
|
- join publish_content_output output
|
|
|
- on content.id = output.publish_content_id and output.content_type = 3 AND output.select_status = 1
|
|
|
- where content.id = #{publishContentId}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getPublishContentByIdIn"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.dto.PublishContentDTO">
|
|
|
- select content.id, content.publish_timestamp, content.publish_account_id, output.output as title
|
|
|
- from publish_content content
|
|
|
- join publish_content_output output
|
|
|
- on content.id = output.publish_content_id and output.content_type = 3 AND output.select_status = 1
|
|
|
- where content.id in
|
|
|
- <foreach collection="publishContentIds" item="item" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getPublishContentBySourceIdIn"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.dto.PublishContentDTO">
|
|
|
- select id, plan_id, source_type, source_id, crawler_channel_content_id, publish_account_id, publish_timestamp
|
|
|
- from publish_content
|
|
|
- where status = 2 and source_id in
|
|
|
- <foreach collection="sourceIds" item="item" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </select>
|
|
|
-
|
|
|
<select id="getColdCrawlerPlan"
|
|
|
resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.CrawlerPlan">
|
|
|
select *
|
|
@@ -322,35 +98,6 @@
|
|
|
GROUP BY pper.plan_id
|
|
|
</select>
|
|
|
|
|
|
- <select id="getAccountTypeList"
|
|
|
- resultType="com.tzld.longarticle.recommend.server.model.dto.PublishAccountTypeDTO">
|
|
|
- SELECT DISTINCT t3.`name`, t3.gh_id, t3.follower_count, t6.account_source_name, t6.mode_type,
|
|
|
- t6.account_type, t6.`status`
|
|
|
- FROM publish_plan t1
|
|
|
- JOIN publish_plan_account t2 ON t1.id = t2.plan_id
|
|
|
- JOIN publish_account t3 ON t2.account_id = t3.id
|
|
|
- LEFT JOIN publish_account_wx_type t4 on t3.id = t4.account_id
|
|
|
- LEFT JOIN wx_statistics_group_source_account t5 on t3.id = t5.account_id
|
|
|
- LEFT JOIN wx_statistics_group_source t6 on t5.group_source_name = t6.account_source_name
|
|
|
- WHERE t1.plan_status = 1
|
|
|
- AND t3.channel = 5
|
|
|
- <if test="ghIds != null and ghIds.size() > 0">
|
|
|
- AND t3.gh_id in
|
|
|
- <foreach collection="ghIds" item="item" open="(" close=")" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- GROUP BY t3.id;
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getOnlyMiniprogramArticle" resultType="java.lang.String">
|
|
|
- select id
|
|
|
- from publish_content
|
|
|
- where gzh_only_miniprogram_flag = 1
|
|
|
- order by id
|
|
|
- limit #{offset}, #{pageSize}
|
|
|
- </select>
|
|
|
-
|
|
|
<select id="getProduceScoreGreaterThan"
|
|
|
resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.ProduceTaskAtom">
|
|
|
select atom.plan_exe_id, atom.input, atom.output, record.audit_timestamp as createTimestamp
|