<?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.mosty.base.mapper.UserDeptMapper">

    <!--查询部门下的所有的人员信息-->
    <select id="getUserListByDeptId" resultType="com.mosty.common.core.business.entity.SysUser">
        select a.* from sys_user a ,sys_dept b,sys_user_dept c where a.id = c.user_id
        and a.xt_zxbz = '0' and b.xt_zxbz = '0'
        and c.dept_id = b.id and a.is_virtual_user = '02' and b.id in
        <foreach collection="list" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
    </select>

    <!--查询本部门下的所有的，不包含子部门-->
    <select id="getUserListByIdAll" resultType="com.mosty.common.core.business.entity.SysUser">
        select a.* from sys_user a ,sys_dept b,sys_user_dept c where a.id = c.user_id
        and a.xt_zxbz = '0' and b.xt_zxbz = '0'
        and c.dept_id = b.id  and b.id = #{deptid}
    </select>
</mapper>


