ImLiveRoomVideoMapper.xml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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.ym.mec.biz.dal.dao.ImLiveRoomVideoDao">
  4. <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.ImLiveRoomVideo">
  5. <id column="id_" jdbcType="INTEGER" property="id"/>
  6. <result column="room_uid_" jdbcType="VARCHAR" property="roomUid"/>
  7. <result column="record_id_" jdbcType="VARCHAR" property="recordId"/>
  8. <result column="url_" jdbcType="VARCHAR" property="url"/>
  9. <result column="start_time_" jdbcType="TIMESTAMP" property="startTime"/>
  10. <result column="end_time_" jdbcType="TIMESTAMP" property="endTime"/>
  11. <result column="type" jdbcType="INTEGER" property="type"/>
  12. <result column="created_time_" jdbcType="TIMESTAMP" property="createdTime"/>
  13. </resultMap>
  14. <sql id="Base_Column_List">
  15. id_
  16. , room_uid_, record_id_, url_, start_time_, end_time_, type, created_time_
  17. </sql>
  18. <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
  19. parameterType="com.ym.mec.biz.dal.entity.ImLiveRoomVideo">
  20. insert into im_live_room_video(room_uid_, record_id_, url_, start_time_, end_time_, type,
  21. created_time_)
  22. values
  23. <foreach collection="entities" item="entity" separator=",">
  24. (#{entity.roomUid}, #{entity.recordId}, #{entity.url}, #{entity.startTime},
  25. #{entity.endTime}, #{entity.type}, #{entity.createdTime})
  26. </foreach>
  27. </insert>
  28. <select id="getLastRecord" resultMap="BaseResultMap">
  29. SELECT * FROM im_live_room_video WHERE room_uid_ = #{roomId} AND record_id_ = #{recordId} ORDER BY id_ DESC LIMIT 1
  30. </select>
  31. <select id="queryVideoList" parameterType="object" resultType="com.ym.mec.biz.dal.vo.ImLiveRoomVideoVo">
  32. select a.*,b.os_ as os
  33. from im_live_room_video a
  34. left join im_live_broadcast_room b on a.room_uid_ = b.room_uid_
  35. where a.room_uid_ = #{roomUid}
  36. and a.type = 2
  37. </select>
  38. <select id="queryByRoomIds" resultType="com.ym.mec.biz.dal.vo.ImLiveRoomVideoVo">
  39. select * from im_live_room_video
  40. where room_uid_ in
  41. <foreach collection="roomIds" item="roomId" open="(" separator="," close=")">
  42. #{roomId}
  43. </foreach>
  44. </select>
  45. </mapper>