ArticleAuditMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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. <if test="producePlanIds!= null and producePlanIds.size() > 0">
  34. and lata.produce_plan_id in
  35. <foreach collection="producePlanIds" item="item" separator="," open="(" close=")">
  36. #{item}
  37. </foreach>
  38. </if>
  39. <if test="flowPoolLevel!= null and flowPoolLevel.size() > 0">
  40. and lata.flow_pool_level in
  41. <foreach collection="flowPoolLevel" item="item" separator="," open="(" close=")">
  42. #{item}
  43. </foreach>
  44. </if>
  45. <if test="auditTimestamp!= null">
  46. <if test="auditTimestamp.conditionOperator != null and auditTimestamp.conditionOperator != ''">
  47. <choose>
  48. <when test="auditTimestamp.conditionOperator == '早于'">
  49. and lata.audit_timestamp <![CDATA[ < ]]> #{auditTimestamp.conditionValue1}
  50. </when>
  51. <when test="auditTimestamp.conditionOperator == '等于'">
  52. and lata.audit_timestamp <![CDATA[ = ]]> #{auditTimestamp.conditionValue1}
  53. </when>
  54. <when test="auditTimestamp.conditionOperator == '晚于'">
  55. and lata.audit_timestamp <![CDATA[ > ]]> #{auditTimestamp.conditionValue1}
  56. </when>
  57. <when test="auditTimestamp.conditionOperator == '介于'">
  58. and lata.audit_timestamp BETWEEN #{auditTimestamp.conditionValue1} AND #{auditTimestamp.conditionValue2}
  59. </when>
  60. </choose>
  61. </if>
  62. </if>
  63. </where>
  64. </select>
  65. <select id="articleVideoAuditList"
  66. resultType="com.tzld.longarticle.recommend.server.model.vo.ArticleVideoAuditListVO">
  67. select lata.content_id, lata.status, lat.article_title as title, lat.kimi_title,
  68. lata.audit_account, lata.audit_timestamp, lata.flow_pool_level
  69. from long_articles_title_audit lata
  70. left join long_articles_text lat on lata.content_id = lat.content_id
  71. <where>
  72. <if test="status!= null and status.size() > 0">
  73. and lata.status in
  74. <foreach collection="status" item="item" separator="," open="(" close=")">
  75. #{item}
  76. </foreach>
  77. </if>
  78. <if test="contentId!= null and contentId.size() > 0">
  79. and lata.content_id in
  80. <foreach collection="contentId" item="item" separator="," open="(" close=")">
  81. #{item}
  82. </foreach>
  83. </if>
  84. <if test="title!= null and title.size() > 0">
  85. and lat.article_title in
  86. <foreach collection="title" item="item" separator="," open="(" close=")">
  87. #{item}
  88. </foreach>
  89. </if>
  90. <if test="auditAccount!= null and auditAccount.size() > 0">
  91. and lata.audit_account in
  92. <foreach collection="auditAccount" item="item" separator="," open="(" close=")">
  93. #{item}
  94. </foreach>
  95. </if>
  96. <if test="producePlanIds!= null and producePlanIds.size() > 0">
  97. and lata.produce_plan_id in
  98. <foreach collection="producePlanIds" item="item" separator="," open="(" close=")">
  99. #{item}
  100. </foreach>
  101. </if>
  102. <if test="flowPoolLevel!= null and flowPoolLevel.size() > 0">
  103. and lata.flow_pool_level in
  104. <foreach collection="flowPoolLevel" item="item" separator="," open="(" close=")">
  105. #{item}
  106. </foreach>
  107. </if>
  108. <if test="auditTimestamp!= null">
  109. <if test="auditTimestamp.conditionOperator != null and auditTimestamp.conditionOperator != ''">
  110. <choose>
  111. <when test="auditTimestamp.conditionOperator == '早于'">
  112. and lata.audit_timestamp <![CDATA[ < ]]> #{auditTimestamp.conditionValue1}
  113. </when>
  114. <when test="auditTimestamp.conditionOperator == '等于'">
  115. and lata.audit_timestamp <![CDATA[ = ]]> #{auditTimestamp.conditionValue1}
  116. </when>
  117. <when test="auditTimestamp.conditionOperator == '晚于'">
  118. and lata.audit_timestamp <![CDATA[ > ]]> #{auditTimestamp.conditionValue1}
  119. </when>
  120. <when test="auditTimestamp.conditionOperator == '介于'">
  121. and lata.audit_timestamp BETWEEN #{auditTimestamp.conditionValue1} AND #{auditTimestamp.conditionValue2}
  122. </when>
  123. </choose>
  124. </if>
  125. </if>
  126. </where>
  127. <choose>
  128. <when test="poolLevelDesc != null and poolLevelDesc != ''">
  129. order by lata.flow_pool_level ${poolLevelDesc}, lata.content_id desc
  130. </when>
  131. <when test="auditTimestamp != null and auditTimestamp.orderType != null and auditTimestamp.orderType != ''">
  132. order by lata.audit_timestamp ${auditTimestamp.orderType}
  133. </when>
  134. <otherwise>
  135. order by lata.content_id desc
  136. </otherwise>
  137. </choose>
  138. limit #{offset}, #{pageSize}
  139. </select>
  140. <update id="updateCrawlerVideoIsIllegal">
  141. update long_articles_crawler_videos
  142. set is_illegal = #{isIllegal}
  143. where id in
  144. <foreach collection="ids" item="id" open="(" close=")">
  145. #{id}
  146. </foreach>
  147. </update>
  148. <select id="searchFilterValueByItemName" resultType="java.lang.String">
  149. <choose>
  150. <when test="itemName == 'contentId'">
  151. select content_id
  152. from long_articles_title_audit
  153. <where>
  154. <if test="searchKeyword != null and searchKeyword !=''">
  155. and content_id like concat('%', #{searchKeyword}, '%')
  156. </if>
  157. </where>
  158. order by create_timestamp desc
  159. limit 100
  160. </when>
  161. <when test="itemName == 'auditAccount'">
  162. select distinct audit_account
  163. from long_articles_title_audit
  164. <where>
  165. <if test="searchKeyword != null and searchKeyword !=''">
  166. and audit_account like concat('%', #{searchKeyword}, '%')
  167. </if>
  168. </where>
  169. order by create_timestamp desc
  170. limit 100
  171. </when>
  172. <when test="itemName == 'title'">
  173. select distinct long_articles_text.article_title
  174. from long_articles_title_audit
  175. left join long_articles_text on long_articles_title_audit.content_id = long_articles_text.content_id
  176. <where>
  177. <if test="searchKeyword != null and searchKeyword !=''">
  178. and long_articles_text.article_title like concat('%', #{searchKeyword}, '%')
  179. </if>
  180. </where>
  181. order by long_articles_title_audit.create_timestamp desc
  182. limit 100
  183. </when>
  184. <when test="itemName == 'sourceProducePlan'">
  185. select distinct produce_plan_id
  186. from long_articles_title_audit
  187. </when>
  188. </choose>
  189. </select>
  190. <select id="articleVideoAuditNext"
  191. resultType="com.tzld.longarticle.recommend.server.model.vo.ArticleVideoAuditListVO">
  192. select lata.content_id, lata.status, lat.article_title as title, lat.kimi_title,
  193. lata.audit_account, lata.audit_timestamp, lata.flow_pool_level
  194. from long_articles_title_audit lata
  195. left join long_articles_text lat on lata.content_id = lat.content_id
  196. <where>
  197. <if test="status!= null and status.size() > 0">
  198. and lata.status in
  199. <foreach collection="status" item="item" separator="," open="(" close=")">
  200. #{item}
  201. </foreach>
  202. </if>
  203. <if test="contentId!= null and contentId.size() > 0">
  204. and lata.content_id in
  205. <foreach collection="contentId" item="item" separator="," open="(" close=")">
  206. #{item}
  207. </foreach>
  208. </if>
  209. <if test="title!= null and title.size() > 0">
  210. and lat.article_title in
  211. <foreach collection="title" item="item" separator="," open="(" close=")">
  212. #{item}
  213. </foreach>
  214. </if>
  215. <if test="auditAccount!= null and auditAccount.size() > 0">
  216. and lata.audit_account in
  217. <foreach collection="auditAccount" item="item" separator="," open="(" close=")">
  218. #{item}
  219. </foreach>
  220. </if>
  221. <if test="producePlanIds!= null and producePlanIds.size() > 0">
  222. and lata.produce_plan_id in
  223. <foreach collection="producePlanIds" item="item" separator="," open="(" close=")">
  224. #{item}
  225. </foreach>
  226. </if>
  227. <if test="excludeContentIds!= null and excludeContentIds.size() > 0">
  228. and lata.content_id not in
  229. <foreach collection="excludeContentIds" item="item" separator="," open="(" close=")">
  230. #{item}
  231. </foreach>
  232. </if>
  233. <if test="poolLevel!= null and poolLevel !=''">
  234. and lata.flow_pool_level = #{poolLevel}
  235. </if>
  236. </where>
  237. order by lata.content_id desc
  238. limit 1
  239. </select>
  240. <update id="updateArticleTitle">
  241. update long_articles_text
  242. set old_article_title = article_title,
  243. article_title = #{param.title},
  244. article_title_update_account = #{param.updateAccount},
  245. article_title_update_timestamp = #{updateTime}
  246. where content_id = #{param.contentId}
  247. </update>
  248. <update id="updateVideoTitle">
  249. update long_articles_text
  250. set old_kimi_title = kimi_title,
  251. kimi_title = #{param.title},
  252. kimi_title_update_account = #{param.updateAccount},
  253. kimi_title_update_timestamp = #{updateTime}
  254. where content_id = #{param.contentId}
  255. </update>
  256. <update id="updateTitleAuditFlowPoolLevel">
  257. update long_articles_title_audit lat
  258. join ( SELECT DISTINCT lamv.content_id, lamv.flow_pool_level
  259. FROM long_articles_match_videos lamv
  260. JOIN long_articles_title_audit lata ON lamv.content_id = lata.content_id
  261. where lata.flow_pool_level is null) lamv ON lat.content_id = lamv.content_id
  262. set lat.flow_pool_level = lamv.flow_pool_level
  263. where lat.flow_pool_level is null
  264. </update>
  265. </mapper>