<?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.cmeeting.mapper.primary.UserIdMapper">
    <!-- 批量插入用户ID信息 -->
    <insert id="insertUsers" parameterType="List">
        INSERT IGNORE INTO userid (
            user_name,
            wid,
            tid
        ) VALUES
        <foreach collection="list" item="item" separator=",">
            (
            #{item.userName},
            #{item.wid},
            #{item.tid}
            )
        </foreach>
    </insert>
        <!-- 更新 Tid 字段 -->
        <update id="updateUser" parameterType="com.cmeeting.pojo.UserId">
            UPDATE userid
            SET tid = #{tid}
            WHERE wid = #{wid}
        </update>
    <select id="getUsers" resultType="com.cmeeting.pojo.UserId">
        select * from userid
    </select>
    <select id="getWidByTid" resultType="java.lang.String">
        select wid from userid  WHERE tid = #{operatorUserId}
    </select>
    <select id="getTidByWid" resultType="java.lang.String">
        select tid from userid WHERE wid = #{wid}
    </select>

</mapper>