<?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="Ywalarmruleinfobean" type="cn.vp.XXX.model.YwalarmruleinfoBean"/> -->	
	
	<sql id="condition_Ywalarmruleinfo">
		where 1=1
		<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='LIKEalarmsource'>
			(alarmsource like '%$LIKEalarmsource$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmsource'>
			(alarmsource = #alarmsource# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEalarmtype'>
			(alarmtype like '%$LIKEalarmtype$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmtype'>
			(alarmtype = #alarmtype# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEalarmdeviceid'>
			(alarmdeviceid like '%$LIKEalarmdeviceid$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmdeviceid'>
			(alarmdeviceid = #alarmdeviceid# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEalarmgrade'>
			(alarmgrade like '%$LIKEalarmgrade$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmgrade'>
			(alarmgrade = #alarmgrade# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEisenable'>
			(isenable like '%$LIKEisenable$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='isenable'>
			(isenable = #isenable# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEalarmtrigger'>
			(alarmtrigger like '%$LIKEalarmtrigger$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmtrigger'>
			(alarmtrigger = #alarmtrigger# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEunalarmtrigger'>
			(unalarmtrigger like '%$LIKEunalarmtrigger$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='unalarmtrigger'>
			(unalarmtrigger = #unalarmtrigger# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEautounalarmtime'>
			(autounalarmtime like '%$LIKEautounalarmtime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='autounalarmtime'>
			(autounalarmtime = #autounalarmtime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEalarmmaxcount'>
			(alarmmaxcount like '%$LIKEalarmmaxcount$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmmaxcount'>
			(alarmmaxcount = #alarmmaxcount# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEnoticeclient'>
			(noticeclient like '%$LIKEnoticeclient$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='noticeclient'>
			(noticeclient = #noticeclient# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEnoticesms'>
			(noticesms like '%$LIKEnoticesms$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='noticesms'>
			(noticesms = #noticesms# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEnoticeemail'>
			(noticeemail like '%$LIKEnoticeemail$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='noticeemail'>
			(noticeemail = #noticeemail# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEnoticerecord'>
			(noticerecord like '%$LIKEnoticerecord$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='noticerecord'>
			(noticerecord = #noticerecord# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEnoticeupwall'>
			(noticeupwall like '%$LIKEnoticeupwall$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='noticeupwall'>
			(noticeupwall = #noticeupwall# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEnoticesnap'>
			(noticesnap like '%$LIKEnoticesnap$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='noticesnap'>
			(noticesnap = #noticesnap# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEnoticeputput'>
			(noticeputput like '%$LIKEnoticeputput$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='noticeputput'>
			(noticeputput = #noticeputput# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEnoticecloundplat'>
			(noticecloundplat like '%$LIKEnoticecloundplat$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='noticecloundplat'>
			(noticecloundplat = #noticecloundplat# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvoiceswitch'>
			(voiceswitch like '%$LIKEvoiceswitch$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='voiceswitch'>
			(voiceswitch = #voiceswitch# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvoicecontent'>
			(voicecontent like '%$LIKEvoicecontent$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='voicecontent'>
			(voicecontent = #voicecontent# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEphonenum'>
			(phonenum like '%$LIKEphonenum$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='phonenum'>
			(phonenum = #phonenum# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEsmscontent'>
			(smscontent like '%$LIKEsmscontent$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='smscontent'>
			(smscontent = #smscontent# )
		</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_Ywalarmruleinfo" parameterClass="java.util.Map">
		insert into 
		ywalarmruleinfo(
		<dynamic prepend=" ">  
			<isNotEmpty prepend=',' property='alarmruleid'>alarmruleid</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmrulename'>alarmrulename</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmsource'>alarmsource</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmtype'>alarmtype</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmdeviceid'>alarmdeviceid</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmgrade'>alarmgrade</isNotEmpty>
			<isNotEmpty prepend=',' property='isenable'>isenable</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmtrigger'>alarmtrigger</isNotEmpty>
			<isNotEmpty prepend=',' property='unalarmtrigger'>unalarmtrigger</isNotEmpty>
			<isNotEmpty prepend=',' property='autounalarmtime'>autounalarmtime</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmmaxcount'>alarmmaxcount</isNotEmpty>
			<isNotEmpty prepend=',' property='noticeclient'>noticeclient</isNotEmpty>
			<isNotEmpty prepend=',' property='noticesms'>noticesms</isNotEmpty>
			<isNotEmpty prepend=',' property='noticeemail'>noticeemail</isNotEmpty>
			<isNotEmpty prepend=',' property='noticerecord'>noticerecord</isNotEmpty>
			<isNotEmpty prepend=',' property='noticeupwall'>noticeupwall</isNotEmpty>
			<isNotEmpty prepend=',' property='noticesnap'>noticesnap</isNotEmpty>
			<isNotEmpty prepend=',' property='noticeputput'>noticeputput</isNotEmpty>
			<isNotEmpty prepend=',' property='noticecloundplat'>noticecloundplat</isNotEmpty>
			<isNotEmpty prepend=',' property='voiceswitch'>voiceswitch</isNotEmpty>
			<isNotEmpty prepend=',' property='voicecontent'>voicecontent</isNotEmpty>
			<isNotEmpty prepend=',' property='phonenum'>phonenum</isNotEmpty>
			<isNotEmpty prepend=',' property='smscontent'>smscontent</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='alarmruleid'>#alarmruleid#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmrulename'>#alarmrulename#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmsource'>#alarmsource#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmtype'>#alarmtype#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmdeviceid'>#alarmdeviceid#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmgrade'>#alarmgrade#</isNotEmpty>
			<isNotEmpty prepend=',' property='isenable'>#isenable#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmtrigger'>#alarmtrigger#</isNotEmpty>
			<isNotEmpty prepend=',' property='unalarmtrigger'>#unalarmtrigger#</isNotEmpty>
			<isNotEmpty prepend=',' property='autounalarmtime'>#autounalarmtime#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmmaxcount'>#alarmmaxcount#</isNotEmpty>
			<isNotEmpty prepend=',' property='noticeclient'>#noticeclient#</isNotEmpty>
			<isNotEmpty prepend=',' property='noticesms'>#noticesms#</isNotEmpty>
			<isNotEmpty prepend=',' property='noticeemail'>#noticeemail#</isNotEmpty>
			<isNotEmpty prepend=',' property='noticerecord'>#noticerecord#</isNotEmpty>
			<isNotEmpty prepend=',' property='noticeupwall'>#noticeupwall#</isNotEmpty>
			<isNotEmpty prepend=',' property='noticesnap'>#noticesnap#</isNotEmpty>
			<isNotEmpty prepend=',' property='noticeputput'>#noticeputput#</isNotEmpty>
			<isNotEmpty prepend=',' property='noticecloundplat'>#noticecloundplat#</isNotEmpty>
			<isNotEmpty prepend=',' property='voiceswitch'>#voiceswitch#</isNotEmpty>
			<isNotEmpty prepend=',' property='voicecontent'>#voicecontent#</isNotEmpty>
			<isNotEmpty prepend=',' property='phonenum'>#phonenum#</isNotEmpty>
			<isNotEmpty prepend=',' property='smscontent'>#smscontent#</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_Ywalarmruleinfo" parameterClass="java.util.Map">
		update ywalarmruleinfo 
		<dynamic prepend="set ">   
			
			<isNotEmpty prepend=',' property='alarmrulename'>alarmrulename=#alarmrulename#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmsource'>alarmsource=#alarmsource#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmtype'>alarmtype=#alarmtype#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmdeviceid'>alarmdeviceid=#alarmdeviceid#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmgrade'>alarmgrade=#alarmgrade#</isNotEmpty>
			<isNotEmpty prepend=',' property='isenable'>isenable=#isenable#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmtrigger'>alarmtrigger=#alarmtrigger#</isNotEmpty>
			<isNotEmpty prepend=',' property='unalarmtrigger'>unalarmtrigger=#unalarmtrigger#</isNotEmpty>
			<isNotEmpty prepend=',' property='autounalarmtime'>autounalarmtime=#autounalarmtime#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmmaxcount'>alarmmaxcount=#alarmmaxcount#</isNotEmpty>
			<isNotEmpty prepend=',' property='noticeclient'>noticeclient=#noticeclient#</isNotEmpty>
			<isNotEmpty prepend=',' property='noticesms'>noticesms=#noticesms#</isNotEmpty>
			<isNotEmpty prepend=',' property='noticeemail'>noticeemail=#noticeemail#</isNotEmpty>
			<isNotEmpty prepend=',' property='noticerecord'>noticerecord=#noticerecord#</isNotEmpty>
			<isNotEmpty prepend=',' property='noticeupwall'>noticeupwall=#noticeupwall#</isNotEmpty>
			<isNotEmpty prepend=',' property='noticesnap'>noticesnap=#noticesnap#</isNotEmpty>
			<isNotEmpty prepend=',' property='noticeputput'>noticeputput=#noticeputput#</isNotEmpty>
			<isNotEmpty prepend=',' property='noticecloundplat'>noticecloundplat=#noticecloundplat#</isNotEmpty>
			<isNotEmpty prepend=',' property='voiceswitch'>voiceswitch=#voiceswitch#</isNotEmpty>
			<isNotEmpty prepend=',' property='voicecontent'>voicecontent=#voicecontent#</isNotEmpty>
			<isNotEmpty prepend=',' property='phonenum'>phonenum=#phonenum#</isNotEmpty>
			<isNotEmpty prepend=',' property='smscontent'>smscontent=#smscontent#</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='XGTJalarmruleid'> alarmruleid = #XGTJalarmruleid#</isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmrulename'> alarmrulename = #XGTJalarmrulename# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmsource'> alarmsource = #XGTJalarmsource# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmtype'> alarmtype = #XGTJalarmtype# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmdeviceid'> alarmdeviceid = #XGTJalarmdeviceid# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmgrade'> alarmgrade = #XGTJalarmgrade# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJisenable'> isenable = #XGTJisenable# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmtrigger'> alarmtrigger = #XGTJalarmtrigger# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJunalarmtrigger'> unalarmtrigger = #XGTJunalarmtrigger# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJautounalarmtime'> autounalarmtime = #XGTJautounalarmtime# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmmaxcount'> alarmmaxcount = #XGTJalarmmaxcount# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJnoticeclient'> noticeclient = #XGTJnoticeclient# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJnoticesms'> noticesms = #XGTJnoticesms# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJnoticeemail'> noticeemail = #XGTJnoticeemail# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJnoticerecord'> noticerecord = #XGTJnoticerecord# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJnoticeupwall'> noticeupwall = #XGTJnoticeupwall# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJnoticesnap'> noticesnap = #XGTJnoticesnap# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJnoticeputput'> noticeputput = #XGTJnoticeputput# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJnoticecloundplat'> noticecloundplat = #XGTJnoticecloundplat# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvoiceswitch'> voiceswitch = #XGTJvoiceswitch# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvoicecontent'> voicecontent = #XGTJvoicecontent# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJphonenum'> phonenum = #XGTJphonenum# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJsmscontent'> smscontent = #XGTJsmscontent# </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_Ywalarmruleinfo" parameterClass="java.util.Map">
		delete from ywalarmruleinfo 
		<include refid="condition_Ywalarmruleinfo"/>
	</delete>
	
	<!-- batch delete object -->
	<delete id="batch_delete_Ywalarmruleinfo" parameterClass="java.util.Map">
		delete from ywalarmruleinfo 
		where 
		<isNotEmpty prepend=' ' property='ids'>
			alarmruleid in
			<iterate open="("  close=")"  conjunction=","  property="ids">
				#ids[]#  
			</iterate>
		</isNotEmpty>
		
	</delete>
	
	<!-- query objects by page-->
	<select id="query_Ywalarmruleinfo" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select a.*,b.csmc as alarmsourcemc,d.csmc as isenablemc,e.csmc as alarmgrademc,f.csmc as alarmtriggermc from(
		select 
			alarmruleid,alarmrulename,alarmsource,alarmtype,alarmdeviceid,alarmgrade,isenable,alarmtrigger,unalarmtrigger,autounalarmtime,alarmmaxcount,noticeclient,noticesms,noticeemail,noticerecord,noticeupwall,noticesnap,noticeputput,noticecloundplat,voiceswitch,voicecontent,phonenum,smscontent,createaccount,createtime,modifyaccount,modifytime,remarks,extend1,extend2,extend3,extend4
		from ywalarmruleinfo 
		<include refid="condition_Ywalarmruleinfo"/>
		<!-- <isNotEmpty prepend=' ' property='start'>
			limit #start# ,#limit#
		</isNotEmpty> -->	
		) a 
		left join xtcl b on a.alarmsource = b.csdm and b.csdl = 'ywAlarmRuleSource'
		left join xtcl d on a.isenable = d.csdm and d.csdl = 'ywTaskEnable'	
		left join xtcl e on a.alarmgrade = e.csdm and e.csdl = 'ywAlarmRuleLevel'
		left join xtcl f on a.alarmtrigger = f.csdm and f.csdl = 'enable'
	
	</select>
	
	<!-- query objects totalcount -->
	<select id="count_Ywalarmruleinfo" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from ywalarmruleinfo 
		<include refid="condition_Ywalarmruleinfo"/>			
	</select>
	
	<!-- batch add objects -->
	<insert id="batch_insert_Ywalarmruleinfo" parameterClass="java.util.List">
	 	<![CDATA[
          INSERT
      	]]>
      	<iterate conjunction=" " > 
			into ywalarmruleinfo(
			 <![CDATA[ 
				alarmruleid,alarmrulename,alarmsource,alarmtype,alarmdeviceid,alarmgrade,isenable,alarmtrigger,unalarmtrigger,autounalarmtime,alarmmaxcount,noticeclient,noticesms,noticeemail,noticerecord,noticeupwall,noticesnap,noticeputput,noticecloundplat,voiceswitch,voicecontent,phonenum,smscontent,createaccount,createtime,modifyaccount,modifytime,remarks,extend1,extend2,extend3,extend4
			)values
			 ]]>  		 
			 <![CDATA[ 
				(
				#list[].alarmruleid#,#list[].alarmrulename#,#list[].alarmsource#,#list[].alarmtype#,#list[].alarmdeviceid#,#list[].alarmgrade#,#list[].isenable#,#list[].alarmtrigger#,#list[].unalarmtrigger#,#list[].autounalarmtime#,#list[].alarmmaxcount#,#list[].noticeclient#,#list[].noticesms#,#list[].noticeemail#,#list[].noticerecord#,#list[].noticeupwall#,#list[].noticesnap#,#list[].noticeputput#,#list[].noticecloundplat#,#list[].voiceswitch#,#list[].voicecontent#,#list[].phonenum#,#list[].smscontent#,#list[].createaccount#,#list[].createtime#,#list[].modifyaccount#,#list[].modifytime#,#list[].remarks#,#list[].extend1#,#list[].extend2#,#list[].extend3#,#list[].extend4#
				)
			]]>    
    	</iterate> 
	</insert>
	
	<select id="getAlarmTypeMc" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select csdl,cslm,csdm,csmc from xtcl where csdl in ('ywAlarmVideoType','ywAlarmMachineType','ywAlarmSoftWareType','ywAlarmStorageType')		
	</select>
	
	<!-- 根据 cpuid 批量更新启用状态 -->
	<update id="edit_Ywalarmruleinfo" parameterClass="java.util.Map">
		update ywalarmruleinfo 
		<dynamic prepend="set ">   		
			<isNotEmpty prepend=',' property='isenable'>isenable=#isenable#</isNotEmpty>			
			<isNotEmpty prepend=',' property='modifyaccount'>modifyaccount=#modifyaccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifytime'>modifytime=#modifytime#</isNotEmpty>
		</dynamic>
		where  
		<isNotEmpty prepend=' ' property='keys'>
			alarmruleid in
			<iterate open="("  close=")"  conjunction=","  property="keys">
				#keys[]#  
			</iterate>
		</isNotEmpty>
	</update>
	
</sqlMap>











