<?xml version="1.0" encoding="gbk" standalone="no"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="" >
	
	<sql id="condition_Nhywgysxx">
		where 1=1
		<isNotEmpty prepend='AND' property='LIKExh'>
			(xh like '%$LIKExh$%'   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='xh'>
			(a.xh = #xh#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEgysmc'>
			(gysmc like '%$LIKEgysmc$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='gysmc'>
			(gysmc = #gysmc# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEgysbh'>
			(gysbh like '%$LIKEgysbh$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='gysbh'>
			(gysbh = #gysbh# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEgysjc'>
			(gysjc like '%$LIKEgysjc$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='gysjc'>
			(gysjc = #gysjc# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEgyslb'>
			(gyslb like '%$LIKEgyslb$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='gyslb'>
			(gyslb = #gyslb# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEgysclrq'>
			(gysclrq like '%$LIKEgysclrq$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='gysclrq'>
			(gysclrq = #gysclrq# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEfwkasj'>
			(fwkasj like '%$LIKEfwkasj$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='fwkasj'>
			(fwkasj = #fwkasj# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEfwjssj'>
			(fwjssj like '%$LIKEfwjssj$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='fwjssj'>
			(fwjssj = #fwjssj# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKElxr'>
			(lxr like '%$LIKElxr$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='lxr'>
			(lxr = #lxr# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKElxdh'>
			(lxdh like '%$LIKElxdh$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='lxdh'>
			(lxdh = #lxdh# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKElxdzqu'>
			(lxdzqu like '%$LIKElxdzqu$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='lxdzqu'>
			(lxdzqu = #lxdzqu# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKElxdzxz'>
			(lxdzxz like '%$LIKElxdzxz$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='lxdzxz'>
			(lxdzxz = #lxdzxz# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEgysjj'>
			(gysjj like '%$LIKEgysjj$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='gysjj'>
			(gysjj = #gysjj# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcjry'>
			(cjry like '%$LIKEcjry$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='cjry'>
			(cjry = #cjry# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcjrq'>
			(cjrq like '%$LIKEcjrq$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='cjrq'>
			(cjrq = #cjrq# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKExgry'>
			(xgry like '%$LIKExgry$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='xgry'>
			(xgry = #xgry# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKExgrq'>
			(xgrq like '%$LIKExgrq$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='xgrq'>
			(xgrq = #xgrq# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEbz'>
			(bz like '%$LIKEbz$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='bz'>
			(bz = #bz# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEkz1'>
			(kz1 like '%$LIKEkz1$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='kz1'>
			(kz1 = #kz1# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEkz2'>
			(kz2 like '%$LIKEkz2$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='kz2'>
			(kz2 = #kz2# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEkz3'>
			(kz3 like '%$LIKEkz3$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='kz3'>
			(kz3 = #kz3# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEkz4'>
			(kz4 like '%$LIKEkz4$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='kz4'>
			(kz4 = #kz4# )
		</isNotEmpty>
		<isNotEmpty property='tableparam'>
			$tableparam$
		</isNotEmpty>
		<isNotEmpty property='order'>
			$order$
		</isNotEmpty>
	</sql>
	
	<!-- add object -->
	<insert id="insert_Nhywgysxx" parameterClass="java.util.Map">
		insert into 
		nhywgysxx(
		<dynamic prepend=" ">  
			<isNotEmpty prepend=',' property='xh'>xh</isNotEmpty>
			<isNotEmpty prepend=',' property='gysmc'>gysmc</isNotEmpty>
			<isNotEmpty prepend=',' property='gysbh'>gysbh</isNotEmpty>
			<isNotEmpty prepend=',' property='gysjc'>gysjc</isNotEmpty>
			<isNotEmpty prepend=',' property='gyslb'>gyslb</isNotEmpty>
			<isNotEmpty prepend=',' property='gysclrq'>gysclrq</isNotEmpty>
			<isNotEmpty prepend=',' property='fwkasj'>fwkasj</isNotEmpty>
			<isNotEmpty prepend=',' property='fwjssj'>fwjssj</isNotEmpty>
			<isNotEmpty prepend=',' property='lxr'>lxr</isNotEmpty>
			<isNotEmpty prepend=',' property='lxdh'>lxdh</isNotEmpty>
			<isNotEmpty prepend=',' property='lxdzqu'>lxdzqu</isNotEmpty>
			<isNotEmpty prepend=',' property='lxdzxz'>lxdzxz</isNotEmpty>
			<isNotEmpty prepend=',' property='gysjj'>gysjj</isNotEmpty>
			<isNotEmpty prepend=',' property='cjry'>cjry</isNotEmpty>
			<isNotEmpty prepend=',' property='cjrq'>cjrq</isNotEmpty>
			<isNotEmpty prepend=',' property='xgry'>xgry</isNotEmpty>
			<isNotEmpty prepend=',' property='xgrq'>xgrq</isNotEmpty>
			<isNotEmpty prepend=',' property='bz'>bz</isNotEmpty>
			<isNotEmpty prepend=',' property='kz1'>kz1</isNotEmpty>
			<isNotEmpty prepend=',' property='kz2'>kz2</isNotEmpty>
			<isNotEmpty prepend=',' property='kz3'>kz3</isNotEmpty>
			<isNotEmpty prepend=',' property='kz4'>kz4</isNotEmpty>

		</dynamic>  
	    <![CDATA[ 
	        ) values ( 
	    ]]>  
	     <dynamic prepend=" "> 
			<isNotEmpty prepend=',' property='xh'>#xh#</isNotEmpty>
			<isNotEmpty prepend=',' property='gysmc'>#gysmc#</isNotEmpty>
			<isNotEmpty prepend=',' property='gysbh'>#gysbh#</isNotEmpty>
			<isNotEmpty prepend=',' property='gysjc'>#gysjc#</isNotEmpty>
			<isNotEmpty prepend=',' property='gyslb'>#gyslb#</isNotEmpty>
			<isNotEmpty prepend=',' property='gysclrq'>#gysclrq#</isNotEmpty>
			<isNotEmpty prepend=',' property='fwkasj'>#fwkasj#</isNotEmpty>
			<isNotEmpty prepend=',' property='fwjssj'>#fwjssj#</isNotEmpty>
			<isNotEmpty prepend=',' property='lxr'>#lxr#</isNotEmpty>
			<isNotEmpty prepend=',' property='lxdh'>#lxdh#</isNotEmpty>
			<isNotEmpty prepend=',' property='lxdzqu'>#lxdzqu#</isNotEmpty>
			<isNotEmpty prepend=',' property='lxdzxz'>#lxdzxz#</isNotEmpty>
			<isNotEmpty prepend=',' property='gysjj'>#gysjj#</isNotEmpty>
			<isNotEmpty prepend=',' property='cjry'>#cjry#</isNotEmpty>
			<isNotEmpty prepend=',' property='cjrq'>#cjrq#</isNotEmpty>
			<isNotEmpty prepend=',' property='xgry'>#xgry#</isNotEmpty>
			<isNotEmpty prepend=',' property='xgrq'>#xgrq#</isNotEmpty>
			<isNotEmpty prepend=',' property='bz'>#bz#</isNotEmpty>
			<isNotEmpty prepend=',' property='kz1'>#kz1#</isNotEmpty>
			<isNotEmpty prepend=',' property='kz2'>#kz2#</isNotEmpty>
			<isNotEmpty prepend=',' property='kz3'>#kz3#</isNotEmpty>
			<isNotEmpty prepend=',' property='kz4'>#kz4#</isNotEmpty>

		 </dynamic>  
	    <![CDATA[ 
	        ) 
	    ]]> 
	</insert>
	
	<!-- edit object  -->
	<update id="update_Nhywgysxx" parameterClass="java.util.Map">
		update nhywgysxx 
		<dynamic prepend="set ">   
			
			<isNotEmpty prepend=',' property='gysmc'>gysmc=#gysmc#</isNotEmpty>
			<isNotEmpty prepend=',' property='gysbh'>gysbh=#gysbh#</isNotEmpty>
			<isNotEmpty prepend=',' property='gysjc'>gysjc=#gysjc#</isNotEmpty>
			<isNotEmpty prepend=',' property='gyslb'>gyslb=#gyslb#</isNotEmpty>
			<isNotEmpty prepend=',' property='gysclrq'>gysclrq=#gysclrq#</isNotEmpty>
			<isNotEmpty prepend=',' property='fwkasj'>fwkasj=#fwkasj#</isNotEmpty>
			<isNotEmpty prepend=',' property='fwjssj'>fwjssj=#fwjssj#</isNotEmpty>
			<isNotEmpty prepend=',' property='lxr'>lxr=#lxr#</isNotEmpty>
			<isNotEmpty prepend=',' property='lxdh'>lxdh=#lxdh#</isNotEmpty>
			<isNotEmpty prepend=',' property='lxdzqu'>lxdzqu=#lxdzqu#</isNotEmpty>
			<isNotEmpty prepend=',' property='lxdzxz'>lxdzxz=#lxdzxz#</isNotEmpty>
			<isNotEmpty prepend=',' property='gysjj'>gysjj=#gysjj#</isNotEmpty>
			<isNotEmpty prepend=',' property='cjry'>cjry=#cjry#</isNotEmpty>
			<isNotEmpty prepend=',' property='cjrq'>cjrq=#cjrq#</isNotEmpty>
			<isNotEmpty prepend=',' property='xgry'>xgry=#xgry#</isNotEmpty>
			<isNotEmpty prepend=',' property='xgrq'>xgrq=#xgrq#</isNotEmpty>
			<isNotEmpty prepend=',' property='bz'>bz=#bz#</isNotEmpty>
			<isNotEmpty prepend=',' property='kz1'>kz1=#kz1#</isNotEmpty>
			<isNotEmpty prepend=',' property='kz2'>kz2=#kz2#</isNotEmpty>
			<isNotEmpty prepend=',' property='kz3'>kz3=#kz3#</isNotEmpty>
			<isNotEmpty prepend=',' property='kz4'>kz4=#kz4#</isNotEmpty>

		</dynamic>
		where 1=1 
			<isNotEmpty prepend='AND' property='XGTJxh'> xh = #XGTJxh#</isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJgysmc'> gysmc = #XGTJgysmc# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJgysbh'> gysbh = #XGTJgysbh# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJgysjc'> gysjc = #XGTJgysjc# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJgyslb'> gyslb = #XGTJgyslb# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJgysclrq'> gysclrq = #XGTJgysclrq# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJfwkasj'> fwkasj = #XGTJfwkasj# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJfwjssj'> fwjssj = #XGTJfwjssj# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJlxr'> lxr = #XGTJlxr# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJlxdh'> lxdh = #XGTJlxdh# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJlxdzqu'> lxdzqu = #XGTJlxdzqu# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJlxdzxz'> lxdzxz = #XGTJlxdzxz# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJgysjj'> gysjj = #XGTJgysjj# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJcjry'> cjry = #XGTJcjry# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJcjrq'> cjrq = #XGTJcjrq# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJxgry'> xgry = #XGTJxgry# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJxgrq'> xgrq = #XGTJxgrq# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJbz'> bz = #XGTJbz# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJkz1'> kz1 = #XGTJkz1# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJkz2'> kz2 = #XGTJkz2# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJkz3'> kz3 = #XGTJkz3# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJkz4'> kz4 = #XGTJkz4# </isNotEmpty>

	</update>
	
	<!-- delete object -->
	<delete id="delete_Nhywgysxx" parameterClass="java.util.Map">
		delete from nhywgysxx 
		where 1=1 
		<isNotEmpty prepend='AND' property='xh'> xh = #xh#</isNotEmpty>
	</delete>
	
	<!-- batch delete object -->
	<delete id="batch_delete_Nhywgysxx" parameterClass="java.util.Map">
		delete from nhywgysxx a
		where 1=1
			<isNotEmpty prepend='AND' property='keyword'>
			key  in (#keyword#)
			</isNotEmpty>
	</delete>
	
	<!-- query objects by page-->
	<select id="query_Nhywgysxx" resultClass="java.util.HashMap" parameterClass="java.util.Map" remapResults="true">
		select 
			a.xh,gysmc,gysbh,gysjc,gyslb,gysclrq,fwkasj,fwjssj,lxr,lxdh,lxdzqu,lxdzxz,gysjj,
			a.cjry,a.cjrq,a.xgry,a.xgrq,a.bz,a.kz1,a.kz2,a.kz3,a.kz4,b.csmc as gyslbmc
		from nhywgysxx a left join xtcl b on a.gyslb=b.csdm and b.csdl='nhywXmlx'
		<include refid="condition_Nhywgysxx"/>		
	</select>
	
	<!-- query objects totalcount -->
	<select id="count_Nhywgysxx" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from nhywgysxx a
		<include refid="condition_Nhywgysxx"/>			
	</select>
	
	<!-- batch add objects -->
	<insert id="batch_insert_Nhywgysxx" parameterClass="java.util.List">
	 	<![CDATA[
          INSERT
      	]]>
      	<iterate conjunction=" " > 
			into nhywgysxx(
			 <![CDATA[ 
				xh,gysmc,gysbh,gysjc,gyslb,gysclrq,fwkasj,fwjssj,lxr,lxdh,lxdzqu,lxdzxz,gysjj,cjry,cjrq,xgry,xgrq,bz,kz1,kz2,kz3,kz4
			)values
			 ]]>  		 
			 <![CDATA[ 
				(
				#list[].xh#,#list[].gysmc#,#list[].gysbh#,#list[].gysjc#,#list[].gyslb#,#list[].gysclrq#,#list[].fwkasj#,#list[].fwjssj#,#list[].lxr#,#list[].lxdh#,#list[].lxdzqu#,#list[].lxdzxz#,#list[].gysjj#,#list[].cjry#,#list[].cjrq#,#list[].xgry#,#list[].xgrq#,#list[].bz#,#list[].kz1#,#list[].kz2#,#list[].kz3#,#list[].kz4#
				)
			]]>    
    	</iterate> 
	</insert>
	
	
	<!-- 供应商电子监控集合查询 -->
	<select id="query_dzsbjh"  resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select a.channelsetname,b.*,(select csmc from xtcl where csdl='ywRecordModel' and csdm=b.recordmodel) as recordmodelname,
		(select csmc from xtcl where csdl='ywVideoModel' and csdm=b.videomodel) as videomodelname from ywvideochannelset a, ywvideochannelsetlist b 
		where a.channelsetid=b.channelsetid
		<isNotEmpty property="channelsetid" prepend="and">
			a.channelsetid=#channelsetid#
		</isNotEmpty>	
		<isNotEmpty property="jhmc" prepend="and">
			a.channelsetName like '%$jhmc$%'
		</isNotEmpty>
		<isNotEmpty property="sbmc" prepend="and">
			b.channelName like '%$sbmc$%'
		</isNotEmpty>
		<isNotEmpty property='order'>
			$order$
		</isNotEmpty>
	</select>
	
	<!-- 供应商电子监控集合查询   总数-->
	<select id="count_dzsbjh" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from(
		select a.channelsetname,b.*,(select csmc from xtcl where csdl='ywRecordModel' and csdm=b.recordmodel) as recordmodelname,
		(select csmc from xtcl where csdl='ywVideoModel' and csdm=b.videomodel) as videomodelname from ywvideochannelset a, ywvideochannelsetlist b 
		where a.channelsetid=b.channelsetid
		<isNotEmpty property="channelsetid" prepend="and">
			a.channelsetid=#channelsetid#
		</isNotEmpty>	
		<isNotEmpty property="jhmc" prepend="and">
			a.channelsetName like '%$jhmc$%'
		</isNotEmpty>
		<isNotEmpty property="sbmc" prepend="and">
			b.channelName like '%$sbmc$%'
		</isNotEmpty>
		) x	
	</select>
	
	<!-- 供应商电子信息集合   全部集合信息 或 已选择的集合信息-->
	<select id="query_All_Chosed_Set" resultClass="java.util.HashMap" parameterClass="java.util.Map">		
		select a.channelsetid,a.channelsetname,a.remarks from ywvideochannelset a 
		where 1=1
		<isNotEmpty prepend='AND' property='chosedxh'>
		(exists (select x.kz1 from ( select kz1 from nhywgysxx b where b.xh=#chosedxh#) x where x.kz1=a.channelsetid))
			<!-- (a.channelsetid in (select case when kz1 is null then ' ' when kz1='' then ' ' end from nhywgysxx b where b.xh= #chosedxh#  ) ) -->
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='allxh'>
			(not exists (select x.kz1 from ( select kz1 from nhywgysxx b where b.xh=#allxh#) x where x.kz1=a.channelsetid))
			<!-- (a.channelsetid not in (select case when kz1 is null then ' ' when kz1='' then ' ' end from nhywgysxx b where b.xh= #allxh#  ) ) -->
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEchannelsetname'>
			(a.channelsetname like '%$LIKEchannelsetname$%'  )
		</isNotEmpty>
		<isNotEmpty property='order'>
			$order$
		</isNotEmpty>		
	</select>
	
	<select id="count_All_Chosed_Set" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from(
			select a.channelsetid,a.channelsetname,a.remarks from ywvideochannelset a 
			where 1=1
			<isNotEmpty prepend='AND' property='chosedxh'>
			(exists (select x.kz1 from ( select kz1 from nhywgysxx b where b.xh=#chosedxh#) x where x.kz1=a.channelsetid))
				<!-- (a.channelsetid in (select case when kz1 is null then ' ' when kz1='' then ' ' end from nhywgysxx b where b.xh= #chosedxh#  ) ) -->
			</isNotEmpty>
			<isNotEmpty prepend='AND' property='allxh'>
			(not exists (select x.kz1 from ( select kz1 from nhywgysxx b where b.xh=#allxh#) x where x.kz1=a.channelsetid))
				<!-- (a.channelsetid not in (select case when kz1 is null then ' ' when kz1='' then ' ' end from nhywgysxx b where b.xh= #allxh#  ) ) -->
			</isNotEmpty>
			<isNotEmpty prepend='AND' property='LIKEchannelsetname'>
				(a.channelsetname like '%$LIKEchannelsetname$%'  )
			</isNotEmpty>
			<isNotEmpty property='order'>
				$order$
			</isNotEmpty>	
		) x
	</select>
	
	
	<!-- 供应商关联5类交通设备信息 -->
	<select id="query_Jtsb" resultClass="java.util.HashMap" parameterClass="java.util.Map">			
	  select * from (
		select xh, bzbh as bh, (select csmc from xtcl  where csdl='nhywBzlx' and csdm=bzlx) as lxmc, bzlx as lx, bzmc as mc, ggxh, '1' as type, '标志' as typemc, kz1, kz2,cjrq  from nhywjtbzgl  union all
		
		select xh, bxbh as bh, (select csmc from xtcl  where csdl='nhywBxlx' and csdm=bxlx) as lxmc, bxlx as lx, bxmc as mc, '' as ggxh, '2' as type, '标线' as typemc, kz1, kz2,cjrq from nhywjtbxgl union all
		
		select xh, hlbh as bh, (select csmc from xtcl  where csdl='nhywHllx' and csdm=hllx) as hllxmc, hllx as lx, hlmc as mc, ggxh, '3' as type, '护栏' as typemc, kz1, kz2,cjrq from nhywjthlgl union all
		
		select xh, xhdbh as bh, '' as lxmc, '' as lx, xhdmc as mc, ggxh, '4' as type, '信号灯' as typemc, kz1, kz2,cjrq from nhywjtxhdgl union all
		
		select xh, ledbh as bh, '' as lxmc, '' as lx, ledmc as mc, ggxh, '5' as type, 'LED诱导屏' as typemc, kz1, kz2,cjrq from nhywjtledydpgl
	  ) x where 1=1
	  <isNotEmpty prepend='AND' property='gysbh'>
		  x.kz1 = #gysbh#
	  </isNotEmpty>
	  <isNotEmpty prepend='AND' property='type'>
		  x.type = #type#
	  </isNotEmpty>
	  <isNotEmpty prepend="and" property='mc'>
	  	  x.mc like '%$mc$%'
	  </isNotEmpty>
	  <isNotEmpty prepend="and" property='nogysbh'>
	  	  (x.kz1 is null or x.kz1='' or x.kz1=' ')
	  </isNotEmpty>
	  <isNotEmpty property='order'>
			$order$
		</isNotEmpty>
	</select>
	
	<select id="count_Jtsb" resultClass="java.lang.Integer" parameterClass="java.util.Map">			
	  select count(*) from (
		select xh, bzbh as bh, (select csmc from xtcl  where csdl='nhywBzlx' and csdm=bzlx) as lxmc, bzlx as lx, bzmc as mc, ggxh, '1' as type, '标志' as typemc, kz1, kz2  from nhywjtbzgl  union all
		
		select xh, bxbh as bh, (select csmc from xtcl  where csdl='nhywBxlx' and csdm=bxlx) as lxmc, bxlx as lx, bxmc as mc, '' as ggxh, '2' as type, '标线' as typemc, kz1, kz2 from nhywjtbxgl union all
		
		select xh, hlbh as bh, (select csmc from xtcl  where csdl='nhywHllx' and csdm=hllx) as hllxmc, hllx as lx, hlmc as mc, ggxh, '3' as type, '护栏' as typemc, kz1, kz2 from nhywjthlgl union all
		
		select xh, xhdbh as bh, '' as lxmc, '' as lx, xhdmc as mc, ggxh, '4' as type, '信号灯' as typemc, kz1, kz2 from nhywjtxhdgl union all
		
		select xh, ledbh as bh, '' as lxmc, '' as lx, ledmc as mc, ggxh, '5' as type, 'LED诱导屏' as typemc, kz1, kz2 from nhywjtledydpgl
	  ) x where 1=1
	  <isNotEmpty prepend='AND' property='gysbh'>
		  x.kz1 = #gysbh#
	  </isNotEmpty>
	  <isNotEmpty prepend='AND' property='type'>
		  x.type = #type#
	  </isNotEmpty>
	  <isNotEmpty prepend="and" property='mc'>
	  	  x.mc like '%$mc$%'
	  </isNotEmpty>
	  <isNotEmpty prepend="and" property='nogysbh'>
	  	  (x.kz1 is null or x.kz1='' or x.kz1=' ')
	  </isNotEmpty>
	</select>
	
	
	<procedure id="callProc" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		 { call PROCEDURE1(?, ?, ?) }
	</procedure>
</sqlMap>











