|
@@ -0,0 +1,121 @@
|
|
|
+<?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.RoomMemberDao">
|
|
|
+
|
|
|
+ <resultMap type="com.ym.mec.biz.dal.entity.RoomMember" id="RoomMember">
|
|
|
+ <result column="id" property="id" />
|
|
|
+ <result column="rid" property="rid" />
|
|
|
+ <result column="uid" property="uid" />
|
|
|
+ <result column="join_dt" property="joinDt" />
|
|
|
+ <result column="role" property="role" />
|
|
|
+ <result column="head_url" property="headUrl" />
|
|
|
+ <result column="name" property="name" />
|
|
|
+ <result column="camera" property="camera" />
|
|
|
+ <result column="mic" property="mic" />
|
|
|
+ <result column="music_mode" property="musicMode" />
|
|
|
+ <result column="hand" property="hand" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 根据主键查询一条记录 -->
|
|
|
+ <select id="get" resultMap="RoomMember" >
|
|
|
+ SELECT * FROM rongyun_room_member WHERE id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 全查询 -->
|
|
|
+ <select id="findAll" resultMap="RoomMember">
|
|
|
+ SELECT * FROM rongyun_room_member ORDER BY id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 向数据库增加一条记录 -->
|
|
|
+ <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.RoomMember" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
+ INSERT INTO rongyun_room_member (id,rid,uid,join_dt,role,head_url,name,camera,mic,music_mode,play_midi_json,hand)
|
|
|
+ VALUES(#{id},#{rid},#{uid},#{joinDt},#{role},#{headUrl},#{name},#{camera},#{mic},#{musicMode},#{playMidiJson},#{hand})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 根据主键查询一条记录 -->
|
|
|
+ <update id="update" parameterType="com.ym.mec.biz.dal.entity.RoomMember">
|
|
|
+ UPDATE rongyun_room_member <set>
|
|
|
+ <if test="uid != null">
|
|
|
+ uid = #{uid},
|
|
|
+ </if>
|
|
|
+ <if test="musicMode != null">
|
|
|
+ music_mode = #{musicMode},
|
|
|
+ </if>
|
|
|
+ <if test="role != null">
|
|
|
+ role = #{role},
|
|
|
+ </if>
|
|
|
+ <if test="headUrl != null">
|
|
|
+ head_url = #{headUrl},
|
|
|
+ </if>
|
|
|
+ <if test="playMidiJson != null">
|
|
|
+ play_midi_json = #{playMidiJson},
|
|
|
+ </if>
|
|
|
+ <if test="mic != null">
|
|
|
+ mic = #{mic},
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ name = #{name},
|
|
|
+ </if>
|
|
|
+ <if test="rid != null">
|
|
|
+ rid = #{rid},
|
|
|
+ </if>
|
|
|
+ <if test="joinDt != null">
|
|
|
+ join_dt = #{joinDt},
|
|
|
+ </if>
|
|
|
+ <if test="camera != null">
|
|
|
+ camera = #{camera},
|
|
|
+ </if>
|
|
|
+ <if test="hand != null">
|
|
|
+ hand = #{hand},
|
|
|
+ </if>
|
|
|
+ </set> WHERE id = #{id}
|
|
|
+ </update>
|
|
|
+ <update id="updateByRidAndUid">
|
|
|
+ UPDATE rongyun_room_member SET role = #{role}
|
|
|
+ WHERE rid = #{roomId} AND uid = #{userId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 根据主键删除一条记录 -->
|
|
|
+ <delete id="delete" >
|
|
|
+ DELETE FROM rongyun_room_member WHERE id = #{id}
|
|
|
+ </delete>
|
|
|
+ <delete id="deleteRoomMember">
|
|
|
+ DELETE FROM rongyun_room_member
|
|
|
+ WHERE rid = #{roomId}
|
|
|
+ <if test="userId != null">
|
|
|
+ AND uid = #{userId}
|
|
|
+ </if>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <!-- 查询当前表的总记录数 -->
|
|
|
+ <select id="queryCount" resultType="int">
|
|
|
+ SELECT COUNT(*) FROM rongyun_room_member
|
|
|
+ </select>
|
|
|
+ <select id="queryRoomMember" resultMap="RoomMember">
|
|
|
+ SELECT * FROM rongyun_room_member
|
|
|
+ WHERE rid = #{roomId}
|
|
|
+ <if test="role != null">
|
|
|
+ AND role = #{role}
|
|
|
+ </if>
|
|
|
+ <if test="userId != null">
|
|
|
+ AND uid = #{userId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="findOne" resultMap="RoomMember">
|
|
|
+ SELECT * FROM rongyun_room_member WHERE rid = #{roomId}
|
|
|
+ <if test="userId != null">
|
|
|
+ AND uid = #{userId}
|
|
|
+ </if>
|
|
|
+ LIMIT 1
|
|
|
+ </select>
|
|
|
+ <select id="countRoomMember" resultType="java.lang.Integer">
|
|
|
+ SELECT COUNT(id) FROM rongyun_room_member WHERE rid = #{roomId}
|
|
|
+ <if test="excludeRole != null">
|
|
|
+ AND role != #{excludeRole}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+</mapper>
|