|
@@ -15,28 +15,28 @@
|
|
|
<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="popularize_type_" jdbcType="VARCHAR" property="popularizeType"/>
|
|
|
+ <result column="popularize_org_ids_" jdbcType="VARCHAR" property="popularizeOrgIds"/>
|
|
|
+ <result column="popularize_school_ids_" jdbcType="VARCHAR" property="popularizeSchoolIds"/>
|
|
|
<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_)
|
|
|
+ live_end_time_, live_remark_, pre_template_, room_config_, live_state_, room_state_,
|
|
|
+ popularize_, popularize_type_,popularize_org_ids_,popularize_school_ids_,
|
|
|
+ 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})
|
|
|
+ #{entity.liveState}, #{entity.roomState}, #{entity.popularize},
|
|
|
+ #{entity.popularizeType},#{entity.popularizeOrgIds},#{entity.popularizeSchoolIds},
|
|
|
+ #{entity.createdBy}, #{entity.createdTime}, #{entity.updatedBy},#{entity.updatedTime})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
@@ -58,8 +58,31 @@
|
|
|
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
|
|
|
+ a.popularize_ AS popularize,
|
|
|
+ a.popularize_type_ AS popularizeType,
|
|
|
+ a.popularize_org_ids_ AS popularizeOrgIds,
|
|
|
+ a.popularize_school_ids_ AS popularizeSchoolIds
|
|
|
+ from (
|
|
|
+ select *
|
|
|
+ from im_live_broadcast_room
|
|
|
+ <if test="param.allRoom == null">
|
|
|
+ where popularize_type_ = 'ALL'
|
|
|
+ </if>
|
|
|
+ <if test="param.organIds != null">
|
|
|
+ union all
|
|
|
+ select *
|
|
|
+ from im_live_broadcast_room as a
|
|
|
+ where popularize_type_ = 'ORGAN'
|
|
|
+ and INTE_ARRAY(a.popularize_org_ids_, #{param.organIds}) = 1
|
|
|
+ </if>
|
|
|
+ <if test="param.organIds != null">
|
|
|
+ union all
|
|
|
+ select *
|
|
|
+ from im_live_broadcast_room as a
|
|
|
+ where popularize_type_ = 'SCHOOL'
|
|
|
+ and INTE_ARRAY(a.popularize_school_ids_, #{param.schoolIds}) = 1
|
|
|
+ </if>
|
|
|
+ ) 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_
|
|
@@ -94,17 +117,22 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="queryUserPageByTenantId" resultType="map">
|
|
|
- SELECT id_,username_
|
|
|
+ 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_ != ''
|
|
|
+ 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
|
|
|
+ select
|
|
|
id_ AS userId,
|
|
|
username_ AS userName
|
|
|
- from sys_user
|
|
|
+ from sys_user
|
|
|
<where>
|
|
|
id_ IN
|
|
|
<foreach collection="list" item="id" open="(" separator="," close=")">
|
|
@@ -116,23 +144,26 @@
|
|
|
<select id="queryRoomUser" resultType="com.ym.mec.biz.dal.vo.RoomReservationUserVo">
|
|
|
|
|
|
select
|
|
|
- su.id_ as userId
|
|
|
- ,su.username_ as username
|
|
|
- ,su.phone_ as phone
|
|
|
- ,su.organ_id_ as organId
|
|
|
- ,o.name_ as organName
|
|
|
- ,(select group_concat(sub.name_) from subject sub
|
|
|
- where find_in_set(sub.id_,s.subject_id_list_) and sub.del_flag_ = 0 ) as subjectName
|
|
|
+ su.id_ as userId
|
|
|
+ ,su.username_ as username
|
|
|
+ ,su.phone_ as phone
|
|
|
+ ,su.organ_id_ as organId
|
|
|
+ ,o.name_ as organName
|
|
|
+ ,(select group_concat(sub.name_) from subject sub
|
|
|
+ where find_in_set(sub.id_,s.subject_id_list_) and sub.del_flag_ = 0 ) as subjectName
|
|
|
from im_live_room_reservation ilrr
|
|
|
left join sys_user su on su.id_ = ilrr.user_id_
|
|
|
left join organization o on o.id_ = su.organ_id_
|
|
|
left join student s on s.user_id_ = su.id_
|
|
|
where ilrr.room_uid_ = #{query.roomUid}
|
|
|
- <if test="query.search != null and query.search != ''">
|
|
|
- and (su.id_ like concat('%',#{query.search},'%')
|
|
|
- or su.phone_ like concat('%',#{query.search},'%')
|
|
|
- or su.username_ like concat('%',#{query.search},'%'))
|
|
|
- </if>
|
|
|
+ <if test="query.search != null and query.search != ''">
|
|
|
+ and (su.id_ like concat('%',#{query.search},'%')
|
|
|
+ or su.phone_ like concat('%',#{query.search},'%')
|
|
|
+ or su.username_ like concat('%',#{query.search},'%'))
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
+ <select id="querySchoolIds" resultType="string">
|
|
|
+ select GROUP_CONCAT(id_) from cooperation_organ where find_in_set(organ_id_,#{organIds})
|
|
|
</select>
|
|
|
</mapper>
|