<?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.mapper.user.DeptsGdMapper">

<!-- 部门权限 -->
<resultMap type="com.njcn.pojo.user.DeptsGd" id="DeptsGdMapperMap" autoMapping="true">
	<id property="deptsIndex" column="DEPTS_INDEX"/>
	<collection property="gdi" javaType="ArrayList" ofType="GDIndex" column="GD_Index"
	select="com.njcn.mapper.configuration.GDInforMapper.queryGDByDept"
	></collection>
</resultMap>
<resultMap type="com.njcn.pojo.user.DeptsGd" id="DeptsGdMapperNoMap" autoMapping="true">
		<id property="deptsIndex" column="DEPTS_INDEX"/>
	<collection property="gdi" javaType="ArrayList" ofType="GDIndex" column="GD_Index"
	select="com.njcn.mapper.configuration.GDInforMapper.queryGDByNoDept"
	></collection>
</resultMap>
<delete id="deleteDeptGd">
delete pqs_deptsgd where gd_index=#{GDIndex} and depts_index=#{deptsIndex}
</delete>
<select id="selectAllGd" resultMap="DeptsGdMapperMap">
select *from PQS_DEPTSGD where Depts_Index in(#{deptsIndex})
</select>
<!--先解绑-->
<delete id="deleteNowDeptGd">
delete pqs_deptsgd where gd_index=#{gdIndex} and depts_index in(select depts_index from pqs_depts where
sysType=#{sysType})
</delete>
    <!--查询是否为省级部门-->
<select id="isNode" resultType="int">
    select PARENTNODE from pqs_depts where depts_index=#{deptsIndex}
</select>
</mapper>