AigcBaseMapper.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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.aigc.AigcBaseMapper">
  4. <select id="getPublishAccountByGhId"
  5. resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishAccount">
  6. select * from publish_account where gh_id = #{ghId} limit 1
  7. </select>
  8. <select id="getPublishContentByTitle"
  9. resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishContent">
  10. select content.*, output.output as title
  11. from publish_content content
  12. join publish_content_output output
  13. on content.id = output.publish_content_id and output.content_type = 3 AND output.select_status = 1
  14. where content.status = 2
  15. and (content.publish_account_id, output.output) in
  16. <foreach collection="list" item="item" open="(" close=")" separator=",">
  17. (#{item.publishAccountId}, #{item.title})
  18. </foreach>
  19. </select>
  20. <select id="getPublishPlanById"
  21. resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishPlan">
  22. select * from publish_plan where id = #{planId}
  23. </select>
  24. <select id="getMiniProgramTask"
  25. resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishPlanMiniprogramTask">
  26. select * from publish_plan_miniprogram_task where
  27. <foreach collection="list" item="item" open="(" close=")" separator=" or ">
  28. (plan_id = #{item.planId} and account_ids like CONCAT("%", #{item.accountId}, "%"))
  29. </foreach>
  30. </select>
  31. <select id="getProduceContent"
  32. resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.ProducePlanExeRecord">
  33. select * from produce_plan_exe_record where plan_exe_id = #{id}
  34. </select>
  35. <select id="getProducePlan"
  36. resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.ProducePlan">
  37. select * from produce_plan where id = #{id}
  38. </select>
  39. <select id="getProducePlanInputSources"
  40. resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.ProducePlanInputSource">
  41. select * from produce_plan_input_source where plan_id = #{planId} and data_status = 1
  42. </select>
  43. <select id="getCrawlerPlanRelByChannelContentIds"
  44. resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.CrawlerPlanResultRel">
  45. select * from crawler_plan_result_rel where channel_source_id in
  46. <foreach collection="channelContentIds" item="item" open="(" close=")" separator=",">
  47. #{item}
  48. </foreach>
  49. </select>
  50. <select id="getCrawlerPlanByPlanIds"
  51. resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.CrawlerPlan">
  52. select * from crawler_plan where id in
  53. <foreach collection="planIds" item="item" open="(" close=")" separator=",">
  54. #{item}
  55. </foreach>
  56. </select>
  57. <select id="getNotPublishPlan" resultType="com.tzld.longarticle.recommend.server.model.dto.NotPublishPlan">
  58. SELECT
  59. plan.id as planId,
  60. plan.NAME as planName,
  61. plan.error_msg as errorMsg,
  62. stat.today_expect_publish_count as expectCount,
  63. stat.today_publish_count as publishCount,
  64. setting.publish_push_time as publishPushTime
  65. FROM publish_plan plan
  66. JOIN publish_plan_stat stat ON plan.id = stat.plan_id
  67. JOIN publish_plan_setting setting ON plan.id = setting.plan_id
  68. WHERE
  69. stat.today_expect_publish_count > stat.today_publish_count
  70. AND plan.plan_status = 1
  71. AND setting.push_type = 2
  72. and plan.create_timestamp &lt; #{todayStart}
  73. </select>
  74. <select id="getPublishPlanPushType" resultType="java.lang.Integer">
  75. select push_type from publish_plan_setting where plan_id = #{planId}
  76. </select>
  77. <select id="getPublishAccounts"
  78. resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishAccount">
  79. SELECT account.*
  80. FROM publish_plan_account planAccount
  81. join publish_account account on planAccount.account_id = account.id
  82. left join publish_content content
  83. on content.publish_account_id = planAccount.account_id
  84. and content.plan_id = planAccount.plan_id
  85. and content.publish_timestamp > #{todayStart}
  86. WHERE planAccount.plan_id = #{planId} and content.id is null and planAccount.publish_open_flag = 1
  87. </select>
  88. <select id="getSourceProduceContentByTitles"
  89. resultType="com.tzld.longarticle.recommend.server.model.dto.ProduceContentDTO">
  90. select record.plan_exe_id as contentId,
  91. output.output as title,
  92. record.produce_timestamp as produceTimestamp,
  93. record.plan_id as producePlanId
  94. from produce_plan_exe_record record
  95. join produce_plan_module_output output on record.plan_exe_id = output.plan_exe_id and output.produce_module_type = 3
  96. join publish_content pc on pc.source_id = record.plan_exe_id and pc.status = 2 and pc.channel = 5
  97. where output.output in
  98. <foreach collection="titleList" item="item" open="(" close=")" separator=",">
  99. #{item}
  100. </foreach>
  101. </select>
  102. <select id="getAccountTypeFans"
  103. resultType="com.tzld.longarticle.recommend.server.model.dto.AccountTypeFansDTO">
  104. SELECT distinct t3.`name`,
  105. t3.gh_id,
  106. t3.follower_count,
  107. t6.account_source_name,
  108. t6.mode_type,
  109. t6.account_type,
  110. t6.`status`
  111. FROM publish_plan t1
  112. JOIN publish_plan_account t2 ON t1.id = t2.plan_id
  113. JOIN publish_account t3 ON t2.account_id = t3.id
  114. LEFT JOIN publish_account_wx_type t4 on t3.id = t4.account_id
  115. LEFT JOIN wx_statistics_group_source_account t5 on t3.id = t5.account_id
  116. LEFT JOIN wx_statistics_group_source t6 on t5.group_source_name = t6.account_source_name
  117. WHERE t1.plan_status = 1
  118. AND t3.channel = 5
  119. </select>
  120. <select id="getHisPublishByTitles"
  121. resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishContent">
  122. select content.*, output.output as title
  123. from publish_content content
  124. join publish_content_output output
  125. on content.id = output.publish_content_id and output.content_type = 3 AND output.select_status = 1
  126. where content.status = 2
  127. and output.output in
  128. <foreach collection="titleList" item="item" open="(" close=")" separator=",">
  129. #{item}
  130. </foreach>
  131. </select>
  132. </mapper>