<?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="Ywvideotaskbysetlistbean" type="cn.vp.XXX.model.YwvideotaskbysetlistBean"/> -->	<typeAlias alias="Ywvideotaskbysetlist" type="cn.im.ywvideotaskbysetlist.YwvideotaskbysetlistBean"/>
	
	<sql id="condition_Ywvideotaskbysetlist">
		where 1=1
		<isNotEmpty prepend='AND' property='LIKEid'>
			(id like '%$LIKEid$%'   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='id'>
			(id = #id#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEtaskid'>
			(taskid like '%$LIKEtaskid$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='taskid'>
			(taskid = #taskid# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEchannelsetid'>
			(channelsetid like '%$LIKEchannelsetid$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='channelsetid'>
			(channelsetid = #channelsetid# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEchannellistid'>
			(channellistid like '%$LIKEchannellistid$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='channellistid'>
			(channellistid = #channellistid# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvideonum'>
			(videonum like '%$LIKEvideonum$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='videonum'>
			(videonum = #videonum# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEchannelnum'>
			(channelnum like '%$LIKEchannelnum$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='channelnum'>
			(channelnum = #channelnum# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEchannelname'>
			(channelname like '%$LIKEchannelname$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='channelname'>
			(channelname = #channelname# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEchannelsort'>
			(channelsort like '%$LIKEchannelsort$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='channelsort'>
			(channelsort = #channelsort# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvideomodel'>
			(videomodel like '%$LIKEvideomodel$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='videomodel'>
			(videomodel = #videomodel# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKErecordxdays'>
			(recordxdays like '%$LIKErecordxdays$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='recordxdays'>
			(recordxdays = #recordxdays# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKErecordmodel'>
			(recordmodel like '%$LIKErecordmodel$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='recordmodel'>
			(recordmodel = #recordmodel# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEdetectionswitch'>
			(detectionswitch like '%$LIKEdetectionswitch$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='detectionswitch'>
			(detectionswitch = #detectionswitch# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEdetectionstarttime'>
			(detectionstarttime like '%$LIKEdetectionstarttime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='detectionstarttime'>
			(detectionstarttime = #detectionstarttime# )
		</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 property='tableparam'>
			$tableparam$
		</isNotEmpty>
		<isNotEmpty property='order'>
			$order$
		</isNotEmpty>
	</sql>
	
	<!-- add object -->
	<insert id="insert_Ywvideotaskbysetlist" parameterClass="java.util.Map">
		insert into 
		ywvideotaskbysetlist(
		<dynamic prepend=" ">  
			<isNotEmpty prepend=',' property='id'>id</isNotEmpty>
			<isNotEmpty prepend=',' property='taskid'>taskid</isNotEmpty>
			<isNotEmpty prepend=',' property='channelsetid'>channelsetid</isNotEmpty>
			<isNotEmpty prepend=',' property='channellistid'>channellistid</isNotEmpty>
			<isNotEmpty prepend=',' property='videonum'>videonum</isNotEmpty>
			<isNotEmpty prepend=',' property='channelnum'>channelnum</isNotEmpty>
			<isNotEmpty prepend=',' property='channelname'>channelname</isNotEmpty>
			<isNotEmpty prepend=',' property='channelsort'>channelsort</isNotEmpty>
			<isNotEmpty prepend=',' property='videomodel'>videomodel</isNotEmpty>
			<isNotEmpty prepend=',' property='recordxdays'>recordxdays</isNotEmpty>
			<isNotEmpty prepend=',' property='recordmodel'>recordmodel</isNotEmpty>
			<isNotEmpty prepend=',' property='detectionswitch'>detectionswitch</isNotEmpty>
			<isNotEmpty prepend=',' property='detectionstarttime'>detectionstarttime</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>

		</dynamic>  
	    <![CDATA[ 
	        ) values ( 
	    ]]>  
	     <dynamic prepend=" "> 
			<isNotEmpty prepend=',' property='id'>#id#</isNotEmpty>
			<isNotEmpty prepend=',' property='taskid'>#taskid#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelsetid'>#channelsetid#</isNotEmpty>
			<isNotEmpty prepend=',' property='channellistid'>#channellistid#</isNotEmpty>
			<isNotEmpty prepend=',' property='videonum'>#videonum#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelnum'>#channelnum#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelname'>#channelname#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelsort'>#channelsort#</isNotEmpty>
			<isNotEmpty prepend=',' property='videomodel'>#videomodel#</isNotEmpty>
			<isNotEmpty prepend=',' property='recordxdays'>#recordxdays#</isNotEmpty>
			<isNotEmpty prepend=',' property='recordmodel'>#recordmodel#</isNotEmpty>
			<isNotEmpty prepend=',' property='detectionswitch'>#detectionswitch#</isNotEmpty>
			<isNotEmpty prepend=',' property='detectionstarttime'>#detectionstarttime#</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>

		 </dynamic>  
	    <![CDATA[ 
	        ) 
	    ]]> 
	</insert>
	<update id="batch_update_Ywvideotaskbysetlist" parameterClass="java.util.Map">
		update ywvideotaskbysetlist 
		<dynamic prepend="set ">   
			<isNotEmpty prepend=',' property='detectionswitch'>detectionswitch=#detectionswitch#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifyaccount'>modifyaccount=#modifyaccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifytime'>modifytime=#modifytime#</isNotEmpty>

		</dynamic>
		where 1=1 
			<isNotEmpty prepend='AND' property='list'>
				 id  in 
				<iterate  open="(" close=")" conjunction="," property="list"> 
				
					#list[]#
		    	</iterate> 
	    	
			</isNotEmpty>
	</update>
	<!-- edit object  -->
	<update id="update_Ywvideotaskbysetlist" parameterClass="java.util.Map">
		update ywvideotaskbysetlist 
		<dynamic prepend="set ">   
			
			<isNotEmpty prepend=',' property='taskid'>taskid=#taskid#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelsetid'>channelsetid=#channelsetid#</isNotEmpty>
			<isNotEmpty prepend=',' property='channellistid'>channellistid=#channellistid#</isNotEmpty>
			<isNotEmpty prepend=',' property='videonum'>videonum=#videonum#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelnum'>channelnum=#channelnum#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelname'>channelname=#channelname#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelsort'>channelsort=#channelsort#</isNotEmpty>
			<isNotEmpty prepend=',' property='videomodel'>videomodel=#videomodel#</isNotEmpty>
			<isNotEmpty prepend=',' property='recordxdays'>recordxdays=#recordxdays#</isNotEmpty>
			<isNotEmpty prepend=',' property='recordmodel'>recordmodel=#recordmodel#</isNotEmpty>
			<isNotEmpty prepend=',' property='detectionswitch'>detectionswitch=#detectionswitch#</isNotEmpty>
			<isNotEmpty prepend=',' property='detectionstarttime'>detectionstarttime=#detectionstarttime#</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>

		</dynamic>
		where 1=1 
			<isNotEmpty prepend='AND' property='XGTJid'> id = #XGTJid#</isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJtaskid'> taskid = #XGTJtaskid# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJchannelsetid'> channelsetid = #XGTJchannelsetid# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJchannellistid'> channellistid = #XGTJchannellistid# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvideonum'> videonum = #XGTJvideonum# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJchannelnum'> channelnum = #XGTJchannelnum# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJchannelname'> channelname = #XGTJchannelname# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJchannelsort'> channelsort = #XGTJchannelsort# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvideomodel'> videomodel = #XGTJvideomodel# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJrecordxdays'> recordxdays = #XGTJrecordxdays# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJrecordmodel'> recordmodel = #XGTJrecordmodel# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJdetectionswitch'> detectionswitch = #XGTJdetectionswitch# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJdetectionstarttime'> detectionstarttime = #XGTJdetectionstarttime# </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>

	</update>
	
	<!-- delete object -->
	<delete id="delete_Ywvideotaskbysetlist" parameterClass="java.util.Map">
		delete from ywvideotaskbysetlist 
		<isNotEmpty prepend='AND' property='taskid'> 
			taskid = #taskid# 
		</isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJchannelsetid'> 
				channelsetid = #XGTJchannelsetid# 
			</isNotEmpty>
	</delete>
	
	<!-- batch delete object -->
	<delete id="batch_delete_Ywvideotaskbysetlist" parameterClass="java.util.Map">
		delete from ywvideotaskbysetlist 
		where 1=1
			<isNotEmpty prepend='AND' property='keyword'>
			key  in (#keyword#)
			</isNotEmpty>
	</delete>
	
	<!-- query objects by page-->
	<select id="query_Ywvideotaskbysetlist" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
			id,taskid,channelsetid,channellistid,videonum,channelnum,channelname,channelsort,videomodel,recordxdays,recordmodel,detectionswitch,detectionstarttime,createaccount,createtime,modifyaccount,modifytime,remarks,extend1,extend2,extend3,extend4
		from ywvideotaskbysetlist 
		<include refid="condition_Ywvideotaskbysetlist"/>		
	</select>
	<select id="query_Ywvideotaskbysetlist_task" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
			a.id,a.taskid,a.channelsetid,a.channellistid,a.videonum,a.channelnum,a.channelname,
			a.channelsort,a.videomodel,a.recordxdays,a.recordmodel,a.detectionswitch,a.detectionstarttime,
			a.createaccount,a.createtime,a.modifyaccount,a.modifytime,a.remarks,a.extend1,a.extend2,a.extend3,a.extend4,
			(select channelsetname from ywvideochannelset b where b.channelsetid=a.channelsetid limit 1 ) as channelsetname,
			(select csmc from xtcl c where c.csdl='ywTaskSwitch' and c.csdm=a.detectionswitch limit 1 ) as detectionswitchname
		from ywvideotaskbysetlist  a 
		left join sbtdspsr b on (a.videonum=b.sbbh and a.channelnum=b.tdbh)
		where 1=1
		<isNotEmpty prepend='AND' property='xzbh'> 
			b.xzbh = #xzbh# 
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEtaskid'>
			(a.taskid = #LIKEtaskid#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEchannelname'>
			(a.channelname like '%$LIKEchannelname$%'  )
		</isNotEmpty>
		<isNotEmpty property='order'>
			$order$
		</isNotEmpty>
		<isNotEmpty prepend=' ' property='start'>
			limit #start# ,#limit#
		</isNotEmpty>	
	</select>
	
	<!-- query objects totalcount -->
	<select id="count_Ywvideotaskbysetlist" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from ywvideotaskbysetlist 
		<include refid="condition_Ywvideotaskbysetlist"/>			
	</select>
	<select id="count_Ywvideotaskbysetlist_task" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*)
		from ywvideotaskbysetlist  a 
		left join sbtdspsr b on (a.videonum=b.sbbh and a.channelnum=b.tdbh)
		where 1=1
		<isNotEmpty prepend='AND' property='xzbh'> 
			b.xzbh = #xzbh# 
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEtaskid'>
			(a.taskid = #LIKEtaskid#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEchannelname'>
			(a.channelname like '%$LIKEchannelname$%'  )
		</isNotEmpty>		
	</select>
	
	<!-- batch add objects -->
	<insert id="batch_insert_Ywvideotaskbysetlist" parameterClass="java.util.List">
	 	<![CDATA[
          INSERT into ywvideotaskbysetlist(
				id,taskid,channelsetid,channellistid,videonum,channelnum,channelname,channelsort,videomodel,recordxdays,recordmodel,createaccount,createtime,modifyaccount,modifytime
			)values
      	]]>
      	<iterate conjunction=" ," > 
			
			 <![CDATA[ 
				(
				#list[].id#,#list[].taskid#,#list[].channelsetid#,#list[].channellistid#,#list[].videonum#,#list[].channelnum#,#list[].channelname#,#list[].channelsort#,#list[].videomodel#,#list[].recordxdays#,#list[].recordmodel#,#list[].createaccount#,#list[].createtime#,#list[].modifyaccount#,#list[].modifytime#
				)
			]]>    
    	</iterate> 
	</insert>
</sqlMap>











