123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- <?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.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.entity.aigc.PublishContent">
- 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 (content.publish_account_id, output.output) in
- <foreach collection="list" item="item" open="(" close=")" separator=",">
- (#{item.publishAccountId}, #{item.title})
- </foreach>
- </select>
- <select id="getPublishPlanById"
- resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishPlan">
- select * from publish_plan where id = #{planId}
- </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
- <foreach collection="channelContentIds" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </select>
- <select id="getCrawlerPlanByPlanIds"
- resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.CrawlerPlan">
- select * from crawler_plan where id in
- <foreach collection="planIds" item="item" open="(" close=")" separator=",">
- #{item}
- </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.entity.aigc.PublishContent">
- 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>
- </mapper>
|