<?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="Ywalarmeventinfobean" type="cn.vp.XXX.model.YwalarmeventinfoBean"/> -->	<typeAlias alias="Ywalarmeventinfo" type="cn.yw.ywalarmeventinfo.YwalarmeventinfoBean"/>
	
	<sql id="condition_Ywalarmeventinfo">
		where 1=1
		<isNotEmpty prepend='AND' property='LIKEalarmeventid'>
			(alarmeventid like '%$LIKEalarmeventid$%'   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmeventid'>
			(alarmeventid = #alarmeventid#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEalarmruleid'>
			(alarmruleid like '%$LIKEalarmruleid$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmruleid'>
			(alarmruleid = #alarmruleid# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEalarmrulename'>
			(alarmrulename like '%$LIKEalarmrulename$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmrulename'>
			(alarmrulename = #alarmrulename# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEalarmdevicetype'>
			(alarmdevicetype like '%$LIKEalarmdevicetype$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmdevicetype'>
			(alarmdevicetype = #alarmdevicetype# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEalarmdevicename'>
			(alarmdevicename like '%$LIKEalarmdevicename$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmdevicename'>
			(alarmdevicename = #alarmdevicename# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEalarmdeviceid'>
			(alarmdeviceid like '%$LIKEalarmdeviceid$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmdeviceid'>
			(alarmdeviceid = #alarmdeviceid# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEchannelnum'>
			(channelnum like '%$LIKEchannelnum$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='channelnum'>
			(channelnum = #channelnum# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEalarmtype'>
			(alarmtype like '%$LIKEalarmtype$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmtype'>
			(alarmtype = #alarmtype# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEalarmgrade'>
			(alarmgrade like '%$LIKEalarmgrade$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmgrade'>
			(alarmgrade = #alarmgrade# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEalarmsubtypecode'>
			(alarmsubtypecode like '%$LIKEalarmsubtypecode$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmsubtypecode'>
			(alarmsubtypecode = #alarmsubtypecode# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEalarmsubtypename'>
			(alarmsubtypename like '%$LIKEalarmsubtypename$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmsubtypename'>
			(alarmsubtypename = #alarmsubtypename# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEalarmreason'>
			(alarmreason like '%$LIKEalarmreason$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmreason'>
			(alarmreason = #alarmreason# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEalarmtime'>
			(alarmtime like '%$LIKEalarmtime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmtime'>
			(alarmtime = #alarmtime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEfalutdtype'>
			(falutdtype like '%$LIKEfalutdtype$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='falutdtype'>
			(falutdtype = #falutdtype# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEfalutdescription'>
			(falutdescription like '%$LIKEfalutdescription$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='falutdescription'>
			(falutdescription = #falutdescription# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEprocessstatus'>
			(processstatus like '%$LIKEprocessstatus$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='processstatus'>
			(processstatus = #processstatus# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEprocesstime'>
			(processtime like '%$LIKEprocesstime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='processtime'>
			(processtime = #processtime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEprocessaccount'>
			(processaccount like '%$LIKEprocessaccount$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='processaccount'>
			(processaccount = #processaccount# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEprocessdescription'>
			(processdescription like '%$LIKEprocessdescription$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='processdescription'>
			(processdescription = #processdescription# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEunalarmtime'>
			(unalarmtime like '%$LIKEunalarmtime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='unalarmtime'>
			(unalarmtime = #unalarmtime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcompletetime'>
			(completetime like '%$LIKEcompletetime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='completetime'>
			(completetime = #completetime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcompleteaccount'>
			(completeaccount like '%$LIKEcompleteaccount$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='completeaccount'>
			(completeaccount = #completeaccount# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEpictureurl'>
			(pictureurl like '%$LIKEpictureurl$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='pictureurl'>
			(pictureurl = #pictureurl# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvideourl'>
			(videourl like '%$LIKEvideourl$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='videourl'>
			(videourl = #videourl# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKErelatetaskbatchnum'>
			(relatetaskbatchnum like '%$LIKErelatetaskbatchnum$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='relatetaskbatchnum'>
			(relatetaskbatchnum = #relatetaskbatchnum# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKErelatetasknum'>
			(relatetasknum like '%$LIKErelatetasknum$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='relatetasknum'>
			(relatetasknum = #relatetasknum# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEaccountnum'>
			(accountnum like '%$LIKEaccountnum$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='accountnum'>
			(accountnum = #accountnum# )
		</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_Ywalarmeventinfo" parameterClass="java.util.Map">
		insert into 
		ywalarmeventinfo(
		<dynamic prepend=" ">  
			<isNotEmpty prepend=',' property='alarmeventid'>alarmeventid</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmruleid'>alarmruleid</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmrulename'>alarmrulename</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmdevicetype'>alarmdevicetype</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmdevicename'>alarmdevicename</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmdeviceid'>alarmdeviceid</isNotEmpty>
			<isNotEmpty prepend=',' property='channelnum'>channelnum</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmtype'>alarmtype</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmgrade'>alarmgrade</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmsubtypecode'>alarmsubtypecode</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmsubtypename'>alarmsubtypename</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmreason'>alarmreason</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmtime'>alarmtime</isNotEmpty>
			<isNotEmpty prepend=',' property='falutdtype'>falutdtype</isNotEmpty>
			<isNotEmpty prepend=',' property='falutdescription'>falutdescription</isNotEmpty>
			<isNotEmpty prepend=',' property='processstatus'>processstatus</isNotEmpty>
			<isNotEmpty prepend=',' property='processtime'>processtime</isNotEmpty>
			<isNotEmpty prepend=',' property='processaccount'>processaccount</isNotEmpty>
			<isNotEmpty prepend=',' property='processdescription'>processdescription</isNotEmpty>
			<isNotEmpty prepend=',' property='unalarmtime'>unalarmtime</isNotEmpty>
			<isNotEmpty prepend=',' property='completetime'>completetime</isNotEmpty>
			<isNotEmpty prepend=',' property='completeaccount'>completeaccount</isNotEmpty>
			<isNotEmpty prepend=',' property='pictureurl'>pictureurl</isNotEmpty>
			<isNotEmpty prepend=',' property='videourl'>videourl</isNotEmpty>
			<isNotEmpty prepend=',' property='relatetaskbatchnum'>relatetaskbatchnum</isNotEmpty>
			<isNotEmpty prepend=',' property='relatetasknum'>relatetasknum</isNotEmpty>
			<isNotEmpty prepend=',' property='accountnum'>accountnum</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='alarmeventid'>#alarmeventid#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmruleid'>#alarmruleid#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmrulename'>#alarmrulename#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmdevicetype'>#alarmdevicetype#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmdevicename'>#alarmdevicename#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmdeviceid'>#alarmdeviceid#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelnum'>#channelnum#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmtype'>#alarmtype#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmgrade'>#alarmgrade#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmsubtypecode'>#alarmsubtypecode#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmsubtypename'>#alarmsubtypename#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmreason'>#alarmreason#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmtime'>#alarmtime#</isNotEmpty>
			<isNotEmpty prepend=',' property='falutdtype'>#falutdtype#</isNotEmpty>
			<isNotEmpty prepend=',' property='falutdescription'>#falutdescription#</isNotEmpty>
			<isNotEmpty prepend=',' property='processstatus'>#processstatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='processtime'>#processtime#</isNotEmpty>
			<isNotEmpty prepend=',' property='processaccount'>#processaccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='processdescription'>#processdescription#</isNotEmpty>
			<isNotEmpty prepend=',' property='unalarmtime'>#unalarmtime#</isNotEmpty>
			<isNotEmpty prepend=',' property='completetime'>#completetime#</isNotEmpty>
			<isNotEmpty prepend=',' property='completeaccount'>#completeaccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='pictureurl'>#pictureurl#</isNotEmpty>
			<isNotEmpty prepend=',' property='videourl'>#videourl#</isNotEmpty>
			<isNotEmpty prepend=',' property='relatetaskbatchnum'>#relatetaskbatchnum#</isNotEmpty>
			<isNotEmpty prepend=',' property='relatetasknum'>#relatetasknum#</isNotEmpty>
			<isNotEmpty prepend=',' property='accountnum'>#accountnum#</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_Ywalarmeventinfo" parameterClass="java.util.Map">
		update ywalarmeventinfo 
		<dynamic prepend="set ">   
			
			<isNotEmpty prepend=',' property='alarmruleid'>alarmruleid=#alarmruleid#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmrulename'>alarmrulename=#alarmrulename#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmdevicetype'>alarmdevicetype=#alarmdevicetype#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmdevicename'>alarmdevicename=#alarmdevicename#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmdeviceid'>alarmdeviceid=#alarmdeviceid#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelnum'>channelnum=#channelnum#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmtype'>alarmtype=#alarmtype#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmgrade'>alarmgrade=#alarmgrade#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmsubtypecode'>alarmsubtypecode=#alarmsubtypecode#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmsubtypename'>alarmsubtypename=#alarmsubtypename#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmreason'>alarmreason=#alarmreason#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmtime'>alarmtime=#alarmtime#</isNotEmpty>
			<isNotEmpty prepend=',' property='falutdtype'>falutdtype=#falutdtype#</isNotEmpty>
			<isNotEmpty prepend=',' property='falutdescription'>falutdescription=#falutdescription#</isNotEmpty>
			<isNotEmpty prepend=',' property='processstatus'>processstatus=#processstatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='processtime'>processtime=#processtime#</isNotEmpty>
			<isNotEmpty prepend=',' property='processaccount'>processaccount=#processaccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='processdescription'>processdescription=#processdescription#</isNotEmpty>
			<isNotEmpty prepend=',' property='unalarmtime'>unalarmtime=#unalarmtime#</isNotEmpty>
			<isNotEmpty prepend=',' property='completetime'>completetime=#completetime#</isNotEmpty>
			<isNotEmpty prepend=',' property='completeaccount'>completeaccount=#completeaccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='pictureurl'>pictureurl=#pictureurl#</isNotEmpty>
			<isNotEmpty prepend=',' property='videourl'>videourl=#videourl#</isNotEmpty>
			<isNotEmpty prepend=',' property='relatetaskbatchnum'>relatetaskbatchnum=#relatetaskbatchnum#</isNotEmpty>
			<isNotEmpty prepend=',' property='relatetasknum'>relatetasknum=#relatetasknum#</isNotEmpty>
			<isNotEmpty prepend=',' property='accountnum'>accountnum=#accountnum#</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='XGTJalarmeventid'> alarmeventid = #XGTJalarmeventid#</isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmruleid'> alarmruleid = #XGTJalarmruleid# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmrulename'> alarmrulename = #XGTJalarmrulename# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmdevicetype'> alarmdevicetype = #XGTJalarmdevicetype# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmdevicename'> alarmdevicename = #XGTJalarmdevicename# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmdeviceid'> alarmdeviceid = #XGTJalarmdeviceid# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJchannelnum'> channelnum = #XGTJchannelnum# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmtype'> alarmtype = #XGTJalarmtype# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmgrade'> alarmgrade = #XGTJalarmgrade# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmsubtypecode'> alarmsubtypecode = #XGTJalarmsubtypecode# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmsubtypename'> alarmsubtypename = #XGTJalarmsubtypename# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmreason'> alarmreason = #XGTJalarmreason# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmtime'> alarmtime = #XGTJalarmtime# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJfalutdtype'> falutdtype = #XGTJfalutdtype# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJfalutdescription'> falutdescription = #XGTJfalutdescription# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJprocessstatus'> processstatus = #XGTJprocessstatus# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJprocesstime'> processtime = #XGTJprocesstime# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJprocessaccount'> processaccount = #XGTJprocessaccount# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJprocessdescription'> processdescription = #XGTJprocessdescription# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJunalarmtime'> unalarmtime = #XGTJunalarmtime# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJcompletetime'> completetime = #XGTJcompletetime# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJcompleteaccount'> completeaccount = #XGTJcompleteaccount# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJpictureurl'> pictureurl = #XGTJpictureurl# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvideourl'> videourl = #XGTJvideourl# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJrelatetaskbatchnum'> relatetaskbatchnum = #XGTJrelatetaskbatchnum# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJrelatetasknum'> relatetasknum = #XGTJrelatetasknum# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJaccountnum'> accountnum = #XGTJaccountnum# </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_Ywalarmeventinfo" parameterClass="java.util.Map">
		delete from ywalarmeventinfo 
		<include refid="condition_Ywalarmeventinfo"/>
	</delete>
	
	<!-- batch delete object -->
	<delete id="batch_delete_Ywalarmeventinfo" parameterClass="java.util.Map">
		delete from ywalarmeventinfo 
		where 1=1
			<isNotEmpty prepend='AND' property='keyword'>
			key  in (#keyword#)
			</isNotEmpty>
	</delete>
	
	<!-- 查询告警列表，显示权限范围内的设备告警信息-->
	<select id="query_Ywalarmeventinfo" resultClass="java.util.HashMap" parameterClass="java.util.Map" >
		select 
			alarmeventid,alarmruleid,alarmrulename,
			alarmdevicetype,(select csmc from xtcl where csdl='ywAlarmDeviceType' and csdm=a.alarmdevicetype) as alarmdevicetypename,
			alarmdevicename,alarmdeviceid,channelnum,
			alarmtype,(select csmc from xtcl where csdl='ywAlarmType' and csdm=a.alarmtype) as alarmtypename,
			alarmgrade,(select csmc from xtcl where csdl='ywAlarmRuleLevel' and csdm=a.alarmgrade) as alarmgradename,
			processstatus,(select csmc from xtcl where csdl='ywAlarmProcessStatus' and csdm=a.processstatus) as processstatusname,
			alarmsubtypecode,alarmsubtypename,alarmreason,alarmtime,falutdtype,falutdescription,processtime,processaccount,processdescription,unalarmtime,completetime,completeaccount,pictureurl,videourl,relatetaskbatchnum,relatetasknum,accountnum,createaccount,createtime,modifyaccount,modifytime,remarks,extend1,extend2,extend3,extend4
			from ywalarmeventinfo a 
			<isNotEmpty prepend=' ' property='bmbh'>
			 	LEFT JOIN sbtdjqqx b on (b.sbbh=a.alarmdeviceid and b.tdbh=a.channelnum )
			</isNotEmpty>
			<!-- where processstatus=900  -->
			where 1=1
			<isNotEmpty prepend='and' property='bmbh'>
				((a.alarmdevicetype = '1' and b.bmbh=#bmbh# ) or (a.alarmdevicetype !='1'))
			</isNotEmpty>
			<isNotEmpty prepend='AND' property='LIKEalarmdevicename'>
				(alarmdevicename like '%$LIKEalarmdevicename$%'  )
			</isNotEmpty>
			<isNotEmpty prepend='AND' property='alarmdevicetype'>
				(alarmdevicetype = #alarmdevicetype# )
			</isNotEmpty>
			<isNotEmpty prepend='AND' property='videoDevices'>
				CONCAT(alarmdeviceid,'_',channelnum)  in 
				<iterate  open="(" close=")" conjunction="," property="videoDevices"> 
					#videoDevices[]#
		    	</iterate> 
			</isNotEmpty>
			<isNotEmpty prepend='AND' property='ortherDevices'>
				alarmdeviceid  in 
				<iterate  open="(" close=")" conjunction="," property="ortherDevices"> 
					#ortherDevices[]#
		    	</iterate> 
			</isNotEmpty>
			<isNotEmpty prepend='AND' property='processstatus'>
				(processstatus = #processstatus# )
			</isNotEmpty>
			<isNotEmpty prepend='AND' property='alarmgrade'>
				(alarmgrade = #alarmgrade# )
			</isNotEmpty>
			<isNotEmpty prepend='AND' property='alarmtype'>
				(alarmtype = #alarmtype# )
			</isNotEmpty>
			<isNotEmpty property='tableparam'>
				$tableparam$
			</isNotEmpty>
			<isNotEmpty prepend=' ' property='order'>
			 	$order$ 
			</isNotEmpty>
			<!-- <isNotEmpty prepend=' ' property='start'>
				limit #start#,#limit#
			</isNotEmpty> --> 
	</select>

	<select id="query_YwalarmeventinfoDetail" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
			alarmeventid,alarmruleid,alarmrulename,
			alarmdevicetype,(select csmc from xtcl where csdl='ywAlarmDeviceType' and csdm=a.alarmdevicetype) as alarmdevicetypename,
			alarmdevicename,alarmdeviceid,channelnum,
			alarmtype,(select csmc from xtcl where csdl='ywAlarmType' and csdm=a.alarmtype) as alarmtypename,
			alarmgrade,(select csmc from xtcl where csdl='ywAlarmRuleLevel' and csdm=a.alarmgrade) as alarmgradename,
			processstatus,(select csmc from xtcl where csdl='ywAlarmProcessStatus' and csdm=a.processstatus) as processstatusname,
			alarmsubtypecode,alarmsubtypename,alarmreason,alarmtime,falutdtype,falutdescription,processtime,processaccount,processdescription,unalarmtime,completetime,completeaccount,pictureurl,videourl,relatetaskbatchnum,relatetasknum,accountnum,createaccount,createtime,modifyaccount,modifytime,remarks,extend1,extend2,extend3,extend4,
			d.xzbh,c.xzmc
			from ywalarmeventinfo a 
			<isNotEmpty prepend=' ' property='bmbh'>
			 	LEFT JOIN sbtdjqqx b on (b.sbbh=a.alarmdeviceid and b.tdbh=a.channelnum )
			</isNotEmpty>
			LEFT JOIN sbtdspsr d on (d.sbbh=a.alarmdeviceid and d.tdbh=a.channelnum )
			LEFT JOIN ptxzs c on (d.xzbh = c.xzbh)
			where 1=1 
			<isNotEmpty prepend='AND' property='alarmdeviceid'>
				(a.alarmdeviceid = #alarmdeviceid# )
			</isNotEmpty>
			<isNotEmpty prepend='AND' property='channelnum'>
				(a.channelnum = #channelnum# )
			</isNotEmpty>
			<isNotEmpty prepend='and' property='bmbh'>
				((a.alarmdevicetype = '1' and b.bmbh=#bmbh# ) or (a.alarmdevicetype !='1'))
			</isNotEmpty>
			<isNotEmpty prepend=' ' property='order'>
			 	$order$ 
			</isNotEmpty>
			<!-- <isNotEmpty prepend=' ' property='start'>
				limit #start#,#limit#
			</isNotEmpty> --> 
	</select>

	<!-- 查询故障信息列表，显示权限范围内的设备告警信息-->
	<select id="query_Ywalarmlist" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
			alarmeventid,jobnum,jobreportpeople
			from ywrepairjobinfo a 
			where 1=1 
			<isNotEmpty prepend='AND' property='alarmeventid'>
				alarmeventid  =#alarmeventid#
		</isNotEmpty>
	</select>
	
	<!-- query objects totalcount -->
	<select id="count_Ywalarmeventinfo" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		<!-- select count(1) from ( -->
			select count(*)
				from ywalarmeventinfo a 
				<isNotEmpty prepend=' ' property='bmbh'>
				 	LEFT JOIN sbtdjqqx b on (b.sbbh=a.alarmdeviceid and b.tdbh=a.channelnum )
				</isNotEmpty>
				<!-- where processstatus=900 --> 
				where 1=1
				<isNotEmpty prepend='and' property='bmbh'>
					((a.alarmdevicetype = '1' and b.bmbh=#bmbh# ) or (a.alarmdevicetype !='1'))
				</isNotEmpty>
				<isNotEmpty prepend='AND' property='LIKEalarmdevicename'>
					(alarmdevicename like '%$LIKEalarmdevicename$%'  )
				</isNotEmpty>
				<isNotEmpty prepend='AND' property='alarmdevicetype'>
					(alarmdevicetype = #alarmdevicetype# )
				</isNotEmpty>
				<isNotEmpty prepend='AND' property='videoDevices'>
					CONCAT(alarmdeviceid,'_',channelnum)  in 
					<iterate  open="(" close=")" conjunction="," property="videoDevices"> 
						#videoDevices[]#
			    	</iterate> 
				</isNotEmpty>
				<isNotEmpty prepend='AND' property='ortherDevices'>
					alarmdeviceid  in 
					<iterate  open="(" close=")" conjunction="," property="ortherDevices"> 
						#ortherDevices[]#
			    	</iterate> 
				</isNotEmpty>
				<isNotEmpty prepend='AND' property='processstatus'>
					(processstatus = #processstatus# )
				</isNotEmpty>
				<isNotEmpty prepend='AND' property='alarmgrade'>
					(alarmgrade = #alarmgrade# )
				</isNotEmpty>
				<isNotEmpty prepend='AND' property='alarmtype'>
					(alarmtype = #alarmtype# )
				</isNotEmpty>
				<isNotEmpty property='tableparam'>
					$tableparam$
				</isNotEmpty>
			<!-- ) c	 -->
	</select>
	
	<!-- batch add objects -->
	<insert id="batch_insert_Ywalarmeventinfo" parameterClass="java.util.List">
	 	<![CDATA[
          INSERT
      	]]>
      	<iterate conjunction=" " > 
			into ywalarmeventinfo(
			 <![CDATA[ 
				alarmeventid,alarmruleid,alarmrulename,alarmdevicetype,alarmdevicename,alarmdeviceid,channelnum,alarmtype,alarmgrade,alarmsubtypecode,alarmsubtypename,alarmreason,alarmtime,falutdtype,falutdescription,processstatus,processtime,processaccount,processdescription,unalarmtime,completetime,completeaccount,pictureurl,videourl,relatetaskbatchnum,relatetasknum,accountnum,createaccount,createtime,modifyaccount,modifytime,remarks,extend1,extend2,extend3,extend4
			)values
			 ]]>  		 
			 <![CDATA[ 
				(
				#list[].alarmeventid#,#list[].alarmruleid#,#list[].alarmrulename#,#list[].alarmdevicetype#,#list[].alarmdevicename#,#list[].alarmdeviceid#,#list[].channelnum#,#list[].alarmtype#,#list[].alarmgrade#,#list[].alarmsubtypecode#,#list[].alarmsubtypename#,#list[].alarmreason#,#list[].alarmtime#,#list[].falutdtype#,#list[].falutdescription#,#list[].processstatus#,#list[].processtime#,#list[].processaccount#,#list[].processdescription#,#list[].unalarmtime#,#list[].completetime#,#list[].completeaccount#,#list[].pictureurl#,#list[].videourl#,#list[].relatetaskbatchnum#,#list[].relatetasknum#,#list[].accountnum#,#list[].createaccount#,#list[].createtime#,#list[].modifyaccount#,#list[].modifytime#,#list[].remarks#,#list[].extend1#,#list[].extend2#,#list[].extend3#,#list[].extend4#
				)
			]]>    
    	</iterate> 
	</insert>
	<select id="statisticPieChart"  resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
			COUNT(*) as num,
			(select csmc from xtcl where csdl='ywAlarmType' and csdm=a.alarmtype) as name ,
			alarmtype
		from ywalarmeventinfo a 
		<include refid="condition_Ywalarmeventinfo"/>	
		
		GROUP BY alarmtype
	</select>
	
	
	
	
	<!-- 折线统计 -->
	<!-- 统计 折线-小时 -->
	<select id="alarmStatisticsHour"  resultClass="java.util.HashMap" parameterClass="java.util.Map" >
		
		select a.xData,count(*) as num from (
		
			select  substr(alarmtime,12,2) as xData,ALARMEVENTID from
			ywalarmeventinfo
			<include refid="condition_Ywalarmeventinfo"/>	
			<isNotEmpty prepend='AND' property='videoDevices'>
				CONCAT(alarmdeviceid,'_',channelnum)  in 
				<iterate  open="(" close=")" conjunction="," property="videoDevices"> 
				
					#videoDevices[]#
		    	</iterate> 
			</isNotEmpty>
			<isNotEmpty prepend='AND' property='ortherDevices'>
				alarmdeviceid  in 
				<iterate  open="(" close=")" conjunction="," property="ortherDevices"> 
				
					#ortherDevices[]#
		    	</iterate> 
			</isNotEmpty>
		) a
		group by xData
			
	</select>
	<!-- 统计 折线-天 -->
	<select id="alarmStatisticsDay"  resultClass="java.util.HashMap" parameterClass="java.util.Map" >
		select a.xData,count(*) as num from (
			select  substr(alarmtime,9,2) as xData,ALARMEVENTID from
			ywalarmeventinfo
			<include refid="condition_Ywalarmeventinfo"/>	
			<isNotEmpty prepend='AND' property='videoDevices'>
				CONCAT(alarmdeviceid,'_',channelnum)  in 
				<iterate  open="(" close=")" conjunction="," property="videoDevices"> 
				
					#videoDevices[]#
		    	</iterate> 
			</isNotEmpty>
			<isNotEmpty prepend='AND' property='ortherDevices'>
				alarmdeviceid  in 
				<iterate  open="(" close=")" conjunction="," property="ortherDevices"> 
				
					#ortherDevices[]#
		    	</iterate> 
			</isNotEmpty>
		) a
		group by xData
	</select>
	<!-- 统计 折线-月 -->
	<select id="alarmStatisticsMonth"  resultClass="java.util.HashMap" parameterClass="java.util.Map" >
		select a.xData,count(*) as num from (
			select  substr(alarmtime,6,2) as xData,ALARMEVENTID from
			ywalarmeventinfo
			<include refid="condition_Ywalarmeventinfo"/>	
			<isNotEmpty prepend='AND' property='videoDevices'>
				CONCAT(alarmdeviceid,'_',channelnum)  in 
				<iterate  open="(" close=")" conjunction="," property="videoDevices"> 
				
					#videoDevices[]#
		    	</iterate> 
			</isNotEmpty>
			<isNotEmpty prepend='AND' property='ortherDevices'>
				alarmdeviceid  in 
				<iterate  open="(" close=")" conjunction="," property="ortherDevices"> 
					#ortherDevices[]#
		    	</iterate> 
			</isNotEmpty>
		) a
		group by xData
	</select>
	<select id="checkQx" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select a.yhbh,a.sfgly,b.seealarmauthory,b.receivealarmsms,b.isapprovalauthory from ptyh a 
		left join ywuserrolerelation b
		on a.yhbh=b.usernum 
		where a.yhbh = #yhbh# 
	</select>
	
	<update id="ignore_Ywalarmeventinfo" parameterClass="java.util.Map">
		update ywalarmeventinfo 
		<dynamic prepend="set ">   						
			<isNotEmpty prepend=',' property='processstatus'>processstatus=#processstatus#</isNotEmpty>
			<isNotEmpty prepend=',' property='processtime'>processtime=#processtime#</isNotEmpty>	
			<isNotEmpty prepend=',' property='processaccount'>processaccount=#processaccount#</isNotEmpty>	
			<isNotEmpty prepend=',' property='processdescription'>processdescription=#processdescription#</isNotEmpty>	
			<isNotEmpty prepend=',' property='unalarmtime'>unalarmtime=#unalarmtime#</isNotEmpty>	
			<isNotEmpty prepend=',' property='completetime'>completetime=#completetime#</isNotEmpty>	
			<isNotEmpty prepend=',' property='completeaccount'>completeaccount=#completeaccount#</isNotEmpty>	
					
			<isNotEmpty prepend=',' property='modifyaccount'>modifyaccount=#modifyaccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifytime'>modifytime=#modifytime#</isNotEmpty>
		</dynamic>
		where 1=1 
			<isNotEmpty prepend='AND' property='keys'>
			alarmeventid  in 
			<iterate  open="(" close=")" conjunction="," property="keys"> 
				#keys[]#
	    	</iterate> 
		</isNotEmpty>
	</update>
	
	
	<!-- 首页监控故障次数统计 -->
	<select id="count_HomepageFaultCount" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		<!--
		select count(*) as gjcs, alarmdeviceid,alarmdevicename as sbmc, channelnum,
			(select cjmc from sbxx b where alarmdeviceId=b.sbbh) as cjmc
 		from ywalarmeventinfo 
		where alarmdevicetype = '1'
		group by alarmdeviceid,channelnum,alarmdevicename
		order by gjcs desc  -->
		
		select a.*,b.tdmc as sbmc from 
		(
			select count(1) as gjcs,alarmdeviceid,channelnum from ywalarmeventinfo 
			where alarmdevicetype = '1'
			group by alarmdeviceid,channelnum
			order by gjcs desc 
		) a 
		left join sbtdspsr b
		on a.alarmdeviceid = sbbh and a.channelnum = b.tdbh
		order by a.gjcs desc
	</select>
</sqlMap>











