ImLiveBroadcastRoomMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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="popularize_" jdbcType="INTEGER" property="popularize"/>
  18. <result column="created_by_" jdbcType="INTEGER" property="createdBy"/>
  19. <result column="created_time_" jdbcType="TIMESTAMP" property="createdTime"/>
  20. <result column="updated_by_" jdbcType="INTEGER" property="updatedBy"/>
  21. <result column="updated_time_" jdbcType="TIMESTAMP" property="updatedTime"/>
  22. </resultMap>
  23. <sql id="Base_Column_List">
  24. id_
  25. , tenant_id_, speaker_id_, room_uid_, room_title_, live_start_time_, live_end_time_, live_remark_, pre_template_, room_config_, live_state_, room_state_, popularize_, created_by_, created_time_, updated_by_, updated_time_
  26. </sql>
  27. <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
  28. parameterType="com.ym.mec.biz.dal.entity.ImLiveBroadcastRoom">
  29. insert into im_live_broadcast_room(tenant_id_, speaker_id_, room_uid_, room_title_, live_start_time_,
  30. live_end_time_, live_remark_, pre_template_, room_config_, live_state_, room_state_, popularize_, created_by_, created_time_,
  31. updated_by_, updated_time_)
  32. values
  33. <foreach collection="entities" item="entity" separator=",">
  34. (#{entity.tenantId}, #{entity.speakerId}, #{entity.roomUid}, #{entity.roomTitle}, #{entity.liveStartTime},
  35. #{entity.liveEndTime}, #{entity.liveRemark}, #{entity.preTemplate}, #{entity.roomConfig},
  36. #{entity.liveState}, #{entity.roomState}, #{entity.popularize}, #{entity.createdBy}, #{entity.createdTime}, #{entity.updatedBy},
  37. #{entity.updatedTime})
  38. </foreach>
  39. </insert>
  40. <select id="queryPage" resultType="com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo">
  41. select a.id_ AS id,
  42. a.tenant_id_ AS tenantId,
  43. t.name_ AS tenantName,
  44. t.logo_ AS tenantLogo,
  45. a.room_uid_ AS roomUid,
  46. a.room_title_ AS roomTitle,
  47. a.live_remark_ AS liveRemark,
  48. a.speaker_id_ AS speakerId,
  49. b.real_name_ AS speakerName,
  50. b.im_token_ as imToken,
  51. b.avatar_ AS speakerPic,
  52. a.live_start_time_ AS liveStartTime,
  53. a.live_state_ AS liveState,
  54. a.room_state_ AS roomState,
  55. c.real_name_ AS createdByName,
  56. a.pre_template_ AS preTemplate,
  57. a.room_config_ AS roomConfig,
  58. a.popularize_ AS popularize
  59. from im_live_broadcast_room as a
  60. left join tenant_info AS t on a.tenant_id_ = t.id_
  61. left join sys_user AS b on a.speaker_id_ = b.id_
  62. left join sys_user AS c on a.created_by_ = c.id_
  63. <where>
  64. a.room_state_ in(0, 2)
  65. <if test="param.search != null ">
  66. AND (
  67. a.`id_` LIKE CONCAT('%', #{param.search},'%')
  68. OR a.`room_title_` LIKE CONCAT('%', #{param.search},'%')
  69. )
  70. </if>
  71. <if test="param.tenantId != null ">
  72. AND a.tenant_id_ = #{param.tenantId}
  73. </if>
  74. <if test="param.roomUid != null">
  75. and a.room_uid_ = #{param.roomUid}
  76. </if>
  77. <if test="param.liveState != null">
  78. and a.live_state_ = #{param.liveState}
  79. </if>
  80. <if test="param.startTime != null">
  81. <![CDATA[ AND a.live_start_time_ >= #{param.startTime} ]]>
  82. </if>
  83. <if test="param.endTime != null">
  84. <![CDATA[ AND a.live_start_time_ <= #{param.endTime} ]]>
  85. </if>
  86. <if test="param.popularize != null">
  87. and a.popularize_ = #{param.popularize}
  88. </if>
  89. </where>
  90. </select>
  91. <select id="queryUserPageByTenantId" resultType="map">
  92. SELECT id_,username_
  93. FROM sys_user
  94. WHERE tenant_id_ = 1 and user_type_ = 'STUDENT' and lock_flag_=0 and del_flag_= 0 and is_super_admin_=0
  95. and username_ is not null and username_ != ''
  96. </select>
  97. <select id="queryBaseUserInfo" resultType="com.ym.mec.biz.dal.vo.BaseRoomUserVo">
  98. select
  99. id_ AS userId,
  100. username_ AS userName
  101. from sys_user
  102. <where>
  103. id_ IN
  104. <foreach collection="list" item="id" open="(" separator="," close=")">
  105. #{id}
  106. </foreach>
  107. </where>
  108. </select>
  109. </mapper>