ImLiveBroadcastRoomMapper.xml 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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.ImLiveBroadcastRoomDao">
  4. <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.ImLiveBroadcastRoom">
  5. <id column="id_" jdbcType="INTEGER" property="id"/>
  6. <result column="tenant_id_" jdbcType="INTEGER" property="tenantId"/>
  7. <result column="speaker_id_" jdbcType="INTEGER" property="speakerId"/>
  8. <result column="room_uid_" jdbcType="VARCHAR" property="roomUid"/>
  9. <result column="room_title_" jdbcType="VARCHAR" property="roomTitle"/>
  10. <result column="live_start_time_" jdbcType="TIMESTAMP" property="liveStartTime"/>
  11. <result column="live_end_time_" jdbcType="TIMESTAMP" property="liveEndTime"/>
  12. <result column="live_remark_" jdbcType="VARCHAR" property="liveRemark"/>
  13. <result column="pre_template_" jdbcType="VARCHAR" property="preTemplate"/>
  14. <result column="room_config_" jdbcType="VARCHAR" property="roomConfig"/>
  15. <result column="live_state_" jdbcType="INTEGER" property="liveState"/>
  16. <result column="room_state_" jdbcType="INTEGER" property="roomState"/>
  17. <result column="created_by_" jdbcType="INTEGER" property="createdBy"/>
  18. <result column="created_time_" jdbcType="TIMESTAMP" property="createdTime"/>
  19. <result column="updated_by_" jdbcType="INTEGER" property="updatedBy"/>
  20. <result column="updated_time_" jdbcType="TIMESTAMP" property="updatedTime"/>
  21. </resultMap>
  22. <sql id="Base_Column_List">
  23. id_
  24. , tenant_id_, speaker_id_, room_uid_, room_title_, live_start_time_, live_end_time_, live_remark_, pre_template_, room_config_, live_state_, room_state_, created_by_, created_time_, updated_by_, updated_time_
  25. </sql>
  26. <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
  27. parameterType="com.ym.mec.biz.dal.entity.ImLiveBroadcastRoom">
  28. insert into im_live_broadcast_room(tenant_id_, speaker_id_, room_uid_, room_title_, live_start_time_,
  29. live_end_time_, live_remark_, pre_template_, room_config_, live_state_, room_state_, created_by_, created_time_,
  30. updated_by_, updated_time_)
  31. values
  32. <foreach collection="entities" item="entity" separator=",">
  33. (#{entity.tenantId}, #{entity.speakerId}, #{entity.roomUid}, #{entity.roomTitle}, #{entity.liveStartTime},
  34. #{entity.liveEndTime}, #{entity.liveRemark}, #{entity.preTemplate}, #{entity.roomConfig},
  35. #{entity.liveState}, #{entity.roomState}, #{entity.createdBy}, #{entity.createdTime}, #{entity.updatedBy},
  36. #{entity.updatedTime})
  37. </foreach>
  38. </insert>
  39. <select id="queryPage" resultType="com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo">
  40. select a.id_ AS id,
  41. a.tenant_id_ AS tenantId,
  42. t.name_ AS tenantName,
  43. t.logo_ AS tenantLogo,
  44. a.room_uid_ AS roomUid,
  45. a.room_title_ AS roomTitle,
  46. a.live_remark_ AS liveRemark,
  47. a.speaker_id_ AS speakerId,
  48. b.real_name_ AS speakerName,
  49. b.avatar_ AS speakerPic,
  50. a.live_start_time_ AS liveStartTime,
  51. a.live_state_ AS liveState,
  52. a.room_state_ AS roomState,
  53. c.real_name_ AS createdByName,
  54. a.pre_template_ AS preTemplate,
  55. a.room_config_ AS roomConfig
  56. from im_live_broadcast_room as a
  57. left join tenant_info AS t on a.tenant_id_ = t.id_
  58. left join sys_user AS b on a.speaker_id_ = b.id_
  59. left join sys_user AS c on a.created_by_ = b.id_
  60. <where>
  61. a.room_state_ = 0
  62. <if test="param.search != null ">
  63. AND (
  64. a.`room_uid_` LIKE CONCAT('%', #{param.search},'%')
  65. OR a.`room_title_` LIKE CONCAT('%', #{param.search},'%')
  66. )
  67. </if>
  68. <if test="param.roomUid != null">
  69. and a.room_uid_ = #{param.roomUid}
  70. </if>
  71. <if test="param.liveState != null">
  72. and a.live_state_ = #{param.liveState}
  73. </if>
  74. <if test="param.startTime != null">
  75. <![CDATA[ AND a.live_start_time_ >= #{param.startTime} ]]>
  76. </if>
  77. <if test="param.endTime != null">
  78. <![CDATA[ AND a.live_start_time_ <= #{param.endTime} ]]>
  79. </if>
  80. </where>
  81. </select>
  82. </mapper>