<?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_Nhywgyssbyjd">
		where 1=1
		<isNotEmpty prepend='AND' property='LIKExh'>
			(xh like '%$LIKExh$%'   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='xh'>
			(xh = #xh#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEyjgysmc'>
			(yjgysmc like '%$LIKEyjgysmc$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='yjgysmc'>
			(yjgysmc = #yjgysmc# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEyjgysbh'>
			(yjgysbh like '%$LIKEyjgysbh$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='yjgysbh'>
			(yjgysbh = #yjgysbh# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEyjgysjc'>
			(yjgysjc like '%$LIKEyjgysjc$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='yjgysjc'>
			(yjgysjc = #yjgysjc# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEyjgyslb'>
			(yjgyslb like '%$LIKEyjgyslb$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='yjgyslb'>
			(yjgyslb = #yjgyslb# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEjsgysmc'>
			(jsgysmc like '%$LIKEjsgysmc$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='jsgysmc'>
			(jsgysmc = #jsgysmc# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEjsgysbh'>
			(jsgysbh like '%$LIKEjsgysbh$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='jsgysbh'>
			(jsgysbh = #jsgysbh# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEjsgysjc'>
			(jsgysjc like '%$LIKEjsgysjc$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='jsgysjc'>
			(jsgysjc = #jsgysjc# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEjsgyslb'>
			(jsgyslb like '%$LIKEjsgyslb$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='jsgyslb'>
			(jsgyslb = #jsgyslb# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEyjsj'>
			(yjsj like '%$LIKEyjsj$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='yjsj'>
			(yjsj = #yjsj# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEyjr'>
			(yjr like '%$LIKEyjr$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='yjr'>
			(yjr = #yjr# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEyjrdw'>
			(yjrdw like '%$LIKEyjrdw$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='yjrdw'>
			(yjrdw = #yjrdw# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEjssj'>
			(jssj like '%$LIKEjssj$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='jssj'>
			(jssj = #jssj# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEjsr'>
			(jsr like '%$LIKEjsr$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='jsr'>
			(jsr = #jsr# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEjsrdw'>
			(jsrdw like '%$LIKEjsrdw$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='jsrdw'>
			(jsrdw = #jsrdw# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEyjms'>
			(yjms like '%$LIKEyjms$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='yjms'>
			(yjms = #yjms# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEjsms'>
			(jsms like '%$LIKEjsms$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='jsms'>
			(jsms = #jsms# )
		</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_Nhywgyssbyjd" parameterClass="java.util.Map">
		insert into 
		nhywgyssbyjd(
		<dynamic prepend=" ">  
			<isNotEmpty prepend=',' property='xh'>xh</isNotEmpty>
			<isNotEmpty prepend=',' property='yjgysmc'>yjgysmc</isNotEmpty>
			<isNotEmpty prepend=',' property='yjgysbh'>yjgysbh</isNotEmpty>
			<isNotEmpty prepend=',' property='yjgysjc'>yjgysjc</isNotEmpty>
			<isNotEmpty prepend=',' property='yjgyslb'>yjgyslb</isNotEmpty>
			<isNotEmpty prepend=',' property='jsgysmc'>jsgysmc</isNotEmpty>
			<isNotEmpty prepend=',' property='jsgysbh'>jsgysbh</isNotEmpty>
			<isNotEmpty prepend=',' property='jsgysjc'>jsgysjc</isNotEmpty>
			<isNotEmpty prepend=',' property='jsgyslb'>jsgyslb</isNotEmpty>
			<isNotEmpty prepend=',' property='yjsj'>yjsj</isNotEmpty>
			<isNotEmpty prepend=',' property='yjr'>yjr</isNotEmpty>
			<isNotEmpty prepend=',' property='yjrdw'>yjrdw</isNotEmpty>
			<isNotEmpty prepend=',' property='jssj'>jssj</isNotEmpty>
			<isNotEmpty prepend=',' property='jsr'>jsr</isNotEmpty>
			<isNotEmpty prepend=',' property='jsrdw'>jsrdw</isNotEmpty>
			<isNotEmpty prepend=',' property='yjms'>yjms</isNotEmpty>
			<isNotEmpty prepend=',' property='jsms'>jsms</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='yjgysmc'>#yjgysmc#</isNotEmpty>
			<isNotEmpty prepend=',' property='yjgysbh'>#yjgysbh#</isNotEmpty>
			<isNotEmpty prepend=',' property='yjgysjc'>#yjgysjc#</isNotEmpty>
			<isNotEmpty prepend=',' property='yjgyslb'>#yjgyslb#</isNotEmpty>
			<isNotEmpty prepend=',' property='jsgysmc'>#jsgysmc#</isNotEmpty>
			<isNotEmpty prepend=',' property='jsgysbh'>#jsgysbh#</isNotEmpty>
			<isNotEmpty prepend=',' property='jsgysjc'>#jsgysjc#</isNotEmpty>
			<isNotEmpty prepend=',' property='jsgyslb'>#jsgyslb#</isNotEmpty>
			<isNotEmpty prepend=',' property='yjsj'>#yjsj#</isNotEmpty>
			<isNotEmpty prepend=',' property='yjr'>#yjr#</isNotEmpty>
			<isNotEmpty prepend=',' property='yjrdw'>#yjrdw#</isNotEmpty>
			<isNotEmpty prepend=',' property='jssj'>#jssj#</isNotEmpty>
			<isNotEmpty prepend=',' property='jsr'>#jsr#</isNotEmpty>
			<isNotEmpty prepend=',' property='jsrdw'>#jsrdw#</isNotEmpty>
			<isNotEmpty prepend=',' property='yjms'>#yjms#</isNotEmpty>
			<isNotEmpty prepend=',' property='jsms'>#jsms#</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_Nhywgyssbyjd" parameterClass="java.util.Map">
		update nhywgyssbyjd 
		<dynamic prepend="set ">   
			
			<isNotEmpty prepend=',' property='yjgysmc'>yjgysmc=#yjgysmc#</isNotEmpty>
			<isNotEmpty prepend=',' property='yjgysbh'>yjgysbh=#yjgysbh#</isNotEmpty>
			<isNotEmpty prepend=',' property='yjgysjc'>yjgysjc=#yjgysjc#</isNotEmpty>
			<isNotEmpty prepend=',' property='yjgyslb'>yjgyslb=#yjgyslb#</isNotEmpty>
			<isNotEmpty prepend=',' property='jsgysmc'>jsgysmc=#jsgysmc#</isNotEmpty>
			<isNotEmpty prepend=',' property='jsgysbh'>jsgysbh=#jsgysbh#</isNotEmpty>
			<isNotEmpty prepend=',' property='jsgysjc'>jsgysjc=#jsgysjc#</isNotEmpty>
			<isNotEmpty prepend=',' property='jsgyslb'>jsgyslb=#jsgyslb#</isNotEmpty>
			<isNotEmpty prepend=',' property='yjsj'>yjsj=#yjsj#</isNotEmpty>
			<isNotEmpty prepend=',' property='yjr'>yjr=#yjr#</isNotEmpty>
			<isNotEmpty prepend=',' property='yjrdw'>yjrdw=#yjrdw#</isNotEmpty>
			<isNotEmpty prepend=',' property='jssj'>jssj=#jssj#</isNotEmpty>
			<isNotEmpty prepend=',' property='jsr'>jsr=#jsr#</isNotEmpty>
			<isNotEmpty prepend=',' property='jsrdw'>jsrdw=#jsrdw#</isNotEmpty>
			<isNotEmpty prepend=',' property='yjms'>yjms=#yjms#</isNotEmpty>
			<isNotEmpty prepend=',' property='jsms'>jsms=#jsms#</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='XGTJyjgysmc'> yjgysmc = #XGTJyjgysmc# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJyjgysbh'> yjgysbh = #XGTJyjgysbh# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJyjgysjc'> yjgysjc = #XGTJyjgysjc# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJyjgyslb'> yjgyslb = #XGTJyjgyslb# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJjsgysmc'> jsgysmc = #XGTJjsgysmc# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJjsgysbh'> jsgysbh = #XGTJjsgysbh# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJjsgysjc'> jsgysjc = #XGTJjsgysjc# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJjsgyslb'> jsgyslb = #XGTJjsgyslb# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJyjsj'> yjsj = #XGTJyjsj# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJyjr'> yjr = #XGTJyjr# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJyjrdw'> yjrdw = #XGTJyjrdw# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJjssj'> jssj = #XGTJjssj# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJjsr'> jsr = #XGTJjsr# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJjsrdw'> jsrdw = #XGTJjsrdw# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJyjms'> yjms = #XGTJyjms# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJjsms'> jsms = #XGTJjsms# </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_Nhywgyssbyjd" parameterClass="java.util.Map">
		delete from nhywgyssbyjd 
		<include refid="condition_Nhywgyssbyjd"/>
	</delete>
	
	<!-- batch delete object -->
	<delete id="batch_delete_Nhywgyssbyjd" parameterClass="java.util.Map">
		delete from nhywgyssbyjd 
		where 1=1
			<isNotEmpty prepend='AND' property='keyword'>
			key  in (#keyword#)
			</isNotEmpty>
	</delete>
	
	<!-- query objects by page-->
	<select id="query_Nhywgyssbyjd" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
			xh,yjgysmc,yjgysbh,yjgysjc,yjgyslb,jsgysmc,jsgysbh,jsgysjc,jsgyslb,
			(select csmc from xtcl where csdl='nhywXmlx' and csdm = jsgyslb) as jsgyslbmc, 
			(select csmc from xtcl where csdl='nhywXmlx' and csdm = yjgyslb) as yjgyslbmc, 
			yjsj,yjr,yjrdw,jssj,jsr,jsrdw,yjms,jsms,cjry,cjrq,xgry,xgrq,bz,kz1,kz2,kz3,kz4
		from nhywgyssbyjd 
		<include refid="condition_Nhywgyssbyjd"/>		
	</select>
	
	<!-- query objects totalcount -->
	<select id="count_Nhywgyssbyjd" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from nhywgyssbyjd 
		<include refid="condition_Nhywgyssbyjd"/>			
	</select>
	
	<!-- batch add objects -->
	<insert id="batch_insert_Nhywgyssbyjd" parameterClass="java.util.List">
	 	<![CDATA[
          INSERT
      	]]>
      	<iterate conjunction=" " > 
			into nhywgyssbyjd(
			 <![CDATA[ 
				xh,yjgysmc,yjgysbh,yjgysjc,yjgyslb,jsgysmc,jsgysbh,jsgysjc,jsgyslb,yjsj,yjr,yjrdw,jssj,jsr,jsrdw,yjms,jsms,cjry,cjrq,xgry,xgrq,bz,kz1,kz2,kz3,kz4
			)values
			 ]]>  		 
			 <![CDATA[ 
				(
				#list[].xh#,#list[].yjgysmc#,#list[].yjgysbh#,#list[].yjgysjc#,#list[].yjgyslb#,#list[].jsgysmc#,#list[].jsgysbh#,#list[].jsgysjc#,#list[].jsgyslb#,#list[].yjsj#,#list[].yjr#,#list[].yjrdw#,#list[].jssj#,#list[].jsr#,#list[].jsrdw#,#list[].yjms#,#list[].jsms#,#list[].cjry#,#list[].cjrq#,#list[].xgry#,#list[].xgrq#,#list[].bz#,#list[].kz1#,#list[].kz2#,#list[].kz3#,#list[].kz4#
				)
			]]>    
    	</iterate> 
	</insert>
	
	<!-- 查询移交单关联的电子集合 -->
	<select id="query_yjd_dzjh" 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, nhywgysxx c 
		where a.channelsetid=b.channelsetid and a.channelsetid=c.kz1 
		<isNotEmpty prepend='and' property='yjgysbh'>
			c.xh=#yjgysbh#
		</isNotEmpty>
		<isNotEmpty property="jhmc" prepend="and">
			a.channelsetName like '%$jhmc$%'
		</isNotEmpty>
		<isNotEmpty property="sbmc" prepend="and">
			b.channelName like '%$sbmc$%'
		</isNotEmpty>
	</select>
	<select id="count_yjd_dzjh" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from(
			select a.channelsetname 
			from ywvideochannelset a, ywvideochannelsetlist b, nhywgysxx c 
			where a.channelsetid=b.channelsetid and a.channelsetid=c.kz1 
			<isNotEmpty prepend='and' property='yjgysbh'>
				c.xh=#yjgysbh#
			</isNotEmpty>
			<isNotEmpty property="jhmc" prepend="and">
				a.channelsetName like '%$jhmc$%'
			</isNotEmpty>
			<isNotEmpty property="sbmc" prepend="and">
				b.channelName like '%$sbmc$%'
			</isNotEmpty>
		) x			
	</select>
	
	
</sqlMap>











