123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?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.juxiao.xchat.module.xbd.mapper.operation.ChannelRoomMapper" >
- <delete id="deleteByChannelId" parameterType="integer">
- DELETE FROM channel_room WHERE channel_id = #{id}
- </delete>
- <select id="listUidByChannelId" resultType="long">
- SELECT uid FROM channel_room WHERE channel_id = #{id}
- </select>
- <insert id="insertChannelRoom">
- INSERT INTO channel_room
- (channel_id, uid)
- VALUES
- <foreach item='value' index='index' collection='list' separator=','>
- (#{id}, #{value})
- </foreach>
- </insert>
- <select id="listByChannelId" resultType="com.juxiao.xchat.module.xbd.domain.operation.ChannelRoom">
- SELECT
- r.uid,
- r.room_id AS roomId,
- r.tag_id AS tagId,
- r.room_tag AS roomTag,
- r.avatar AS avatar,
- r.type AS type,
- r.title AS title,
- u.erban_no AS erbanNo
- FROM room r
- LEFT JOIN users u ON u.uid = r.uid
- LEFT JOIN channel_room cr ON cr.uid = r.uid
- WHERE cr.channel_id = #{channelId}
- </select>
- <delete id="deleteChannelRoomByChannelIdAndUid">
- DELETE FROM channel_room WHERE channel_id = #{channelId} AND uid = #{uid}
- </delete>
- </mapper>
|