ThirdPartWeComVideoMapperExt.xml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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.piaoquan.api.dao.mapper.wecom.thirdpart.ext.ThirdPartWeComVideoMapperExt">
  4. <insert id="batchInsertThirdPartWeComVideo">
  5. insert into third_part_we_com_video (dt, video_id, category, title, cover, video, score, create_timestamp)
  6. values
  7. <foreach collection="records" item="item" separator=",">
  8. (#{item.dt}, #{item.videoId}, #{item.category}, #{item.title}, #{item.cover}, #{item.video}, #{item.score},
  9. #{item.createTimestamp})
  10. </foreach>
  11. </insert>
  12. <select id="getVideoMaxDt" resultType="java.lang.String">
  13. select max(dt)
  14. from third_part_we_com_video
  15. </select>
  16. <update id="updateOtherVideoStatus">
  17. update third_part_we_com_video
  18. set status = 0,
  19. update_timestamp = #{now}
  20. where dt = #{dt} and video_id not in
  21. <foreach collection="videoIdList" item="item" open="(" close=")" separator=",">
  22. #{item}
  23. </foreach>
  24. </update>
  25. <update id="updateVideoStatusWithOldStatus">
  26. update third_part_we_com_video
  27. set status = #{status},
  28. update_timestamp = #{now}
  29. where video_id = #{videoId}
  30. and status = #{oldStatus}
  31. </update>
  32. <select id="getVideoMinScoreList" resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
  33. select *
  34. from third_part_we_com_video video
  35. where video.dt = #{dt} and video.status = 1
  36. and video.video_id not in (select video_id from third_part_we_com_msg where send_userid = #{roomId} and video_id is not null)
  37. order by ${sort}
  38. limit #{offset}, #{pageSize}
  39. </select>
  40. </mapper>