LiveRoomVideoMapper.xml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  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.yonge.cooleshow.biz.dal.dao.LiveRoomVideoDao">
  4. <resultMap id="BaseResultMap" type="com.yonge.cooleshow.biz.dal.entity.LiveRoomVideo">
  5. <id column="id_" jdbcType="INTEGER" property="id"/>
  6. <result column="course_group_id_" jdbcType="INTEGER" property="courseGroupId"/>
  7. <result column="course_id_" jdbcType="INTEGER" property="courseId"/>
  8. <result column="room_uid_" jdbcType="VARCHAR" property="roomUid"/>
  9. <result column="record_id_" jdbcType="VARCHAR" property="recordId"/>
  10. <result column="url_" jdbcType="VARCHAR" property="url"/>
  11. <result column="start_time_" jdbcType="TIMESTAMP" property="startTime"/>
  12. <result column="end_time_" jdbcType="TIMESTAMP" property="endTime"/>
  13. <result column="type" jdbcType="INTEGER" property="type"/>
  14. <result column="created_time_" jdbcType="TIMESTAMP" property="createdTime"/>
  15. </resultMap>
  16. <sql id="Base_Column_List">
  17. id_
  18. , course_group_id_, course_id_, room_uid_, record_id_, url_, start_time_, end_time_, type, created_time_
  19. </sql>
  20. <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
  21. parameterType="com.yonge.cooleshow.biz.dal.entity.LiveRoomVideo">
  22. insert into live_room_video(course_group_id_, course_id_, room_uid_, record_id_, url_, start_time_, end_time_,
  23. type, created_time_)
  24. values
  25. <foreach collection="entities" item="entity" separator=",">
  26. (#{entity.courseGroupId}, #{entity.courseId}, #{entity.roomUid}, #{entity.recordId}, #{entity.url},
  27. #{entity.startTime}, #{entity.endTime}, #{entity.type}, #{entity.createdTime})
  28. </foreach>
  29. </insert>
  30. <select id="getLastRecord" resultMap="BaseResultMap">
  31. SELECT * FROM live_room_video WHERE room_uid_ = #{roomId} AND record_id_ = #{recordId} ORDER BY id_ DESC LIMIT 1
  32. </select>
  33. </mapper>