VideoPoolAuditMapper.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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 = 0 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 = 0 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="searchFilterValueByItemName" resultType="java.lang.String">
  85. <choose>
  86. <when test="itemName == 'contentId'">
  87. select content_trace_id
  88. from publish_single_video_source
  89. <where>
  90. <if test="searchKeyword != null and searchKeyword !=''">
  91. and content_trace_id like concat('%', #{searchKeyword}, '%')
  92. </if>
  93. </where>
  94. order by crawler_timestamp desc
  95. limit 100
  96. </when>
  97. <when test="itemName == 'auditAccount'">
  98. select distinct video_pool_audit_account
  99. from publish_single_video_source
  100. <where>
  101. <if test="searchKeyword != null and searchKeyword !=''">
  102. and video_pool_audit_account like concat('%', #{searchKeyword}, '%')
  103. </if>
  104. </where>
  105. order by crawler_timestamp desc
  106. limit 100
  107. </when>
  108. <when test="itemName == 'title'">
  109. select distinct article_title
  110. from publish_single_video_source
  111. <where>
  112. <if test="searchKeyword != null and searchKeyword !=''">
  113. and article_title like concat('%', #{searchKeyword}, '%')
  114. </if>
  115. </where>
  116. order by crawler_timestamp desc
  117. limit 100
  118. </when>
  119. </choose>
  120. </select>
  121. <update id="updateArticleTitle">
  122. update publish_single_video_source
  123. set old_article_title = article_title,
  124. article_title = #{param.title},
  125. article_title_update_account = #{param.updateAccount},
  126. article_title_update_timestamp = #{updateTime}
  127. where content_trace_id = #{param.contentId}
  128. </update>
  129. <update id="updateVideoTitle">
  130. update publish_single_video_source
  131. set old_mini_program_title = mini_program_title,
  132. mini_program_title = #{param.title},
  133. mini_program_title_update_account = #{param.updateAccount},
  134. mini_program_title_update_timestamp = #{updateTime}
  135. where content_trace_id = #{param.contentId}
  136. </update>
  137. </mapper>