<?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.njcn.system.mapper.DeptMapMapper">

    <select id="selectCountByDept" resultType="int">
        SELECT count(Id) FROM sys_dept WHERE State = 1 AND Id = #{deptId}
    </select>

    <select id="selectDeptName" resultType="java.lang.String">
        SELECT Name FROM sys_dept WHERE Id = #{deptId}
    </select>

    <select id="selectDeptListName" resultType="Dept">
        SELECT `Id` deptId, `Name` deptName
        FROM sys_dept
        WHERE State = 1 AND Id IN
        <foreach item="item" collection="deptIndexes" open="(" separator="," close=")">
            #{item}
        </foreach>
    </select>


</mapper>