<?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.ruoyi.ibs.grid.mapper.GridUserMapper">
    <resultMap type="GridUserVo" id="GridUserVo">
        <result property="userId" column="user_id"/>
        <result property="userName" column="user_name"/>
        <result property="nickName" column="nick_name"/>
        <result property="deptId" column="dept_id"/>
        <result property="deptName" column="dept_name"/>
        <result property="deptType" column="dept_type"/>
    </resultMap>
    <select id="selectGridUser" resultMap="GridUserVo">
        select u.user_id, u.dept_id, u.user_name, u.nick_name,d.dept_name, d.dept_type from sys_user u
        left join sys_dept d on u.dept_id = d.dept_id
        where u.del_flag = '0'
        AND u.dept_id IN
        <foreach collection="deptIds" item="id" index="index" open="(" separator="," close=")">
            #{id}
        </foreach>
        ORDER BY u.dept_id
    </select>
</mapper>