ArticleAuditMapper.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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.ArticleAuditMapper">
  4. <select id="articleVideoAuditListCount" resultType="java.lang.Integer">
  5. select count(lata.content_id)
  6. from long_articles_title_audit lata
  7. left join long_articles_text lat on lata.content_id = lat.content_id
  8. <where>
  9. <if test="status!= null and status.size() > 0">
  10. and lata.status in
  11. <foreach collection="status" item="item" separator="," open="(" close=")">
  12. #{item}
  13. </foreach>
  14. </if>
  15. <if test="contentId!= null and contentId.size() > 0">
  16. and lata.content_id in
  17. <foreach collection="contentId" item="item" separator="," open="(" close=")">
  18. #{item}
  19. </foreach>
  20. </if>
  21. <if test="title!= null and title.size() > 0">
  22. and lat.article_title in
  23. <foreach collection="title" item="item" separator="," open="(" close=")">
  24. #{item}
  25. </foreach>
  26. </if>
  27. <if test="auditAccount!= null and auditAccount.size() > 0">
  28. and lata.audit_account in
  29. <foreach collection="auditAccount" item="item" separator="," open="(" close=")">
  30. #{item}
  31. </foreach>
  32. </if>
  33. </where>
  34. </select>
  35. <select id="articleVideoAuditList"
  36. resultType="com.tzld.longarticle.recommend.server.model.vo.ArticleVideoAuditListVO">
  37. select lata.content_id, lata.status, lat.article_title as title, lat.kimi_title,
  38. lata.audit_account, lata.audit_timestamp, lata.flow_pool_level
  39. from long_articles_title_audit lata
  40. left join long_articles_text lat on lata.content_id = lat.content_id
  41. <where>
  42. <if test="status!= null and status.size() > 0">
  43. and lata.status in
  44. <foreach collection="status" item="item" separator="," open="(" close=")">
  45. #{item}
  46. </foreach>
  47. </if>
  48. <if test="contentId!= null and contentId.size() > 0">
  49. and lata.content_id in
  50. <foreach collection="contentId" item="item" separator="," open="(" close=")">
  51. #{item}
  52. </foreach>
  53. </if>
  54. <if test="title!= null and title.size() > 0">
  55. and lat.article_title in
  56. <foreach collection="title" item="item" separator="," open="(" close=")">
  57. #{item}
  58. </foreach>
  59. </if>
  60. <if test="auditAccount!= null and auditAccount.size() > 0">
  61. and lata.audit_account in
  62. <foreach collection="auditAccount" item="item" separator="," open="(" close=")">
  63. #{item}
  64. </foreach>
  65. </if>
  66. </where>
  67. <choose>
  68. <when test="poolLevelDesc != null and poolLevelDesc != ''">
  69. order by lata.flow_pool_level ${poolLevelDesc}, lata.content_id desc
  70. </when>
  71. <otherwise>
  72. order by lata.content_id desc
  73. </otherwise>
  74. </choose>
  75. limit #{offset}, #{pageSize}
  76. </select>
  77. <update id="updateCrawlerVideoIsIllegal">
  78. update long_articles_crawler_videos
  79. set is_illegal = #{isIllegal}
  80. where id in
  81. <foreach collection="ids" item="id" open="(" close=")">
  82. #{id}
  83. </foreach>
  84. </update>
  85. <select id="searchFilterValueByItemName" resultType="java.lang.String">
  86. <choose>
  87. <when test="itemName == 'contentId'">
  88. select content_id
  89. from long_articles_title_audit
  90. <where>
  91. <if test="searchKeyword != null and searchKeyword !=''">
  92. and content_id like concat('%', #{searchKeyword}, '%')
  93. </if>
  94. </where>
  95. order by create_timestamp desc
  96. limit 100
  97. </when>
  98. <when test="itemName == 'auditAccount'">
  99. select distinct audit_account
  100. from long_articles_title_audit
  101. <where>
  102. <if test="searchKeyword != null and searchKeyword !=''">
  103. and audit_account like concat('%', #{searchKeyword}, '%')
  104. </if>
  105. </where>
  106. order by create_timestamp desc
  107. limit 100
  108. </when>
  109. <when test="itemName == 'title'">
  110. select distinct long_articles_text.article_title
  111. from long_articles_title_audit
  112. left join long_articles_text on long_articles_title_audit.content_id = long_articles_text.content_id
  113. <where>
  114. <if test="searchKeyword != null and searchKeyword !=''">
  115. and long_articles_text.article_title like concat('%', #{searchKeyword}, '%')
  116. </if>
  117. </where>
  118. order by long_articles_title_audit.create_timestamp desc
  119. limit 100
  120. </when>
  121. </choose>
  122. </select>
  123. <update id="updateArticleTitle">
  124. update long_articles_text
  125. set old_article_title = article_title,
  126. article_title = #{param.title},
  127. article_title_update_account = #{param.updateAccount},
  128. article_title_update_timestamp = #{updateTime}
  129. where content_id = #{param.contentId}
  130. </update>
  131. <update id="updateVideoTitle">
  132. update long_articles_text
  133. set old_kimi_title = kimi_title,
  134. kimi_title = #{param.title},
  135. kimi_title_update_account = #{param.updateAccount},
  136. kimi_title_update_timestamp = #{updateTime}
  137. where content_id = #{param.contentId}
  138. </update>
  139. <update id="updateTitleAuditFlowPoolLevel">
  140. update long_articles_title_audit lat
  141. join ( SELECT DISTINCT lamv.content_id, lamv.flow_pool_level
  142. FROM long_articles_match_videos lamv
  143. JOIN long_articles_title_audit lata ON lamv.content_id = lata.content_id
  144. where lata.flow_pool_level is null) lamv ON lat.content_id = lamv.content_id
  145. set lat.flow_pool_level = lamv.flow_pool_level
  146. where lat.flow_pool_level is null
  147. </update>
  148. </mapper>