| | |
| | | <result property="sessionId" column="session_id"/> |
| | | <result property="type" column="type"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="nickName" column="nick_name"/> |
| | | <result property="avatar" column="avatar"/> |
| | | <result property="targetId" column="target_id"/> |
| | | <result property="targetNickName" column="target_nick_name"/> |
| | | <result property="targetAvatar" column="target_avatar"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdCallSessionUserVo"> |
| | | select id, session_id, type, user_id,target_id |
| | | from ard_call_session_user |
| | | </sql> |
| | | |
| | | <sql id="selectArdCallSessionUserVo1"> |
| | | SELECT |
| | | acsu.ID, |
| | | acsu.session_id, |
| | | acsu.TYPE, |
| | | acsu.user_id, |
| | | acsu.target_id, |
| | | u.nick_name, |
| | | u.avatar, |
| | | u1.nick_name AS target_nick_name, |
| | | u1.avatar AS target_avatar |
| | | FROM |
| | | ard_call_session_user acsu |
| | | LEFT JOIN sys_user u ON u.user_id = acsu.user_id |
| | | LEFT JOIN sys_user u1 ON u1.user_id = acsu.target_id |
| | | </sql> |
| | | <select id="selectArdCallSessionUserList" parameterType="ArdCallSessionUser" resultMap="ArdCallSessionUserResult"> |
| | | <include refid="selectArdCallSessionUserVo"/> |
| | | <include refid="selectArdCallSessionUserVo1"/> |
| | | <where> |
| | | <if test="sessionId != null and sessionId != ''">and session_id = #{sessionId}</if> |
| | | <if test="type != null and type != ''">and type = #{type}</if> |
| | | <if test="userId != null and userId != ''">and user_id = #{userId}</if> |
| | | <if test="userId != null and userId != ''">and acsu.user_id = #{userId}</if> |
| | | <if test="targetId != null and targetId != ''">and target_id = #{targetId}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectArdCallSessionUserBySesionId" parameterType="String" resultMap="ArdCallSessionUserResult"> |
| | | <include refid="selectArdCallSessionUserVo1"/> |
| | | where session_id = #{sessionId} and acsu.user_id = #{userId} |
| | | </select> |
| | | <select id="selectArdCallSessionUserById" parameterType="String" resultMap="ArdCallSessionUserResult"> |
| | | <include refid="selectArdCallSessionUserVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertArdCallSessionUser" parameterType="ArdCallSessionUser"> |
| | | insert into ard_call_session_user |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |