<?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="Ywvideocurrentstatebean" type="cn.vp.XXX.model.YwvideocurrentstateBean"/> -->	<typeAlias alias="Ywvideocurrentstate" type="cn.yw.ywvideocurrentstate.YwvideocurrentstateBean"/>
	
	<sql id="condition_Ywvideocurrentstate">
		where 1=1
		<isNotEmpty prepend='AND' property='LIKEcurrentstateid'>
			(currentstateid like '%$LIKEcurrentstateid$%'   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='currentstateid'>
			(currentstateid = #currentstateid#  )
		</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='LIKEvideocatalog'>
			(videocatalog like '%$LIKEvideocatalog$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='videocatalog'>
			(videocatalog = #videocatalog# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcurrentstate'>
			(currentstate like '%$LIKEcurrentstate$%'   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='currentstate'>
			(currentstate = #currentstate#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcurrentstatetime'>
			(currentstatetime like '%$LIKEcurrentstatetime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='currentstatetime'>
			(currentstatetime = #currentstatetime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEisonline'>
			(isonline like '%$LIKEisonline$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='isonline'>
			(isonline = #isonline# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEplayfail'>
			(playfail like '%$LIKEplayfail$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='playfail'>
			(playfail = #playfail# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEnetworkerror'>
			(networkerror like '%$LIKEnetworkerror$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='networkerror'>
			(networkerror = #networkerror# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvqcstate'>
			(vqcstate like '%$LIKEvqcstate$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='vqcstate'>
			(vqcstate = #vqcstate# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvqcfailuretype'>
			(vqcfailuretype like '%$LIKEvqcfailuretype$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='vqcfailuretype'>
			(vqcfailuretype = #vqcfailuretype# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvqcfailurecause'>
			(vqcfailurecause like '%$LIKEvqcfailurecause$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='vqcfailurecause'>
			(vqcfailurecause = #vqcfailurecause# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvqctaskid'>
			(vqctaskid like '%$LIKEvqctaskid$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='vqctaskid'>
			(vqctaskid = #vqctaskid# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvideostatus'>
			(videostatus like '%$LIKEvideostatus$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='videostatus'>
			(videostatus = #videostatus# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvideofailurecause'>
			(videofailurecause like '%$LIKEvideofailurecause$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='videofailurecause'>
			(videofailurecause = #videofailurecause# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvqdstate'>
			(vqdstate like '%$LIKEvqdstate$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='vqdstate'>
			(vqdstate = #vqdstate# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEnosignalstatus'>
			(nosignalstatus like '%$LIKEnosignalstatus$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='nosignalstatus'>
			(nosignalstatus = #nosignalstatus# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEimgclearstatus'>
			(imgclearstatus like '%$LIKEimgclearstatus$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='imgclearstatus'>
			(imgclearstatus = #imgclearstatus# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEimgcontraststatus'>
			(imgcontraststatus like '%$LIKEimgcontraststatus$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='imgcontraststatus'>
			(imgcontraststatus = #imgcontraststatus# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEimgcolorstatus'>
			(imgcolorstatus like '%$LIKEimgcolorstatus$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='imgcolorstatus'>
			(imgcolorstatus = #imgcolorstatus# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEimglightstatus'>
			(imglightstatus like '%$LIKEimglightstatus$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='imglightstatus'>
			(imglightstatus = #imglightstatus# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvideofreezestatus'>
			(videofreezestatus like '%$LIKEvideofreezestatus$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='videofreezestatus'>
			(videofreezestatus = #videofreezestatus# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvideojitterstatus'>
			(videojitterstatus like '%$LIKEvideojitterstatus$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='videojitterstatus'>
			(videojitterstatus = #videojitterstatus# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvideoupheavalstatus'>
			(videoupheavalstatus like '%$LIKEvideoupheavalstatus$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='videoupheavalstatus'>
			(videoupheavalstatus = #videoupheavalstatus# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvideocodeerrorstatus'>
			(videocodeerrorstatus like '%$LIKEvideocodeerrorstatus$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='videocodeerrorstatus'>
			(videocodeerrorstatus = #videocodeerrorstatus# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvideonoisestatus'>
			(videonoisestatus like '%$LIKEvideonoisestatus$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='videonoisestatus'>
			(videonoisestatus = #videonoisestatus# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvideorollstripestatus'>
			(videorollstripestatus like '%$LIKEvideorollstripestatus$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='videorollstripestatus'>
			(videorollstripestatus = #videorollstripestatus# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvqdfailuretype'>
			(vqdfailuretype like '%$LIKEvqdfailuretype$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='vqdfailuretype'>
			(vqdfailuretype = #vqdfailuretype# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvqdfailurecause'>
			(vqdfailurecause like '%$LIKEvqdfailurecause$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='vqdfailurecause'>
			(vqdfailurecause = #vqdfailurecause# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvqdtaskid'>
			(vqdtaskid like '%$LIKEvqdtaskid$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='vqdtaskid'>
			(vqdtaskid = #vqdtaskid# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKErecordstate'>
			(recordstate like '%$LIKErecordstate$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='recordstate'>
			(recordstate = #recordstate# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKErecordfailuretype'>
			(recordfailuretype like '%$LIKErecordfailuretype$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='recordfailuretype'>
			(recordfailuretype = #recordfailuretype# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKErecordfailurecause'>
			(recordfailurecause like '%$LIKErecordfailurecause$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='recordfailurecause'>
			(recordfailurecause = #recordfailurecause# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKErecordtaskid'>
			(recordtaskid like '%$LIKErecordtaskid$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='recordtaskid'>
			(recordtaskid = #recordtaskid# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvideolabelstatus'>
			(videolabelstatus like '%$LIKEvideolabelstatus$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='videolabelstatus'>
			(videolabelstatus = #videolabelstatus# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvideolabeltime'>
			(videolabeltime like '%$LIKEvideolabeltime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='videolabeltime'>
			(videolabeltime = #videolabeltime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvideolabelaccount'>
			(videolabelaccount like '%$LIKEvideolabelaccount$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='videolabelaccount'>
			(videolabelaccount = #videolabelaccount# )
		</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='xzbh'>
				(d.xzbh = #xzbh#  or (d.xzbh in (select xzbh from ptxzs where sjxzbh = #xzbh#)) )
		</isNotEmpty>
		<isNotEmpty property='tableparam'>
			$tableparam$
		</isNotEmpty>
		<isNotEmpty property='order'>
			$order$
		</isNotEmpty>
	</sql>
	
	<!-- add object -->
	<insert id="insert_Ywvideocurrentstate" parameterClass="java.util.Map">
		insert into 
		ywvideocurrentstate(
		<dynamic prepend=" ">  
			<isNotEmpty prepend=',' property='currentstateid'>currentstateid</isNotEmpty>
<isNotEmpty prepend=',' property='currentstate'>currentstate</isNotEmpty>
			<isNotEmpty prepend=',' property='videonum'>videonum</isNotEmpty>
			<isNotEmpty prepend=',' property='channelnum'>channelnum</isNotEmpty>
			<isNotEmpty prepend=',' property='channelname'>channelname</isNotEmpty>
			<isNotEmpty prepend=',' property='videocatalog'>videocatalog</isNotEmpty>
			<isNotEmpty prepend=',' property='currentstatetime'>currentstatetime</isNotEmpty>
			<isNotEmpty prepend=',' property='isonline'>isonline</isNotEmpty>
			<isNotEmpty prepend=',' property='playfail'>playfail</isNotEmpty>
			<isNotEmpty prepend=',' property='networkerror'>networkerror</isNotEmpty>
			<isNotEmpty prepend=',' property='vqcstate'>vqcstate</isNotEmpty>
			<isNotEmpty prepend=',' property='vqcfailuretype'>vqcfailuretype</isNotEmpty>
			<isNotEmpty prepend=',' property='vqcfailurecause'>vqcfailurecause</isNotEmpty>
			<isNotEmpty prepend=',' property='vqctaskid'>vqctaskid</isNotEmpty>
			<isNotEmpty prepend=',' property='videostatus'>videostatus</isNotEmpty>
			<isNotEmpty prepend=',' property='videofailurecause'>videofailurecause</isNotEmpty>
			<isNotEmpty prepend=',' property='vqdstate'>vqdstate</isNotEmpty>
			<isNotEmpty prepend=',' property='nosignalstatus'>nosignalstatus</isNotEmpty>
			<isNotEmpty prepend=',' property='imgclearstatus'>imgclearstatus</isNotEmpty>
			<isNotEmpty prepend=',' property='imgcontraststatus'>imgcontraststatus</isNotEmpty>
			<isNotEmpty prepend=',' property='imgcolorstatus'>imgcolorstatus</isNotEmpty>
			<isNotEmpty prepend=',' property='imglightstatus'>imglightstatus</isNotEmpty>
			<isNotEmpty prepend=',' property='videofreezestatus'>videofreezestatus</isNotEmpty>
			<isNotEmpty prepend=',' property='videojitterstatus'>videojitterstatus</isNotEmpty>
			<isNotEmpty prepend=',' property='videoupheavalstatus'>videoupheavalstatus</isNotEmpty>
			<isNotEmpty prepend=',' property='videocodeerrorstatus'>videocodeerrorstatus</isNotEmpty>
			<isNotEmpty prepend=',' property='videonoisestatus'>videonoisestatus</isNotEmpty>
			<isNotEmpty prepend=',' property='videorollstripestatus'>videorollstripestatus</isNotEmpty>
			<isNotEmpty prepend=',' property='vqdfailuretype'>vqdfailuretype</isNotEmpty>
			<isNotEmpty prepend=',' property='vqdfailurecause'>vqdfailurecause</isNotEmpty>
			<isNotEmpty prepend=',' property='vqdtaskid'>vqdtaskid</isNotEmpty>
			<isNotEmpty prepend=',' property='recordstate'>recordstate</isNotEmpty>
			<isNotEmpty prepend=',' property='recordfailuretype'>recordfailuretype</isNotEmpty>
			<isNotEmpty prepend=',' property='recordfailurecause'>recordfailurecause</isNotEmpty>
			<isNotEmpty prepend=',' property='recordtaskid'>recordtaskid</isNotEmpty>
			<isNotEmpty prepend=',' property='videolabelstatus'>videolabelstatus</isNotEmpty>
			<isNotEmpty prepend=',' property='videolabeltime'>videolabeltime</isNotEmpty>
			<isNotEmpty prepend=',' property='videolabelaccount'>videolabelaccount</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='currentstateid'>#currentstateid#</isNotEmpty>
<isNotEmpty prepend=',' property='currentstate'>#currentstate#</isNotEmpty>
			<isNotEmpty prepend=',' property='videonum'>#videonum#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelnum'>#channelnum#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelname'>#channelname#</isNotEmpty>
			<isNotEmpty prepend=',' property='videocatalog'>#videocatalog#</isNotEmpty>
			<isNotEmpty prepend=',' property='currentstatetime'>#currentstatetime#</isNotEmpty>
			<isNotEmpty prepend=',' property='isonline'>#isonline#</isNotEmpty>
			<isNotEmpty prepend=',' property='playfail'>#playfail#</isNotEmpty>
			<isNotEmpty prepend=',' property='networkerror'>#networkerror#</isNotEmpty>
			<isNotEmpty prepend=',' property='vqcstate'>#vqcstate#</isNotEmpty>
			<isNotEmpty prepend=',' property='vqcfailuretype'>#vqcfailuretype#</isNotEmpty>
			<isNotEmpty prepend=',' property='vqcfailurecause'>#vqcfailurecause#</isNotEmpty>
			<isNotEmpty prepend=',' property='vqctaskid'>#vqctaskid#</isNotEmpty>
			<isNotEmpty prepend=',' property='videostatus'>#videostatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='videofailurecause'>#videofailurecause#</isNotEmpty>
			<isNotEmpty prepend=',' property='vqdstate'>#vqdstate#</isNotEmpty>
			<isNotEmpty prepend=',' property='nosignalstatus'>#nosignalstatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='imgclearstatus'>#imgclearstatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='imgcontraststatus'>#imgcontraststatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='imgcolorstatus'>#imgcolorstatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='imglightstatus'>#imglightstatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='videofreezestatus'>#videofreezestatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='videojitterstatus'>#videojitterstatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='videoupheavalstatus'>#videoupheavalstatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='videocodeerrorstatus'>#videocodeerrorstatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='videonoisestatus'>#videonoisestatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='videorollstripestatus'>#videorollstripestatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='vqdfailuretype'>#vqdfailuretype#</isNotEmpty>
			<isNotEmpty prepend=',' property='vqdfailurecause'>#vqdfailurecause#</isNotEmpty>
			<isNotEmpty prepend=',' property='vqdtaskid'>#vqdtaskid#</isNotEmpty>
			<isNotEmpty prepend=',' property='recordstate'>#recordstate#</isNotEmpty>
			<isNotEmpty prepend=',' property='recordfailuretype'>#recordfailuretype#</isNotEmpty>
			<isNotEmpty prepend=',' property='recordfailurecause'>#recordfailurecause#</isNotEmpty>
			<isNotEmpty prepend=',' property='recordtaskid'>#recordtaskid#</isNotEmpty>
			<isNotEmpty prepend=',' property='videolabelstatus'>#videolabelstatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='videolabeltime'>#videolabeltime#</isNotEmpty>
			<isNotEmpty prepend=',' property='videolabelaccount'>#videolabelaccount#</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_Ywvideocurrentstate" parameterClass="java.util.Map">
		update ywvideocurrentstate 
		<dynamic prepend="set ">   
			

			<isNotEmpty prepend=',' property='videonum'>videonum=#videonum#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelnum'>channelnum=#channelnum#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelname'>channelname=#channelname#</isNotEmpty>
			<isNotEmpty prepend=',' property='videocatalog'>videocatalog=#videocatalog#</isNotEmpty>
			<isNotEmpty prepend=',' property='currentstatetime'>currentstatetime=#currentstatetime#</isNotEmpty>
			<isNotEmpty prepend=',' property='isonline'>isonline=#isonline#</isNotEmpty>
			<isNotEmpty prepend=',' property='playfail'>playfail=#playfail#</isNotEmpty>
			<isNotEmpty prepend=',' property='networkerror'>networkerror=#networkerror#</isNotEmpty>
			<isNotEmpty prepend=',' property='vqcstate'>vqcstate=#vqcstate#</isNotEmpty>
			<isNotEmpty prepend=',' property='vqcfailuretype'>vqcfailuretype=#vqcfailuretype#</isNotEmpty>
			<isNotEmpty prepend=',' property='vqcfailurecause'>vqcfailurecause=#vqcfailurecause#</isNotEmpty>
			<isNotEmpty prepend=',' property='vqctaskid'>vqctaskid=#vqctaskid#</isNotEmpty>
			<isNotEmpty prepend=',' property='videostatus'>videostatus=#videostatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='videofailurecause'>videofailurecause=#videofailurecause#</isNotEmpty>
			<isNotEmpty prepend=',' property='vqdstate'>vqdstate=#vqdstate#</isNotEmpty>
			<isNotEmpty prepend=',' property='nosignalstatus'>nosignalstatus=#nosignalstatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='imgclearstatus'>imgclearstatus=#imgclearstatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='imgcontraststatus'>imgcontraststatus=#imgcontraststatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='imgcolorstatus'>imgcolorstatus=#imgcolorstatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='videofreezestatus'>videofreezestatus=#videofreezestatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='videojitterstatus'>videojitterstatus=#videojitterstatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='videoupheavalstatus'>videoupheavalstatus=#videoupheavalstatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='videocodeerrorstatus'>videocodeerrorstatus=#videocodeerrorstatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='videonoisestatus'>videonoisestatus=#videonoisestatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='videorollstripestatus'>videorollstripestatus=#videorollstripestatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='vqdfailuretype'>vqdfailuretype=#vqdfailuretype#</isNotEmpty>
			<isNotEmpty prepend=',' property='vqdfailurecause'>vqdfailurecause=#vqdfailurecause#</isNotEmpty>
			<isNotEmpty prepend=',' property='vqdtaskid'>vqdtaskid=#vqdtaskid#</isNotEmpty>
			<isNotEmpty prepend=',' property='recordstate'>recordstate=#recordstate#</isNotEmpty>
			<isNotEmpty prepend=',' property='recordfailuretype'>recordfailuretype=#recordfailuretype#</isNotEmpty>
			<isNotEmpty prepend=',' property='recordfailurecause'>recordfailurecause=#recordfailurecause#</isNotEmpty>
			<isNotEmpty prepend=',' property='recordtaskid'>recordtaskid=#recordtaskid#</isNotEmpty>
			<isNotEmpty prepend=',' property='videolabelstatus'>videolabelstatus=#videolabelstatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='videolabeltime'>videolabeltime=#videolabeltime#</isNotEmpty>
			<isNotEmpty prepend=',' property='videolabelaccount'>videolabelaccount=#videolabelaccount#</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='repairstate'>repairstate=#repairstate#</isNotEmpty>
		</dynamic>
		where 1=1 
			<isNotEmpty prepend='AND' property='XGTJcurrentstateid'> currentstateid = #XGTJcurrentstateid#</isNotEmpty>
<isNotEmpty prepend='AND' property='XGTJcurrentstate'> currentstate = #XGTJcurrentstate#</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='XGTJvideocatalog'> videocatalog = #XGTJvideocatalog# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJcurrentstatetime'> currentstatetime = #XGTJcurrentstatetime# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJisonline'> isonline = #XGTJisonline# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJplayfail'> playfail = #XGTJplayfail# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJnetworkerror'> networkerror = #XGTJnetworkerror# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvqcstate'> vqcstate = #XGTJvqcstate# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvqcfailuretype'> vqcfailuretype = #XGTJvqcfailuretype# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvqcfailurecause'> vqcfailurecause = #XGTJvqcfailurecause# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvqctaskid'> vqctaskid = #XGTJvqctaskid# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvideostatus'> videostatus = #XGTJvideostatus# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvideofailurecause'> videofailurecause = #XGTJvideofailurecause# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvqdstate'> vqdstate = #XGTJvqdstate# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJnosignalstatus'> nosignalstatus = #XGTJnosignalstatus# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJimgclearstatus'> imgclearstatus = #XGTJimgclearstatus# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJimgcontraststatus'> imgcontraststatus = #XGTJimgcontraststatus# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJimgcolorstatus'> imgcolorstatus = #XGTJimgcolorstatus# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvideofreezestatus'> videofreezestatus = #XGTJvideofreezestatus# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvideojitterstatus'> videojitterstatus = #XGTJvideojitterstatus# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvideoupheavalstatus'> videoupheavalstatus = #XGTJvideoupheavalstatus# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvideocodeerrorstatus'> videocodeerrorstatus = #XGTJvideocodeerrorstatus# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvideonoisestatus'> videonoisestatus = #XGTJvideonoisestatus# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvideorollstripestatus'> videorollstripestatus = #XGTJvideorollstripestatus# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvqdfailuretype'> vqdfailuretype = #XGTJvqdfailuretype# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvqdfailurecause'> vqdfailurecause = #XGTJvqdfailurecause# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvqdtaskid'> vqdtaskid = #XGTJvqdtaskid# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJrecordstate'> recordstate = #XGTJrecordstate# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJrecordfailuretype'> recordfailuretype = #XGTJrecordfailuretype# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJrecordfailurecause'> recordfailurecause = #XGTJrecordfailurecause# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJrecordtaskid'> recordtaskid = #XGTJrecordtaskid# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvideolabelstatus'> videolabelstatus = #XGTJvideolabelstatus# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvideolabeltime'> videolabeltime = #XGTJvideolabeltime# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvideolabelaccount'> videolabelaccount = #XGTJvideolabelaccount# </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_Ywvideocurrentstate" parameterClass="java.util.Map">
		delete from ywvideocurrentstate 
		<include refid="condition_Ywvideocurrentstate"/>
	</delete>
	
	<!-- batch delete object -->
	<delete id="batch_delete_Ywvideocurrentstate" parameterClass="java.util.Map">
		delete from ywvideocurrentstate 
		where 1=1
			<isNotEmpty prepend='AND' property='keyword'>
			key  in (#keyword#)
			</isNotEmpty>
	</delete>
	
	<!-- query objects by page-->
	<select id="query_Ywvideocurrentstate" resultClass="java.util.HashMap" parameterClass="java.util.Map" remapResults="true">
		select 
			a.*,
			f.videonum as videonum2,f.channelnum as channelnum2,f.channelname as channelname2,
			e.sbip,e.cjmc,f.admincatalogue as xzbh,
			(select XZMC from ptxzs where xzbh=a.videocatalog) as xzmc
			from ywvideocurrentstate a
			RIGHT JOIN ywvideosyncchannel f on (a.videonum = f.videonum and a.channelnum = f.channelnum)
			left join sbxx e on (a.videonum=e.sbbh)
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum )
		</isNotEmpty>
		where 1=1 
		<isNotEmpty prepend='AND' property='currentstateid'>
			(a.currentstateid = #currentstateid# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='isonline'>
			(a.isonline = #isonline# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='vqdstate'>
			(a.vqdstate = #vqdstate# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='recordstate'>
			(a.recordstate = #recordstate# )
		</isNotEmpty>
		<isNotEmpty prepend='and' property='xzbh'>
			(f.admincatalogue = #xzbh#  or (f.admincatalogue in (select xzbh from ptxzs where sjxzbh = #xzbh#)) )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='videonum'>
			(a.videonum = #videonum# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='channelnum'>
			(a.channelnum = #channelnum# )
		</isNotEmpty>
		<isNotEmpty prepend='and' property='bmbh'>
			 b.bmbh = #bmbh#
		</isNotEmpty>	
		<isNotEmpty prepend='AND' property='LIKEchannelname'>
			(a.channelname like '%$LIKEchannelname$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='currentstate'>
			(a.currentstate = #currentstate#  )
		</isNotEmpty>
		<isNotEmpty property='tableparam'>
			$tableparam$
		</isNotEmpty>
		<isNotEmpty prepend=' ' property='order'>
			 $order$
		</isNotEmpty>	
	</select>
	<!-- 详细展示 -->
	<select id="query_Ywvideocurrentstate_detail" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
			a.videonum,a.channelnum,a.channelname,a.videocatalog,e.videoip
		from ywvideocurrentstate a
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum )
		</isNotEmpty>
		LEFT JOIN sbtdspsr d on (d.sbbh=a.videonum and d.tdbh=a.channelnum )
		LEFT JOIN ywarchivevideoinfo e on (e.videonum=a.videonum and e.channelnum=a.channelnum )
		where 1=1 
		<isNotEmpty prepend='and' property='bmbh'>
			 b.bmbh = #bmbh#
		</isNotEmpty>
		<isNotEmpty prepend='and' property='videocatalog'>
			(d.xzbh = #videocatalog#  <!-- or (d.xzbh in (select xzbh from ptxzs where sjxzbh = #videocatalog#))  -->)
		</isNotEmpty>
		<isNotEmpty property='tableparam'>
			$tableparam$
		</isNotEmpty>
		<isNotEmpty prepend=' ' property='order'>
			 $order$
		</isNotEmpty>	
		<!-- <isNotEmpty prepend=' ' property='start'>
			limit $start$ ,$limit$
		</isNotEmpty> -->	
	</select>
	<select id="count_Ywvideocurrentstate_detail" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(a.currentstateid) 
		from ywvideocurrentstate a
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum )
		</isNotEmpty>
		LEFT JOIN sbtdspsr d on (d.sbbh=a.videonum and d.tdbh=a.channelnum )
		LEFT JOIN ywarchivevideoinfo e on (e.videonum=a.videonum and e.channelnum=a.channelnum )
		where 1=1 
		<isNotEmpty prepend='and' property='bmbh'>
			 b.bmbh = #bmbh#
		</isNotEmpty>	
		<isNotEmpty prepend='and' property='videocatalog'>
				(d.xzbh = #videocatalog#  <!-- or (d.xzbh in (select xzbh from ptxzs where sjxzbh = #videocatalog#)) --> )
		</isNotEmpty>
		<isNotEmpty property='tableparam'>
			$tableparam$
		</isNotEmpty>	
	</select>
	
	<!-- query objects totalcount -->
	<select id="count_Ywvideocurrentstate" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(a.currentstateid) 
		from ywvideocurrentstate a
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum )
		</isNotEmpty>
		LEFT JOIN sbtdspsr d on (d.sbbh=a.videonum and d.tdbh=a.channelnum )
		where 1=1 
		<isNotEmpty prepend='AND' property='currentstateid'>
			(a.currentstateid = #currentstateid# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='isonline'>
			(isonline = #isonline# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='vqdstate'>
			(vqdstate = #vqdstate# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='recordstate'>
			(recordstate = #recordstate# )
		</isNotEmpty>
		<isNotEmpty prepend='and' property='xzbh'>
				(d.xzbh = #xzbh#  or (d.xzbh in (select xzbh from ptxzs where sjxzbh = #xzbh#)) )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='videonum'>
			(a.videonum = #videonum# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='channelnum'>
			(a.channelnum = #channelnum# )
		</isNotEmpty>
		<isNotEmpty prepend='and' property='bmbh'>
			 b.bmbh = #bmbh#
		</isNotEmpty>	
		<isNotEmpty prepend='AND' property='LIKEchannelname'>
			(a.channelname like '%$LIKEchannelname$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='currentstate'>
			(a.currentstate = #currentstate#  )
		</isNotEmpty>	
		<isNotEmpty property='tableparam'>
			$tableparam$
		</isNotEmpty>	
	</select>
	
	<!-- batch add objects -->
	<insert id="batch_insert_Ywvideocurrentstate" parameterClass="java.util.List">
	 	<![CDATA[
          INSERT
      	]]>
      	<iterate conjunction=" " > 
			into ywvideocurrentstate(
			 <![CDATA[ 
				currentstateid,videonum,channelnum,channelname,videocatalog,currentstate,currentstatetime,isonline,playfail,networkerror,vqcstate,vqcfailuretype,vqcfailurecause,vqctaskid,videostatus,videofailurecause,vqdstate,nosignalstatus,imgclearstatus,imgcontraststatus,imgcolorstatus,imglightstatus,videofreezestatus,videojitterstatus,videoupheavalstatus,videocodeerrorstatus,videonoisestatus,videorollstripestatus,vqdfailuretype,vqdfailurecause,vqdtaskid,recordstate,recordfailuretype,recordfailurecause,recordtaskid,videolabelstatus,videolabeltime,videolabelaccount,createaccount,createtime,modifyaccount,modifytime,remarks,extend1,extend2,extend3,extend4
			)values
			 ]]>  		 
			 <![CDATA[ 
				(
				#list[].currentstateid#,#list[].videonum#,#list[].channelnum#,#list[].channelname#,#list[].videocatalog#,	#list[].currentstate#,#list[].currentstatetime#,#list[].isonline#,#list[].playfail#,#list[].networkerror#,#list[].vqcstate#,#list[].vqcfailuretype#,#list[].vqcfailurecause#,#list[].vqctaskid#,#list[].videostatus#,#list[].videofailurecause#,#list[].vqdstate#,#list[].nosignalstatus#,#list[].imgclearstatus#,#list[].imgcontraststatus#,#list[].imgcolorstatus#,#list[].imglightstatus#,#list[].videofreezestatus#,#list[].videojitterstatus#,#list[].videoupheavalstatus#,#list[].videocodeerrorstatus#,#list[].videonoisestatus#,#list[].videorollstripestatus#,#list[].vqdfailuretype#,#list[].vqdfailurecause#,#list[].vqdtaskid#,#list[].recordstate#,#list[].recordfailuretype#,#list[].recordfailurecause#,#list[].recordtaskid#,#list[].videolabelstatus#,#list[].videolabeltime#,#list[].videolabelaccount#,#list[].createaccount#,#list[].createtime#,#list[].modifyaccount#,#list[].modifytime#,#list[].remarks#,#list[].extend1#,#list[].extend2#,#list[].extend3#,#list[].extend4#
				)
			]]>    
    	</iterate> 
	</insert>

	<select id="statisticsVideoOnlineRate_mysql" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select count(*) as totalCount
		(select COUNT(isonline) from ywvideocurrentstate a 
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum ) 
		</isNotEmpty>
		where 1=1 
		<isNotEmpty prepend='and' property='bmbh'>
			b.bmbh=#bmbh#
		</isNotEmpty>
		and isonline = '1'
		) as onlineNum, 
		(select COUNT(*) from ywvideocurrentstate a 
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum ) 
		</isNotEmpty>
		where 1=1 
		<isNotEmpty prepend='and' property='bmbh'>
			b.bmbh=#bmbh#
		</isNotEmpty>
		<![CDATA[ 
		and (isonline <> '1' or isonline is null)) as unonlineNum,
		]]>
		(select COUNT(vqdstate) from ywvideocurrentstate a 
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum ) 
		</isNotEmpty>
		where 1=1 
		<isNotEmpty prepend='and' property='bmbh'>
			b.bmbh=#bmbh#
		</isNotEmpty>
		and vqdstate = '1') as intactNum,
		
		(select COUNT(*) from ywvideocurrentstate a 
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum ) 
		</isNotEmpty>
		where 1=1 
		<isNotEmpty prepend='and' property='bmbh'>
			b.bmbh=#bmbh#
		</isNotEmpty>
		<![CDATA[ 
		and (vqdstate <> '1' or vqdstate is null)) as unIntactNum,
		]]>
		(select COUNT(recordstate) from ywvideocurrentstate a 
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum ) 
		</isNotEmpty>
		where 1=1
		<isNotEmpty prepend='and' property='bmbh'>
			b.bmbh=#bmbh#
		</isNotEmpty>
		and recordstate = '1') as recordIntactNum,
		
		(select COUNT(*) from ywvideocurrentstate a 
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum ) 
		</isNotEmpty>
		where 1=1
		<isNotEmpty prepend='and' property='bmbh'>
			b.bmbh=#bmbh#
		</isNotEmpty>
		<![CDATA[ 
		and (recordstate <> '1' or recordstate is null)) as unrecordIntactNum
		]]>
		from ywvideocurrentstate
	</select>
	<select id="statisticsVideoOnlineRate" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
			count(*) as totalcount,
			SUM((case when a.isonline=1 then 1 else 0 end)) as onlinenum,
			SUM((case when a.isonline=0  or a.isonline is null then 1 else 0 end)) as unonlinenum,
			SUM((case when a.vqdstate=1 then 1 else 0 end)) as intactnum,
			SUM((case when a.vqdstate=0 or a.vqdstate is null then 1 else 0 end)) as unIntactnum,
			SUM((case when a.recordstate=1 then 1 else 0 end)) as recordIntactnum,
			SUM((case when a.recordstate=0 or a.recordstate is null then 1 else 0 end)) as unrecordIntactnum
		from ywvideocurrentstate a
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum )
		</isNotEmpty>
		RIGHT JOIN ywvideosyncchannel d on (d.videonum=a.videonum and d.channelnum=a.channelnum )   
		WHERE 1=1  
		<isNotEmpty prepend='and' property='bmbh'>
			b.bmbh = #bmbh#
		</isNotEmpty>
	</select>

	<select id="statisticsVideoIntactRate" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select count(*) as intactNum,
				(select count(*) as total from ywvideocurrentstate where  vqdstate=0 and currentstate!= 1) as unintactNum
		from ywvideocurrentstate  where currentstate =1 and  vqdstate=1
	</select>
	<select id="statisticsRecordIntactRate" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select count(*) as intactNum,
				(select count(*) as total from ywvideocurrentstate where  recordstate=0 and currentstate!= 1) as unintactNum
		from ywvideocurrentstate  where currentstate =1 and  recordstate=1
	</select>
	
	<select id="videoCurrentStateStatistics" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 'total' as name, count(*) as total from ywvideocurrentstate a
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum )
			where 1=1
		</isNotEmpty>
		<isNotEmpty prepend='and' property='bmbh'>
			 b.bmbh = #bmbh#
		</isNotEmpty>
		UNION ALL
		select 'normalNum' as name, count(*) as total from ywvideocurrentstate a
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum )
		</isNotEmpty>
		where 
		isonline=1 and vqcstate=1 and vqdstate=1 and recordstate=1
		<isNotEmpty prepend='and' property='bmbh'>
			 b.bmbh = #bmbh#
		</isNotEmpty>
		UNION ALL
		select 'abnormalVQCNum' as name, count(*) as total from ywvideocurrentstate a
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum )
		</isNotEmpty>
		 where  vqcstate=0
		<isNotEmpty prepend='and' property='bmbh'>
			 b.bmbh = #bmbh#
		</isNotEmpty>
		UNION ALL
		select 'abnormalVQDNum' as name, count(*) as total from ywvideocurrentstate a
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum )
		</isNotEmpty>
		where vqdstate=0
		<isNotEmpty prepend='and' property='bmbh'>
			 b.bmbh = #bmbh#
		</isNotEmpty>
		UNION ALL
		select 'abnormalRecordNum' as name, count(*) as total from ywvideocurrentstate a
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum )
		</isNotEmpty>
		 where  recordstate=0
		<isNotEmpty prepend='and' property='bmbh'>
			 b.bmbh = #bmbh#
		</isNotEmpty>
		UNION ALL
		select 'abnormalOnlineNum' as name, count(*) as total from ywvideocurrentstate a
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum )
		</isNotEmpty>
		 where  isonline=0
		<isNotEmpty prepend='and' property='bmbh'>
			 b.bmbh = #bmbh#
		</isNotEmpty> 
		UNION ALL
		select 'abnormalNetNum' as name, count(*) as total from ywvideocurrentstate a
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum )
		</isNotEmpty>
		 where networkerror=0
		<isNotEmpty prepend='and' property='bmbh'>
			 b.bmbh = #bmbh#
		</isNotEmpty>
	</select>
	<select id="vdqStatisticsRegion" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
			a.videocatalog,
			(select XZMC from ptxzs where xzbh=a.videocatalog) as videocatalogname,
			count(*) as jknum,
			(select count(1) from ywvideosyncchannel  e
				<isNotEmpty prepend=' ' property='bmbh'>
				 	LEFT JOIN sbtdjqqx m on (m.sbbh=e.videonum and m.tdbh=e.channelnum )
				</isNotEmpty>
				where (e.admincatalogue = a.videocatalog)
				<isNotEmpty prepend='and' property='bmbh'>
					 m.bmbh = #bmbh#
				</isNotEmpty>
			) as totalnum,
			SUM((case when a.isonline=0 then 1 else 0 end)) as lxnum,
			SUM((case when a.isonline=1 then 1 else 0 end)) as zxnum,
			SUM((case when a.vqdstate=0 then 1 else 0 end)) as videoabnormalnum,
			SUM((case when a.vqdstate=1 then 1 else 0 end)) as videonormalnum,
			SUM((case when a.nosignalstatus in (2,3,4) then 1 else 0 end)) as nosignalstatusnum,
			SUM((case when a.videoocclusionstatus=0 then 1 else 0 end)) as videoocclusionstatusnum,
			SUM((case when a.scenechangestatus=0 then 1 else 0 end)) as scenechangestatusnum,
			SUM((case when a.imgtoodarkstatus=0 then 1 else 0 end)) as imgtoodarkstatusnum,
			SUM((case when a.imgoverbrightstatus=0 then 1 else 0 end)) as imgoverbrightstatusnum,
			SUM((case when a.imgclearstatus=0 then 1 else 0 end)) as imgclearstatusnum,
			SUM((case when a.imgcolorstatus=0 then 1 else 0 end)) as imgcolorstatusnum
			FROM ywvideocurrentstate a
			<isNotEmpty prepend=' ' property='bmbh'>
			 	LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum )
			</isNotEmpty>
			LEFT JOIN ywvideosyncchannel d on (d.videonum=a.videonum and d.channelnum=a.channelnum )
			WHERE 1=1
			<isNotEmpty prepend='and' property='bmbh'>
				 b.bmbh = #bmbh#
			</isNotEmpty>
			<isNotEmpty prepend='and' property='videocatalog'>
				(d.admincatalogue = #videocatalog#  or (d.admincatalogue in (select xzbh from ptxzs where sjxzbh = #videocatalog#)) )
			</isNotEmpty>
			<isNotEmpty property='tableparam'>
				$tableparam$
			</isNotEmpty>
			GROUP BY a.videocatalog
			<isNotEmpty property='order'>
				$order$
			</isNotEmpty>
	</select>
	<select id="count_vdqStatisticsRegion" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from (
		select 
			a.videocatalog
			FROM ywvideocurrentstate a
			<isNotEmpty prepend=' ' property='bmbh'>
			 	LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum )
			</isNotEmpty>
			<isNotEmpty prepend=' ' property='videocatalog'>
			 	LEFT JOIN sbtdspsr d on (d.sbbh=a.videonum and d.tdbh=a.channelnum )
			</isNotEmpty>
			
			WHERE 1=1
			<isNotEmpty prepend='and' property='bmbh'>
				 b.bmbh = #bmbh#
			</isNotEmpty>
			<isNotEmpty prepend='and' property='videocatalog'>
					(d.xzbh = #videocatalog#  or (d.xzbh in (select xzbh from ptxzs where sjxzbh = #videocatalog#)) )
			</isNotEmpty>
			<isNotEmpty property='tableparam'>
				$tableparam$
			</isNotEmpty>
			
			GROUP BY a.videocatalog) m
	</select>
	<!-- 区域在线率统计  ============================  / start -->
	<select id="query_areaOnline" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select f.*,f.mcount-(onlinecount+notonlinecount) as wxj from (
			select a.videocatalog, 
			(select count(*) from ywvideosyncchannel e             
		        <isNotEmpty prepend=' ' property='bmbh'>
				 	LEFT JOIN sbtdjqqx m on (m.sbbh=e.videonum and m.tdbh=e.channelnum )
				</isNotEmpty>	
		         where e.admincatalogue = a.videocatalog 
		        <isNotEmpty prepend='and' property='bmbh'>
					 m.bmbh = #bmbh#
				</isNotEmpty>
		          ) as mcount, 
			(select XZMC from ptxzs where xzbh=a.videocatalog) as xzmc, 
			SUM((case when a.isonline=0 then 1 else 0 end)) as notonlinecount,
			SUM((case when a.isonline=1 then 1 else 0 end)) as onlinecount
			from 
			ywvideocurrentstate a
			<isNotEmpty prepend=' ' property='bmbh'>
			 	LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum )
			</isNotEmpty>
			LEFT JOIN ywvideosyncchannel d on (d.videonum=a.videonum and d.channelnum=a.channelnum )    
			WHERE 1=1 
			<isNotEmpty prepend='and' property='bmbh'>
				b.bmbh = #bmbh#
			</isNotEmpty>
			<isNotEmpty prepend='and' property='xzqh'>
				(d.admincatalogue = #xzqh#  or (d.admincatalogue in (select xzbh from ptxzs where sjxzbh = #xzqh#)) )
			</isNotEmpty>
			GROUP BY a.videocatalog      
		) f  order by videocatalog asc 
	</select>
	
	<select id="count_areaOnline" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from (
			select a.videocatalog 
			from 
			ywvideocurrentstate a
			<isNotEmpty prepend=' ' property='bmbh'>
			 	LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum )
			</isNotEmpty>        
			LEFT JOIN ywvideosyncchannel d on (d.videonum=a.videonum and d.channelnum=a.channelnum )    
			WHERE 1=1  
			<isNotEmpty prepend='and' property='bmbh'>
				b.bmbh = #bmbh#
			</isNotEmpty>
			<isNotEmpty prepend='and' property='xzqh'>
				(d.admincatalogue = #xzqh#  or (d.admincatalogue in (select xzbh from ptxzs where sjxzbh = #xzqh#)) )
			</isNotEmpty>
			GROUP BY a.videocatalog  
		) m
	</select>
	
	<!-- 监控点不在线信息 -->
	<select id="query_AreaNotonlineDetail" resultClass="java.util.HashMap" parameterClass="java.util.Map">
	   select a.channelname as tdmc, a.admincatalogue as xzbh, a.videonum as sbbh, a.channelnum as tdbh,b.currentstateid,b.isonline,
	      (select XZMC from ptxzs where xzbh=a.admincatalogue) as xzmc,
	      (select sbip from sbxx where sbbh=a.videonum) as sbip    
	       from ywvideosyncchannel a 
	      left join ywvideocurrentstate b on a.videonum=b.videonum and a.channelnum=b.channelnum 
	      LEFT JOIN sbtdjqqx e on (e.sbbh=a.videonum and e.tdbh=a.channelnum )  
		  where 1=1
	      <isNotEmpty prepend='AND' property='xzbh'>
				a.admincatalogue = #xzbh#
		  </isNotEmpty>
	      <isNotEmpty property='tableparam'>
				$tableparam$
		  </isNotEmpty>
		  <isNotEmpty prepend='and' property='bmbh'>
				e.bmbh = #bmbh#
		  </isNotEmpty>
	</select>
	
	<select id="count_AreaNotonlineDetail" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from (
			select a.channelname as tdmc, a.admincatalogue as xzbh, a.videonum as sbbh, a.channelnum as tdbh,b.currentstateid,b.isonline
			       from ywvideosyncchannel a 
			      left join ywvideocurrentstate b on a.videonum=b.videonum and a.channelnum=b.channelnum 
			      LEFT JOIN sbtdjqqx e on (e.sbbh=a.videonum and e.tdbh=a.channelnum )  
				  where 1=1
			      <isNotEmpty prepend='AND' property='xzbh'>
						a.admincatalogue = #xzbh#
				  </isNotEmpty>
			      <isNotEmpty property='tableparam'>
						$tableparam$
				  </isNotEmpty>
				  <isNotEmpty prepend='and' property='bmbh'>
						e.bmbh = #bmbh#
				  </isNotEmpty>
		) y
	</select>
	<!-- 区域在线率统计     ============================  / end-->
	
	<!-- 首页统计                监控故障类型 -->
	<select id="count_HomepageFalultType" resultClass="java.util.HashMap" parameterClass="java.util.Map">	
		select 
			count(*) as zs,
			SUM((case when a.isonline=0 or a.isonline is null then 1 else 0 end)) as sbbzx,
			SUM((case when a.networkerror=0 or a.networkerror is null then 1 else 0 end)) as wlyc,
			SUM((case when a.vqcstate=0 or a.vqcstate is null then 1 else 0 end)) as czyc,
			SUM((case when a.vqdstate=0 or a.vqdstate is null then 1 else 0 end)) as zlzdyc,
			SUM((case when a.recordstate=0 or a.recordstate is null then 1 else 0 end)) as lxyc
		from ywvideocurrentstate a
		RIGHT JOIN ywvideosyncchannel d on (d.videonum=a.videonum and d.channelnum=a.channelnum )
	</select>
	<!-- <select id="count_HomepageFalultType" resultClass="java.util.HashMap" parameterClass="java.util.Map">		
		select count(*) as zs, 'zs' as name from  ywvideocurrentstate
		union all   
		select count(*) as zs, 'sbbzx' as name from ywvideocurrentstate where isonline=0
		union all   
		select count(*) as zs, 'wlyc' as name from ywvideocurrentstate where networkerror=0
		union all   
		select count(*) as zs, 'czyc' as name from ywvideocurrentstate where vqcstate=0
		union all   
		select count(*) as zs, 'zlzdyc' as name from ywvideocurrentstate where vqdstate=0
		union all   
		select count(*) as zs, 'lxyc' as name from ywvideocurrentstate where recordstate=0
	</select> -->
	<!-- <select id="count_HomepageFalultType" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select count(*) as zs,
		(select count(*) from ywvideocurrentstate where isonline=0) as sbbzx,
		(select count(*) from ywvideocurrentstate where networkerror=0) as wlyc,
		(select count(*) from ywvideocurrentstate where vqcstate=0) as czyc,
		(select count(*) from ywvideocurrentstate where vqdstate=0) as zlzdyc,
		(select count(*) from ywvideocurrentstate where recordstate=0) as lxyc
		from ywvideocurrentstate 
	</select> -->
	
	
	<!-- 首页查询    运维数据看板中间下面 -->
	<select id="query_videoState" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select a.*, b.sbip, c.xzmc 
		from ywvideocurrentstate a 
		left join sbxx b on a.videonum = b.sbbh 
		left join ptxzs c on a.videocatalog = c.xzbh 
		RIGHT JOIN ywvideosyncchannel d on (d.videonum=a.videonum and d.channelnum=a.channelnum )
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx e on (e.sbbh=a.videonum and e.tdbh=a.channelnum )
		</isNotEmpty>
		where 1=1
		<isNotEmpty prepend='and' property='bmbh'>
			e.bmbh = #bmbh#
		</isNotEmpty>
		<isNotEmpty prepend='and' property='xzqh'>
			a.videocatalog = #xzqh#
		</isNotEmpty>
		<isNotEmpty prepend='and' property='normal'>
			a.isonline=1 and a.networkerror=1 and a.vqcstate=1 and a.vqdstate=1 and a.recordstate=1
		</isNotEmpty>
		<isNotEmpty prepend='and' property='abnormal'>
			(a.isonline=0 or a.networkerror=1 or a.vqcstate=0 or a.vqdstate=0 or a.recordstate=0)
		</isNotEmpty>
		<isNotEmpty prepend='and' property='sbmc'>
			a.channelname like '%$sbmc$%'
		</isNotEmpty>
		<!-- <isNotEmpty prepend=' ' property='start'>
			limit $start$ ,$limit$
		</isNotEmpty> -->
	</select>
	<select id="count_videoState" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) 
		from (
			select a.*, b.sbip, c.xzmc 
			from ywvideocurrentstate a 
			left join sbxx b on a.videonum = b.sbbh 
			left join ptxzs c on a.videocatalog = c.xzbh 
			RIGHT JOIN ywvideosyncchannel d on (d.videonum=a.videonum and d.channelnum=a.channelnum )
			<isNotEmpty prepend=' ' property='bmbh'>
				LEFT JOIN sbtdjqqx e on (e.sbbh=a.videonum and e.tdbh=a.channelnum )
			</isNotEmpty>
			where 1=1
			<isNotEmpty prepend='and' property='bmbh'>
				e.bmbh = #bmbh#
			</isNotEmpty>
			<isNotEmpty prepend='and' property='xzqh'>
				a.videocatalog = #xzqh#
			</isNotEmpty>
			<isNotEmpty prepend='and' property='normal'>
				a.isonline=1 and a.networkerror=1 and a.vqcstate=1 and a.vqdstate=1 and a.recordstate=1
			</isNotEmpty>
			<isNotEmpty prepend='and' property='abnormal'>
				(a.isonline=0 or a.networkerror=1 or a.vqcstate=0 or a.vqdstate=0 or a.recordstate=0)
			</isNotEmpty>
			<isNotEmpty prepend='and' property='sbmc'>
				a.channelname like '%$sbmc$%'
			</isNotEmpty>
		) e
	</select>
	
	
	<!-- 大屏设备行政树 -->
	<select id="getDpIntact" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
		count(*) as total,
		sum((case when a.isonline=1 and a.vqcstate = 1 and a.vqdstate = 1 and recordstate = 1 then 1 else 0 end)) as intactnum
		from ywvideocurrentstate a
		RIGHT JOIN ywvideosyncchannel d on (d.videonum=a.videonum and d.channelnum=a.channelnum )
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum )
		</isNotEmpty>
		where 1=1
		<isNotEmpty prepend='and' property='bmbh'>
			 b.bmbh = #bmbh#
		</isNotEmpty>
		<isNotEmpty prepend=' ' property='tableparam'>
				$tableparam$
		</isNotEmpty>
		<!-- where videocatalog in ('04e24338cd296596f34c8d5cd5c8ff5d') -->
	</select>
	
	<select id="getDpVideoByXzbh" resultClass="java.util.HashMap" parameterClass="java.util.Map" remapResults="true">
		select 
			a.videonum,a.channelnum,a.channelname,a.videocatalog,
			(case when isonline=1 then isonline else 0 end) as isonline,
			(case when vqcstate=1 then vqcstate else 0 end) as vqcstate,
			(case when vqdstate=1 then vqdstate else 0 end) as vqdstate,
			(case when recordstate=1 then recordstate else 0 end) as recordstate
		from ywvideocurrentstate a
		<isNotEmpty prepend=' ' property='bmbh'>
			LEFT JOIN sbtdjqqx b on (b.sbbh=a.videonum and b.tdbh=a.channelnum )
		</isNotEmpty>
		RIGHT JOIN ywvideosyncchannel d on (d.videonum=a.videonum and d.channelnum=a.channelnum )
		where 1=1 
		<isNotEmpty prepend='and' property='bmbh'>
			 b.bmbh = #bmbh#
		</isNotEmpty>
		<isNotEmpty property='tableparam'>
			$tableparam$
		</isNotEmpty>
		<!-- <isNotEmpty prepend=' ' property='start'>
			limit $start$ ,$limit$
		</isNotEmpty> -->	
	</select>
</sqlMap>











