ChannelUsersMapper.xml 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  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.juxiao.xchat.module.xbd.mapper.operation.ChannelUsersMapper" >
  4. <delete id="deleteByChannelId" parameterType="java.lang.Long" >
  5. delete from channel_users
  6. where channel_id = #{channelId}
  7. </delete>
  8. <insert id="InsertChannelUsers">
  9. INSERT INTO channel_users
  10. (channel_id, uid)
  11. VALUES
  12. <foreach item='value' index='index' collection='list' separator=','>
  13. (#{channelId}, #{value})
  14. </foreach>
  15. </insert>
  16. <select id="listUsersIdByChannelId" resultType="java.lang.Long">
  17. select uid from channel_users where channel_id = #{channelId}
  18. </select>
  19. <select id="listByChannelId" resultType="com.juxiao.xchat.module.xbd.domain.users.Users">
  20. select u.uid,u.erban_no as erbanNo,u.nick,u.avatar
  21. from channel_users cu left join users u on cu.uid = u.uid
  22. where channel_id = #{channelId}
  23. </select>
  24. <delete id="deleteByChannelIdAndUid" >
  25. delete from channel_users WHERE channel_id = #{channelId} AND uid = #{uid}
  26. </delete>
  27. </mapper>