ArticleAuditMapper.xml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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(long_articles_title_audit.content_id)
  6. from long_articles_title_audit
  7. left join long_articles_text on long_articles_title_audit.content_id = long_articles_text.content_id
  8. <where>
  9. <if test="status!= null and status.size() > 0">
  10. and long_articles_title_audit.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 long_articles_title_audit.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 long_articles_text.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 long_articles_title_audit.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 long_articles_title_audit.content_id, long_articles_title_audit.status,
  38. long_articles_text.article_title as title, long_articles_text.kimi_title,
  39. long_articles_title_audit.audit_account, long_articles_title_audit.audit_timestamp
  40. from long_articles_title_audit
  41. left join long_articles_text on long_articles_title_audit.content_id = long_articles_text.content_id
  42. <where>
  43. <if test="status!= null and status.size() > 0">
  44. and long_articles_title_audit.status in
  45. <foreach collection="status" item="item" separator="," open="(" close=")">
  46. #{item}
  47. </foreach>
  48. </if>
  49. <if test="contentId!= null and contentId.size() > 0">
  50. and long_articles_title_audit.content_id in
  51. <foreach collection="contentId" item="item" separator="," open="(" close=")">
  52. #{item}
  53. </foreach>
  54. </if>
  55. <if test="title!= null and title.size() > 0">
  56. and long_articles_text.article_title in
  57. <foreach collection="title" item="item" separator="," open="(" close=")">
  58. #{item}
  59. </foreach>
  60. </if>
  61. <if test="auditAccount!= null and auditAccount.size() > 0">
  62. and long_articles_title_audit.audit_account in
  63. <foreach collection="auditAccount" item="item" separator="," open="(" close=")">
  64. #{item}
  65. </foreach>
  66. </if>
  67. </where>
  68. order by long_articles_title_audit.content_id desc
  69. limit #{offset}, #{pageSize}
  70. </select>
  71. <update id="updateCrawlerVideoIsIllegal">
  72. update long_articles_crawler_videos
  73. set is_illegal = #{isIllegal}
  74. where id in
  75. <foreach collection="ids" item="id" open="(" close=")">
  76. #{id}
  77. </foreach>
  78. </update>
  79. <select id="searchFilterValueByItemName" resultType="java.lang.String">
  80. <choose>
  81. <when test="itemName == 'contentId'">
  82. select content_id
  83. from long_articles_title_audit
  84. <where>
  85. <if test="searchKeyword != null and searchKeyword !=''">
  86. and content_id like concat('%', #{searchKeyword}, '%')
  87. </if>
  88. </where>
  89. order by create_timestamp desc
  90. limit 100
  91. </when>
  92. <when test="itemName == 'auditAccount'">
  93. select distinct audit_account
  94. from long_articles_title_audit
  95. <where>
  96. <if test="searchKeyword != null and searchKeyword !=''">
  97. and audit_account like concat('%', #{searchKeyword}, '%')
  98. </if>
  99. </where>
  100. order by create_timestamp desc
  101. limit 100
  102. </when>
  103. <when test="itemName == 'title'">
  104. select distinct long_articles_text.article_title
  105. from long_articles_title_audit
  106. left join long_articles_text on long_articles_title_audit.content_id = long_articles_text.content_id
  107. <where>
  108. <if test="searchKeyword != null and searchKeyword !=''">
  109. and long_articles_text.article_title like concat('%', #{searchKeyword}, '%')
  110. </if>
  111. </where>
  112. order by long_articles_title_audit.create_timestamp desc
  113. limit 100
  114. </when>
  115. </choose>
  116. </select>
  117. <update id="updateArticleTitle">
  118. update long_articles_text
  119. set old_article_title = article_title,
  120. article_title = #{param.title},
  121. article_title_update_account = #{param.updateAccount},
  122. article_title_update_timestamp = #{updateTime}
  123. where content_id = #{param.contentId}
  124. </update>
  125. <update id="updateVideoTitle">
  126. update long_articles_text
  127. set old_kimi_title = kimi_title,
  128. kimi_title = #{param.title},
  129. kimi_title_update_account = #{param.updateAccount},
  130. kimi_title_update_timestamp = #{updateTime}
  131. where content_id = #{param.contentId}
  132. </update>
  133. </mapper>