123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.ym.mec.biz.dal.dao.ImLiveBroadcastRoomDao">
- <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.ImLiveBroadcastRoom">
- <id column="id_" jdbcType="INTEGER" property="id"/>
- <result column="tenant_id_" jdbcType="INTEGER" property="tenantId"/>
- <result column="speaker_id_" jdbcType="INTEGER" property="speakerId"/>
- <result column="room_uid_" jdbcType="VARCHAR" property="roomUid"/>
- <result column="room_title_" jdbcType="VARCHAR" property="roomTitle"/>
- <result column="live_start_time_" jdbcType="TIMESTAMP" property="liveStartTime"/>
- <result column="live_end_time_" jdbcType="TIMESTAMP" property="liveEndTime"/>
- <result column="live_remark_" jdbcType="VARCHAR" property="liveRemark"/>
- <result column="pre_template_" jdbcType="VARCHAR" property="preTemplate"/>
- <result column="room_config_" jdbcType="VARCHAR" property="roomConfig"/>
- <result column="live_state_" jdbcType="INTEGER" property="liveState"/>
- <result column="room_state_" jdbcType="INTEGER" property="roomState"/>
- <result column="popularize_" jdbcType="INTEGER" property="popularize"/>
- <result column="created_by_" jdbcType="INTEGER" property="createdBy"/>
- <result column="created_time_" jdbcType="TIMESTAMP" property="createdTime"/>
- <result column="updated_by_" jdbcType="INTEGER" property="updatedBy"/>
- <result column="updated_time_" jdbcType="TIMESTAMP" property="updatedTime"/>
- </resultMap>
- <sql id="Base_Column_List">
- id_
- , 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_
- </sql>
- <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
- parameterType="com.ym.mec.biz.dal.entity.ImLiveBroadcastRoom">
- insert into im_live_broadcast_room(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_)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.tenantId}, #{entity.speakerId}, #{entity.roomUid}, #{entity.roomTitle}, #{entity.liveStartTime},
- #{entity.liveEndTime}, #{entity.liveRemark}, #{entity.preTemplate}, #{entity.roomConfig},
- #{entity.liveState}, #{entity.roomState}, #{entity.popularize}, #{entity.createdBy}, #{entity.createdTime}, #{entity.updatedBy},
- #{entity.updatedTime})
- </foreach>
- </insert>
- <select id="queryPage" resultType="com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo">
- select a.id_ AS id,
- a.tenant_id_ AS tenantId,
- t.name_ AS tenantName,
- t.logo_ AS tenantLogo,
- a.room_uid_ AS roomUid,
- a.room_title_ AS roomTitle,
- a.live_remark_ AS liveRemark,
- a.speaker_id_ AS speakerId,
- b.real_name_ AS speakerName,
- b.im_token_ as imToken,
- b.avatar_ AS speakerPic,
- a.live_start_time_ AS liveStartTime,
- a.live_state_ AS liveState,
- a.room_state_ AS roomState,
- c.real_name_ AS createdByName,
- a.pre_template_ AS preTemplate,
- a.room_config_ AS roomConfig,
- a.popularize_ AS popularize
- from im_live_broadcast_room as a
- left join tenant_info AS t on a.tenant_id_ = t.id_
- left join sys_user AS b on a.speaker_id_ = b.id_
- left join sys_user AS c on a.created_by_ = c.id_
- <where>
- a.room_state_ in(0, 2)
- <if test="param.search != null ">
- AND (
- a.`id_` LIKE CONCAT('%', #{param.search},'%')
- OR a.`room_title_` LIKE CONCAT('%', #{param.search},'%')
- )
- </if>
- <if test="param.tenantId != null ">
- AND a.tenant_id_ = #{param.tenantId}
- </if>
- <if test="param.roomUid != null">
- and a.room_uid_ = #{param.roomUid}
- </if>
- <if test="param.liveState != null">
- and a.live_state_ = #{param.liveState}
- </if>
- <if test="param.startTime != null">
- <![CDATA[ AND a.live_start_time_ >= #{param.startTime} ]]>
- </if>
- <if test="param.endTime != null">
- <![CDATA[ AND a.live_start_time_ <= #{param.endTime} ]]>
- </if>
- <if test="param.popularize != null">
- and a.popularize_ = #{param.popularize}
- </if>
- </where>
- </select>
- <select id="queryUserPageByTenantId" resultType="map">
- SELECT id_,username_
- FROM sys_user
- WHERE tenant_id_ = 1 and user_type_ = 'STUDENT' and lock_flag_=0 and del_flag_= 0 and is_super_admin_=0
- and username_ is not null and username_ != ''
- </select>
- <select id="queryBaseUserInfo" resultType="com.ym.mec.biz.dal.vo.BaseRoomUserVo">
- select
- id_ AS userId,
- username_ AS userName
- from sys_user
- <where>
- id_ IN
- <foreach collection="list" item="id" open="(" separator="," close=")">
- #{id}
- </foreach>
- </where>
- </select>
- </mapper>
|