<?xml version="1.0" encoding="UTF-8"?>
	<!DOCTYPE mapper   
	  PUBLIC "-//mybatis.org//DTD Mapper 3.1//EN"   
	  "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.mapper.configuration.GDInforMapper">


    
    <select id="queryGDByDept" parameterType="String" resultType="GDInformation" >
		select * from PQ_GDINFORMATION
		<where>
			<if test="_parameter != null">
				GD_INDEX in(#{gdIndex})		
			</if>
		</where>
	</select>
	<select id="selectAll" parameterType="String" resultType="GDInformation" >
		select * from PQ_GDINFORMATION
		
	</select>
	<select id="selectNoGd" resultType="GDInformation">
    select * from pq_gdinformation where gd_index not in (select gd_index from pqs_deptsgd where depts_index in(select depts_index from pqs_depts where systype=#{sysType}))
    </select>

	<select id="selectOthersNoGd" resultType="GDInformation">
   select * from pq_gdinformation where gd_index  in(select gd_index from pqs_deptsgd where depts_index  in( select
   depts_index from pqs_depts where sysType=#{sysType}) and depts_index!=#{deptsIndex})

    </select>

	<select id="selectMaxIndex" parameterType="String" resultType="Long" >
		select max(gd_index) from PQ_GDINFORMATION
		
	</select>
	

	<select id="getGdName"   resultType="String" >
	select T2.name  from pq_gdinformation T2 left join pq_device  T1
     on T1.GD_INDEX=t2.GD_INDEX where T1.GD_INDEX  =#{gdIndex} and rownum=1
	</select>
	

	<select id="testName" resultType="GDInformation" >
		select * from pq_gdinformation where name = #{name} and PROVINCE_INDEX = #{proIndex}
	</select>
</mapper>