VideoPoolAuditMapper.xml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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.longArticle.VideoPoolAuditMapper">
  4. <select id="articleVideoAuditListCount" resultType="java.lang.Integer">
  5. select count(content_trace_id)
  6. from publish_single_video_source
  7. where bad_status in (0, 5) and audit_status = 1
  8. <if test="status!= null and status.size() > 0">
  9. and video_pool_audit_status in
  10. <foreach collection="status" item="item" separator="," open="(" close=")">
  11. #{item}
  12. </foreach>
  13. </if>
  14. <if test="contentId!= null and contentId.size() > 0">
  15. and content_trace_id in
  16. <foreach collection="contentId" item="item" separator="," open="(" close=")">
  17. #{item}
  18. </foreach>
  19. </if>
  20. <if test="title!= null and title.size() > 0">
  21. and article_title in
  22. <foreach collection="title" item="item" separator="," open="(" close=")">
  23. #{item}
  24. </foreach>
  25. </if>
  26. <if test="auditAccount!= null and auditAccount.size() > 0">
  27. and video_pool_audit_account in
  28. <foreach collection="auditAccount" item="item" separator="," open="(" close=")">
  29. #{item}
  30. </foreach>
  31. </if>
  32. <if test="flowPoolLevels!= null and flowPoolLevels.size() > 0">
  33. and flow_pool_level in
  34. <foreach collection="flowPoolLevels" item="item" separator="," open="(" close=")">
  35. #{item}
  36. </foreach>
  37. </if>
  38. </select>
  39. <select id="articleVideoAuditList"
  40. resultType="com.tzld.longarticle.recommend.server.model.entity.longArticle.PublishSingleVideoSource">
  41. select *
  42. from publish_single_video_source
  43. where bad_status in (0, 5) and audit_status = 1
  44. <if test="status!= null and status.size() > 0">
  45. and `video_pool_audit_status` in
  46. <foreach collection="status" item="item" separator="," open="(" close=")">
  47. #{item}
  48. </foreach>
  49. </if>
  50. <if test="contentId!= null and contentId.size() > 0">
  51. and content_trace_id in
  52. <foreach collection="contentId" item="item" separator="," open="(" close=")">
  53. #{item}
  54. </foreach>
  55. </if>
  56. <if test="title!= null and title.size() > 0">
  57. and article_title in
  58. <foreach collection="title" item="item" separator="," open="(" close=")">
  59. #{item}
  60. </foreach>
  61. </if>
  62. <if test="auditAccount!= null and auditAccount.size() > 0">
  63. and video_pool_audit_account in
  64. <foreach collection="auditAccount" item="item" separator="," open="(" close=")">
  65. #{item}
  66. </foreach>
  67. </if>
  68. <if test="flowPoolLevels!= null and flowPoolLevels.size() > 0">
  69. and flow_pool_level in
  70. <foreach collection="flowPoolLevels" item="item" separator="," open="(" close=")">
  71. #{item}
  72. </foreach>
  73. </if>
  74. <choose>
  75. <when test="poolLevelDesc != null and poolLevelDesc != ''">
  76. order by flow_pool_level ${poolLevelDesc}, content_trace_id desc
  77. </when>
  78. <otherwise>
  79. order by content_trace_id desc
  80. </otherwise>
  81. </choose>
  82. limit #{offset}, #{pageSize}
  83. </select>
  84. <select id="articleVideoAuditNext"
  85. resultType="com.tzld.longarticle.recommend.server.model.entity.longArticle.PublishSingleVideoSource">
  86. select *
  87. from publish_single_video_source
  88. where bad_status = 0 and audit_status = 1
  89. <if test="status!= null and status.size() > 0">
  90. and `video_pool_audit_status` in
  91. <foreach collection="status" item="item" separator="," open="(" close=")">
  92. #{item}
  93. </foreach>
  94. </if>
  95. <if test="contentId!= null and contentId.size() > 0">
  96. and content_trace_id in
  97. <foreach collection="contentId" item="item" separator="," open="(" close=")">
  98. #{item}
  99. </foreach>
  100. </if>
  101. <if test="title!= null and title.size() > 0">
  102. and article_title in
  103. <foreach collection="title" item="item" separator="," open="(" close=")">
  104. #{item}
  105. </foreach>
  106. </if>
  107. <if test="auditAccount!= null and auditAccount.size() > 0">
  108. and video_pool_audit_account in
  109. <foreach collection="auditAccount" item="item" separator="," open="(" close=")">
  110. #{item}
  111. </foreach>
  112. </if>
  113. <if test="flowPoolLevel != null">
  114. and flow_pool_level = #{flowPoolLevel}
  115. </if>
  116. order by content_trace_id desc
  117. limit 1
  118. </select>
  119. <select id="searchFilterValueByItemName" resultType="java.lang.String">
  120. <choose>
  121. <when test="itemName == 'contentId'">
  122. select content_trace_id
  123. from publish_single_video_source
  124. <where>
  125. <if test="searchKeyword != null and searchKeyword !=''">
  126. and content_trace_id like concat('%', #{searchKeyword}, '%')
  127. </if>
  128. </where>
  129. order by crawler_timestamp desc
  130. limit 100
  131. </when>
  132. <when test="itemName == 'auditAccount'">
  133. select distinct video_pool_audit_account
  134. from publish_single_video_source
  135. <where>
  136. <if test="searchKeyword != null and searchKeyword !=''">
  137. and video_pool_audit_account like concat('%', #{searchKeyword}, '%')
  138. </if>
  139. </where>
  140. order by crawler_timestamp desc
  141. limit 100
  142. </when>
  143. <when test="itemName == 'title'">
  144. select distinct article_title
  145. from publish_single_video_source
  146. <where>
  147. <if test="searchKeyword != null and searchKeyword !=''">
  148. and article_title like concat('%', #{searchKeyword}, '%')
  149. </if>
  150. </where>
  151. order by crawler_timestamp desc
  152. limit 100
  153. </when>
  154. </choose>
  155. </select>
  156. <update id="updateArticleTitle">
  157. update publish_single_video_source
  158. set old_article_title = article_title,
  159. article_title = #{param.title},
  160. article_title_update_account = #{param.updateAccount},
  161. article_title_update_timestamp = #{updateTime}
  162. where content_trace_id = #{param.contentId}
  163. </update>
  164. <update id="updateVideoTitle">
  165. update publish_single_video_source
  166. set old_mini_program_title = mini_program_title,
  167. mini_program_title = #{param.title},
  168. mini_program_title_update_account = #{param.updateAccount},
  169. mini_program_title_update_timestamp = #{updateTime}
  170. where content_trace_id = #{param.contentId}
  171. </update>
  172. </mapper>