<?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="Ywvideochannelsetlistbean" type="cn.vp.XXX.model.YwvideochannelsetlistBean"/> -->	<typeAlias alias="Ywvideochannelsetlist" type="cn.im.ywvideochannelsetlist.YwvideochannelsetlistBean"/>
	
	<sql id="condition_Ywvideochannelsetlist">
		where 1=1
		<isNotEmpty prepend='AND' property='LIKEchannellistid'>
			(channellistid like '%$LIKEchannellistid$%'   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='channellistid'>
			(channellistid = #channellistid#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEchannelsetid'>
			(channelsetid like '%$LIKEchannelsetid$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='channelsetid'>
			(channelsetid = #channelsetid# )
		</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='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='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_Ywvideochannelsetlist" parameterClass="java.util.Map">
		insert into 
		ywvideochannelsetlist(
		<dynamic prepend=" ">  
			<isNotEmpty prepend=',' property='channellistid'>channellistid</isNotEmpty>
			<isNotEmpty prepend=',' property='channelsetid'>channelsetid</isNotEmpty>
			<isNotEmpty prepend=',' property='videonum'>videonum</isNotEmpty>
			<isNotEmpty prepend=',' property='channelnum'>channelnum</isNotEmpty>
			<isNotEmpty prepend=',' property='channelname'>channelname</isNotEmpty>
			<isNotEmpty prepend=',' property='videomodel'>videomodel</isNotEmpty>
			<isNotEmpty prepend=',' property='recordxdays'>recordxdays</isNotEmpty>
			<isNotEmpty prepend=',' property='recordmodel'>recordmodel</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='channellistid'>#channellistid#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelsetid'>#channelsetid#</isNotEmpty>
			<isNotEmpty prepend=',' property='videonum'>#videonum#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelnum'>#channelnum#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelname'>#channelname#</isNotEmpty>
			<isNotEmpty prepend=',' property='videomodel'>#videomodel#</isNotEmpty>
			<isNotEmpty prepend=',' property='recordxdays'>#recordxdays#</isNotEmpty>
			<isNotEmpty prepend=',' property='recordmodel'>#recordmodel#</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>
	
	<!-- edit object  -->
	<update id="update_Ywvideochannelsetlist" parameterClass="java.util.Map">
		update ywvideochannelsetlist 
		<dynamic prepend="set ">   
			
			<isNotEmpty prepend=',' property='channelsetid'>channelsetid=#channelsetid#</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='videomodel'>videomodel=#videomodel#</isNotEmpty>
			<isNotEmpty prepend=',' property='recordxdays'>recordxdays=#recordxdays#</isNotEmpty>
			<isNotEmpty prepend=',' property='recordmodel'>recordmodel=#recordmodel#</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='XGTJchannellistid'> channellistid = #XGTJchannellistid#</isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJchannelsetid'> channelsetid = #XGTJchannelsetid# </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='XGTJvideomodel'> videomodel = #XGTJvideomodel# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJrecordxdays'> recordxdays = #XGTJrecordxdays# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJrecordmodel'> recordmodel = #XGTJrecordmodel# </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>
	<!-- edit batch  videomodel-->
	<update id="update_batch_videomodel" parameterClass="java.util.Map">
		update ywvideochannelsetlist 
		<dynamic prepend="set ">   
			
			<isNotEmpty prepend=',' property='videomodel'>videomodel=#videomodel#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifyaccount'>modifyaccount=#modifyaccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifytime'>modifytime=#modifytime#</isNotEmpty>

		</dynamic>
		where 1=1 
			<isNotEmpty prepend='AND' property='channelsetid'> channelsetid = #channelsetid# </isNotEmpty>
			<isNotEmpty prepend='AND' property='list'>
				 channellistid  in 
				<iterate  open="(" close=")" conjunction="," property="list"> 
				
					#list[]#
		    	</iterate> 
	    	
			</isNotEmpty>
	</update>
	<!-- update_batch_recorddays-->
	<update id="update_batch_recorddays" parameterClass="java.util.Map">
		update ywvideochannelsetlist 
		<dynamic prepend="set ">   
			
			<isNotEmpty prepend=',' property='recordxdays'>recordxdays=#recordxdays#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifyaccount'>modifyaccount=#modifyaccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifytime'>modifytime=#modifytime#</isNotEmpty>

		</dynamic>
		where 1=1 
			<isNotEmpty prepend='AND' property='channelsetid'> channelsetid = #channelsetid# </isNotEmpty>
			<isNotEmpty prepend='AND' property='list'>
				 channellistid  in 
				<iterate  open="(" close=")" conjunction="," property="list"> 
				
					#list[]#
		    	</iterate> 
	    	
			</isNotEmpty>
	</update>
	<!-- update_batch_recordmodel-->
	<update id="update_batch_ywvideochannelsetlist" parameterClass="java.util.Map">
		update ywvideochannelsetlist 
		<dynamic prepend="set ">   
			<isNotEmpty prepend=',' property='extend1'>extend1=#extend1#</isNotEmpty>
			<isNotEmpty prepend=',' property='videomodel'>videomodel=#videomodel#</isNotEmpty>
			<isNotEmpty prepend=',' property='recordmodel'>recordmodel=#recordmodel#</isNotEmpty>
			<isNotEmpty prepend=',' property='recordxdays'>recordxdays=#recordxdays#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifyaccount'>modifyaccount=#modifyaccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifytime'>modifytime=#modifytime#</isNotEmpty>

		</dynamic>
		where 1=1 
			<isNotEmpty prepend='AND' property='channelsetid'> channelsetid = #channelsetid# </isNotEmpty>
			<isNotEmpty prepend='AND' property='list'>
				 channellistid  in 
				<iterate  open="(" close=")" conjunction="," property="list"> 
				
					#list[]#
		    	</iterate> 
	    	
			</isNotEmpty>
	</update>
	<!-- delete object -->
	<delete id="delete_Ywvideochannelsetlist" parameterClass="java.util.Map">
		delete from ywvideochannelsetlist 
		<include refid="condition_Ywvideochannelsetlist"/>
	</delete>
	
	<!-- batch delete object -->
	<delete id="batch_delete_Ywvideochannelsetlist" parameterClass="java.util.List">
		delete from ywvideochannelsetlist 
		where 1=1
			and channellistid  in (
			<iterate conjunction=" ," > 
			
				#list[]#
	    	</iterate> 
	    	)
	</delete>
	
	<!-- query objects by page-->
	<select id="query_Ywvideochannelsetlist" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
			a.channellistid,a.channelsetid,a.videonum,a.channelnum,
			a.channelname,a.recordxdays,a.recordmodel,a.videomodel,
			(select csmc from xtcl where csdl='ywRecordModel' and csdm=a.recordmodel) as recordmodelname,
			(select csmc from xtcl where csdl='ywVideoModel' and csdm=a.videomodel) as videomodelname,
			<!-- a.videomodel,a.recordmodel, -->
			a.createaccount,a.createtime,a.modifyaccount,a.modifytime,
			a.remarks,a.extend1,a.extend2,a.extend3,a.extend4
		from ywvideochannelsetlist 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#  or (b.xzbh in (select xzbh from ptxzs where sjxzbh = #xzbh#)) )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='channelsetid'>
			(channelsetid = #channelsetid#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEchannelname'>
			(channelname like '%$LIKEchannelname$%'  )
		</isNotEmpty>
		<isNotEmpty property='order'>
			$order$
		</isNotEmpty>
		<!-- <isNotEmpty prepend=' ' property='start'>
			limit #start# ,#limit#
		</isNotEmpty> -->
		<!-- <include refid="condition_Ywvideochannelsetlist"/>	 -->
	</select>
	<select id="query_Ywvideochannelsetlist_select" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
			a.channellistid
		from ywvideochannelsetlist a 
		where 1=1
		<isNotEmpty prepend='AND' property='channelsetid'>
			(channelsetid = #channelsetid# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='videonum'>
			(videonum = #videonum#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='channelnum'>
			(channelnum = #channelnum#  )
		</isNotEmpty>
	</select>
	
	<!-- query objects totalcount -->
	<select id="count_Ywvideochannelsetlist" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from ywvideochannelsetlist 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#  or (b.xzbh in (select xzbh from ptxzs where sjxzbh = #xzbh#)) )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='channelsetid'>
			(channelsetid = #channelsetid# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEchannelname'>
			(channelname like '%$LIKEchannelname$%'  )
		</isNotEmpty>
	</select>
	
	<!-- batch add objects -->
	<insert id="batch_insert_Ywvideochannelsetlist" parameterClass="java.util.List">
	 	<![CDATA[
          INSERT
      	]]>     	
			into ywvideochannelsetlist(
			 <![CDATA[ 
				channellistid,channelsetid,videonum,channelnum,channelname,videomodel,recordxdays,recordmodel,createaccount,createtime,modifyaccount,modifytime,remarks,extend1,extend2,extend3,extend4
			)values
			 ]]>  
			 <iterate conjunction="," > 		 
			 <![CDATA[ 
				(
				#list[].channellistid#,#list[].channelsetid#,#list[].videonum#,#list[].channelnum#,#list[].channelname#,#list[].videomodel#,#list[].recordxdays#,#list[].recordmodel#,#list[].createaccount#,#list[].createtime#,#list[].modifyaccount#,#list[].modifytime#,#list[].remarks#,#list[].extend1#,#list[].extend2#,#list[].extend3#,#list[].extend4#
				)
			]]>    
    	</iterate> 
	</insert>
	<insert id="batch_add_Ywvideochannelsetlist" parameterClass="java.util.List">
	 	<![CDATA[
          INSERT into ywvideochannelsetlist(channellistid,channelsetid,videonum,channelnum,channelname,createaccount,createtime,modifyaccount,modifytime
			)values
      	]]>
      	<iterate conjunction=" ," > 
			
			 <![CDATA[ 
				(
				#list[].channellistid#,#list[].channelsetid#,#list[].videonum#,#list[].channelnum#,#list[].channelname#,#list[].createaccount#,#list[].createtime#,#list[].modifyaccount#,#list[].modifytime#
				)
			]]>    
    	</iterate> 
	</insert>
</sqlMap>











