<?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="" >
<!-- 	<typeAlias alias="Ywvideochannelsetbean" type="cn.vp.XXX.model.YwvideochannelsetBean"/> -->	<typeAlias alias="Ywvideochannelset" type="cn.im.ywvideochannel.YwvideochannelsetBean"/>
	
	<sql id="condition_Ywvideochannelset">
		where 1=1
		<isNotEmpty prepend='AND ' property='LIKEchannelsetid'>
			(channelsetid like '%$LIKEchannelsetid$%'   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='channelsetid'>
			(channelsetid = #channelsetid#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEchannelsetname'>
			(channelsetname like '%$LIKEchannelsetname$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='channelsetname'>
			(channelsetname = #channelsetname# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEcreateaccount'>
			(createaccount like '%$LIKEcreateaccount$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='createaccount'>
			(createaccount = #createaccount# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEcreatetime'>
			(createtime like '%$LIKEcreatetime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='createtime'>
			(createtime = #createtime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEmodifyaccount'>
			(modifyaccount like '%$LIKEmodifyaccount$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='modifyaccount'>
			(modifyaccount = #modifyaccount# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEmodifytime'>
			(modifytime like '%$LIKEmodifytime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='modifytime'>
			(modifytime = #modifytime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEremarks'>
			(remarks like '%$LIKEremarks$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='remarks'>
			(remarks = #remarks# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEextend1'>
			(extend1 like '%$LIKEextend1$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='extend1'>
			(extend1 = #extend1# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEextend2'>
			(extend2 like '%$LIKEextend2$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='extend2'>
			(extend2 = #extend2# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEextend3'>
			(extend3 like '%$LIKEextend3$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='extend3'>
			(extend3 = #extend3# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEextend4'>
			(extend4 like '%$LIKEextend4$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='extend4'>
			(extend4 = #extend4# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='devicetype'>
			devicetype = #devicetype#
		</isNotEmpty>
		<isNotEmpty property='tableparam'>
			$tableparam$
		</isNotEmpty>
		<isNotEmpty property='order'>
			$order$
		</isNotEmpty>
	</sql>
	
	<!-- add object -->
	<insert id="insert_Ywvideochannelset" parameterClass="java.util.Map">
		insert into 
		ywvideochannelset(
		<dynamic prepend=" ">  
			<isNotEmpty prepend=',' property='channelsetid'>channelsetid</isNotEmpty>
			<isNotEmpty prepend=',' property='channelsetname'>channelsetname</isNotEmpty>
			<isNotEmpty prepend=',' property='createaccount'>createaccount</isNotEmpty>
			<isNotEmpty prepend=',' property='createtime'>createtime</isNotEmpty>
			<isNotEmpty prepend=',' property='modifyaccount'>modifyaccount</isNotEmpty>
			<isNotEmpty prepend=',' property='modifytime'>modifytime</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks'>remarks</isNotEmpty>
			<isNotEmpty prepend=',' property='extend1'>extend1</isNotEmpty>
			<isNotEmpty prepend=',' property='extend2'>extend2</isNotEmpty>
			<isNotEmpty prepend=',' property='extend3'>extend3</isNotEmpty>
			<isNotEmpty prepend=',' property='extend4'>extend4</isNotEmpty>
			<isNotEmpty prepend=',' property='devicetype'>devicetype</isNotEmpty>
		</dynamic>  
	    <![CDATA[ 
	        ) values ( 
	    ]]>  
	     <dynamic prepend=" "> 
			<isNotEmpty prepend=',' property='channelsetid'>#channelsetid#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelsetname'>#channelsetname#</isNotEmpty>
			<isNotEmpty prepend=',' property='createaccount'>#createaccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='createtime'>#createtime#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifyaccount'>#modifyaccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifytime'>#modifytime#</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks'>#remarks#</isNotEmpty>
			<isNotEmpty prepend=',' property='extend1'>#extend1#</isNotEmpty>
			<isNotEmpty prepend=',' property='extend2'>#extend2#</isNotEmpty>
			<isNotEmpty prepend=',' property='extend3'>#extend3#</isNotEmpty>
			<isNotEmpty prepend=',' property='extend4'>#extend4#</isNotEmpty>
			 <isNotEmpty prepend=',' property='devicetype'>#devicetype#</isNotEmpty>
		 </dynamic>  
	    <![CDATA[ 
	        ) 
	    ]]> 
	</insert>
	
	<!-- edit object  -->
	<update id="update_Ywvideochannelset" parameterClass="java.util.Map">
		update ywvideochannelset 
		<dynamic prepend="set ">   
			
			<isNotEmpty prepend=',' property='channelsetname'>channelsetname=#channelsetname#</isNotEmpty>
			<isNotEmpty prepend=',' property='createaccount'>createaccount=#createaccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='createtime'>createtime=#createtime#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifyaccount'>modifyaccount=#modifyaccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifytime'>modifytime=#modifytime#</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks'>remarks=#remarks#</isNotEmpty>
			<isNotEmpty prepend=',' property='extend1'>extend1=#extend1#</isNotEmpty>
			<isNotEmpty prepend=',' property='extend2'>extend2=#extend2#</isNotEmpty>
			<isNotEmpty prepend=',' property='extend3'>extend3=#extend3#</isNotEmpty>
			<isNotEmpty prepend=',' property='extend4'>extend4=#extend4#</isNotEmpty>
			<isNotEmpty prepend=',' property='devicetype'>devicetype=#devicetype#</isNotEmpty>
		</dynamic>
		where channelsetid = #XGTJchannelsetid#
			<isNotEmpty prepend='AND ' property='XGTJchannelsetname'> channelsetname = #XGTJchannelsetname# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJcreateaccount'> createaccount = #XGTJcreateaccount# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJcreatetime'> createtime = #XGTJcreatetime# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJmodifyaccount'> modifyaccount = #XGTJmodifyaccount# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJmodifytime'> modifytime = #XGTJmodifytime# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJremarks'> remarks = #XGTJremarks# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJextend1'> extend1 = #XGTJextend1# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJextend2'> extend2 = #XGTJextend2# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJextend3'> extend3 = #XGTJextend3# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJextend4'> extend4 = #XGTJextend4# </isNotEmpty>
		    <isNotEmpty prepend='AND ' property='XGTJdevicetype'> devicetype = #XGTJdevicetype# </isNotEmpty>
	</update>
	
	<!-- delete object -->
	<delete id="delete_Ywvideochannelset" parameterClass="java.util.Map">
		delete from ywvideochannelset 
		<include refid="condition_Ywvideochannelset"/>
	</delete>
	
	<!-- batch delete object -->
	<delete id="batch_delete_Ywvideochannelset" parameterClass="java.util.Map">
		delete from ywvideochannelset 
		where 	channelsetid  in (#keyword#)
	</delete>
	
	<!-- query objects by page-->
	<select id="query_Ywvideochannelset" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select channelsetid,channelsetname,createaccount,createtime,modifyaccount,modifytime,remarks,extend1
		,extend2,extend3,extend4,devicetype
		from ywvideochannelset
		where 1=1
		<isNotEmpty prepend='AND ' property='LIKEchannelsetid'>
			(channelsetid like '%$LIKEchannelsetid$%'   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='channelsetid'>
			(channelsetid = #channelsetid#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEchannelsetname'>
			(channelsetname like '%$LIKEchannelsetname$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='channelsetname'>
			(channelsetname = #channelsetname# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEcreateaccount'>
			(createaccount like '%$LIKEcreateaccount$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='createaccount'>
			(createaccount = #createaccount# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEcreatetime'>
			(createtime like '%$LIKEcreatetime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='createtime'>
			(createtime = #createtime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEmodifyaccount'>
			(modifyaccount like '%$LIKEmodifyaccount$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='modifyaccount'>
			(modifyaccount = #modifyaccount# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEmodifytime'>
			(modifytime like '%$LIKEmodifytime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='modifytime'>
			(modifytime = #modifytime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEremarks'>
			(remarks like '%$LIKEremarks$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='remarks'>
			(remarks = #remarks# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEextend1'>
			(extend1 like '%$LIKEextend1$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='extend1'>
			(extend1 = #extend1# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEextend2'>
			(extend2 like '%$LIKEextend2$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='extend2'>
			(extend2 = #extend2# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEextend3'>
			(extend3 like '%$LIKEextend3$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='extend3'>
			(extend3 = #extend3# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEextend4'>
			(extend4 like '%$LIKEextend4$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='extend4'>
			(extend4 = #extend4# )
		</isNotEmpty>

		<isNotEmpty prepend='AND ' property='LIKEdevicetype'>
			(devicetype like '%$LIKEdevicetype$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='devicetype'>
			(devicetype = #devicetype# )
		</isNotEmpty>

		<isNotEmpty property='tableparam'>
			$tableparam$
		</isNotEmpty>
		<isNotEmpty property='order'>
			$order$
		</isNotEmpty>	
		<!-- <isNotEmpty prepend=' ' property='start'>
			limit #start# ,#limit#
		</isNotEmpty> -->
	</select>
	<select id="query_Ywvideochannelset_taskselect" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select distinct
			a.channelsetid,a.channelsetname,a.remarks,devicetype
		from ywvideochannelset a left join ywvideotask b  on (b.channelsetid=a.channelsetid )
		where 1=1
		<isNotEmpty prepend='AND ' property='taskid'>
			b.taskid = #taskid#
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEchannelsetname'>
			(a.channelsetname like '%$LIKEchannelsetname$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='devicetype'>
			a.devicetype = #devicetype#
		</isNotEmpty>
		<isNotEmpty property='order'>
			$order$
		</isNotEmpty>	
		<!-- <isNotEmpty prepend=' ' property='start'>
			limit #start# ,#limit#
		</isNotEmpty> -->
	</select>
	<select id="query_Ywvideochannelset_taskunselect" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select distinct
			a.channelsetid,a.channelsetname,a.remarks,devicetype
		from ywvideochannelset a 
		where 1=1
		<isNotEmpty prepend='AND ' property='taskid'>
			(a.channelsetid not in (select  case when channelsetid is null then ' ' else channelsetid end from ywvideotask b where b.taskid= #taskid#  ) )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEchannelsetname'>
			(a.channelsetname like '%$LIKEchannelsetname$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='devicetype'>
			a.devicetype = #devicetype#
		</isNotEmpty>
		<isNotEmpty property='order'>
			$order$
		</isNotEmpty>	
		<!-- <isNotEmpty prepend=' ' property='start'>
			limit #start# ,#limit#
		</isNotEmpty> -->
	</select>
	
	<!-- query objects totalcount -->
	<select id="count_Ywvideochannelset" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from ywvideochannelset 
		where 1=1
		<isNotEmpty prepend='AND ' property='LIKEchannelsetid'>
			(channelsetid like '%$LIKEchannelsetid$%'   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='channelsetid'>
			(channelsetid = #channelsetid#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEchannelsetname'>
			(channelsetname like '%$LIKEchannelsetname$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='channelsetname'>
			(channelsetname = #channelsetname# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEcreateaccount'>
			(createaccount like '%$LIKEcreateaccount$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='createaccount'>
			(createaccount = #createaccount# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEcreatetime'>
			(createtime like '%$LIKEcreatetime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='createtime'>
			(createtime = #createtime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEmodifyaccount'>
			(modifyaccount like '%$LIKEmodifyaccount$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='modifyaccount'>
			(modifyaccount = #modifyaccount# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEmodifytime'>
			(modifytime like '%$LIKEmodifytime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='modifytime'>
			(modifytime = #modifytime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEremarks'>
			(remarks like '%$LIKEremarks$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='remarks'>
			(remarks = #remarks# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEextend1'>
			(extend1 like '%$LIKEextend1$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='extend1'>
			(extend1 = #extend1# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEextend2'>
			(extend2 like '%$LIKEextend2$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='extend2'>
			(extend2 = #extend2# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEextend3'>
			(extend3 like '%$LIKEextend3$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='extend3'>
			(extend3 = #extend3# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEextend4'>
			(extend4 like '%$LIKEextend4$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='extend4'>
			(extend4 = #extend4# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='devicetype'>
			devicetype = #devicetype#
		</isNotEmpty>
		<isNotEmpty property='tableparam'>
			$tableparam$
		</isNotEmpty>		
	</select>
	
	<select id="count_Ywvideochannelset_task" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select 
			count(*)
		from ywvideochannelset a
		left join ywvideotaskbysetlist b on a.channelsetid=b.channelsetid
		where 1=1
		<isNotEmpty prepend='AND ' property='taskid'>
			(b.taskid = #taskid#   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEchannelsetname'>
			(a.channelsetname like '%$LIKEchannelsetname$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='devicetype'>
			devicetype = #devicetype#
		</isNotEmpty>
	</select>
	<select id="count_Ywvideochannelset_taskunselect" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select 
			count(*)
		from ywvideochannelset a
		where 1=1
		<isNotEmpty prepend='AND ' property='taskid'>
			(a.channelsetid not in (select case when channelsetid is null then ' ' else channelsetid end from ywvideotask b where b.taskid= #taskid# )  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEchannelsetname'>
			(a.channelsetname like '%$LIKEchannelsetname$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='devicetype'>
			devicetype = #devicetype#
		</isNotEmpty>
	</select>
	<select id="count_Ywvideochannelset_taskselect" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select 
			count(*)
		from ywvideochannelset a left join ywvideotask b  on (b.channelsetid=a.channelsetid )
		where 1=1
		<isNotEmpty prepend='AND ' property='taskid'>
			b.taskid = #taskid#
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEchannelsetname'>
			(a.channelsetname like '%$LIKEchannelsetname$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='devicetype'>
			devicetype = #devicetype#
		</isNotEmpty>
	</select>
	
	<!-- batch add objects -->
	<insert id="batch_insert_Ywvideochannelset" parameterClass="java.util.List">
	 	<![CDATA[
          INSERT
      	]]>
      	<iterate conjunction=" " > 
			into ywvideochannelset(
			 <![CDATA[ 
				channelsetid,channelsetname,createaccount,createtime,modifyaccount,modifytime,remarks,extend1,extend2,extend3,extend4,devicetype
			)values
			 ]]>  		 
			 <![CDATA[ 
				(
				#list[].channelsetid#,#list[].channelsetname#,#list[].createaccount#,#list[].createtime#,#list[].modifyaccount#,#list[].modifytime#,#list[].remarks#,#list[].extend1#,#list[].extend2#,#list[].extend3#,#list[].extend4#,#list[].devicetype#
				)
			]]>    
    	</iterate> 
	</insert>
</sqlMap>











