<?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="Ywmachinecpubean" type="cn.vp.XXX.model.YwmachinecpuBean"/> -->	
<typeAlias alias="Ywmachinecpu" type="cn.yw.machinecpu/bean.YwmachinecpuBean"/>

	<sql id="condition_Ywmachinecpu">
		where 1=1
		<isNotEmpty prepend='AND' property='LIKEcpuid'>
			(cpuid like '%$LIKEcpuid$%'   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='cpuid'>
			(cpuid = #cpuid#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEmachineid'>
			(machineid like '%$LIKEmachineid$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='machineid'>
			(machineid = #machineid# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcpunum'>
			(cpunum like '%$LIKEcpunum$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='cpunum'>
			(cpunum = #cpunum# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcpubrand'>
			(cpubrand like '%$LIKEcpubrand$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='cpubrand'>
			(cpubrand = #cpubrand# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcpumodel'>
			(cpumodel like '%$LIKEcpumodel$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='cpumodel'>
			(cpumodel = #cpumodel# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcpucoresnum'>
			(cpucoresnum like '%$LIKEcpucoresnum$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='cpucoresnum'>
			(cpucoresnum = #cpucoresnum# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEalarmunderlevel'>
			(alarmunderlevel like '%$LIKEalarmunderlevel$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmunderlevel'>
			(alarmunderlevel = #alarmunderlevel# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEalarmupperlevel'>
			(alarmupperlevel like '%$LIKEalarmupperlevel$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='alarmupperlevel'>
			(alarmupperlevel = #alarmupperlevel# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcurrentusage'>
			(currentusage like '%$LIKEcurrentusage$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='currentusage'>
			(currentusage = #currentusage# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcurrentusageuptime'>
			(currentusageuptime like '%$LIKEcurrentusageuptime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='currentusageuptime'>
			(currentusageuptime = #currentusageuptime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEdetectionswitch'>
			(detectionswitch like '%$LIKEdetectionswitch$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='detectionswitch'>
			(detectionswitch = #detectionswitch# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEdetectionstarttime'>
			(detectionstarttime like '%$LIKEdetectionstarttime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='detectionstarttime'>
			(detectionstarttime = #detectionstarttime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcreateaccount'>
			(createaccount like '%$LIKEcreateaccount$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='createaccount'>
			(createaccount = #createaccount# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcreatetime'>
			(createtime like '%$LIKEcreatetime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='createtime'>
			(createtime = #createtime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEmodifyaccount'>
			(modifyaccount like '%$LIKEmodifyaccount$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='modifyaccount'>
			(modifyaccount = #modifyaccount# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEmodifytime'>
			(modifytime like '%$LIKEmodifytime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='modifytime'>
			(modifytime = #modifytime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEremarks'>
			(remarks like '%$LIKEremarks$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='remarks'>
			(remarks = #remarks# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEextend1'>
			(extend1 like '%$LIKEextend1$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='extend1'>
			(extend1 = #extend1# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEextend2'>
			(extend2 like '%$LIKEextend2$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='extend2'>
			(extend2 = #extend2# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEextend3'>
			(extend3 like '%$LIKEextend3$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='extend3'>
			(extend3 = #extend3# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEextend4'>
			(extend4 like '%$LIKEextend4$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='extend4'>
			(extend4 = #extend4# )
		</isNotEmpty>
		<isNotEmpty property='tableparam'>
			$tableparam$
		</isNotEmpty>
		<isNotEmpty property='order'>
			$order$
		</isNotEmpty>
	</sql>
	
	<!-- add object -->
	<insert id="insert_Ywmachinecpu" parameterClass="java.util.Map">
		insert into 
		ywmachinecpu(
		<dynamic prepend=" ">  
			<isNotEmpty prepend=',' property='cpuid'>cpuid</isNotEmpty>
			<isNotEmpty prepend=',' property='machineid'>machineid</isNotEmpty>
			<isNotEmpty prepend=',' property='cpunum'>cpunum</isNotEmpty>
			<isNotEmpty prepend=',' property='cpubrand'>cpubrand</isNotEmpty>
			<isNotEmpty prepend=',' property='cpumodel'>cpumodel</isNotEmpty>
			<isNotEmpty prepend=',' property='cpucoresnum'>cpucoresnum</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmunderlevel'>alarmunderlevel</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmupperlevel'>alarmupperlevel</isNotEmpty>
			<isNotEmpty prepend=',' property='currentusage'>currentusage</isNotEmpty>
			<isNotEmpty prepend=',' property='currentusageuptime'>currentusageuptime</isNotEmpty>
			<isNotEmpty prepend=',' property='detectionswitch'>detectionswitch</isNotEmpty>
			<isNotEmpty prepend=',' property='detectionstarttime'>detectionstarttime</isNotEmpty>
			<isNotEmpty prepend=',' property='createaccount'>createaccount</isNotEmpty>
			<isNotEmpty prepend=',' property='createtime'>createtime</isNotEmpty>
			<isNotEmpty prepend=',' property='modifyaccount'>modifyaccount</isNotEmpty>
			<isNotEmpty prepend=',' property='modifytime'>modifytime</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks'>remarks</isNotEmpty>
			<isNotEmpty prepend=',' property='extend1'>extend1</isNotEmpty>
			<isNotEmpty prepend=',' property='extend2'>extend2</isNotEmpty>
			<isNotEmpty prepend=',' property='extend3'>extend3</isNotEmpty>
			<isNotEmpty prepend=',' property='extend4'>extend4</isNotEmpty>

		</dynamic>  
	    <![CDATA[ 
	        ) values ( 
	    ]]>  
	     <dynamic prepend=" "> 
			<isNotEmpty prepend=',' property='cpuid'>#cpuid#</isNotEmpty>
			<isNotEmpty prepend=',' property='machineid'>#machineid#</isNotEmpty>
			<isNotEmpty prepend=',' property='cpunum'>#cpunum#</isNotEmpty>
			<isNotEmpty prepend=',' property='cpubrand'>#cpubrand#</isNotEmpty>
			<isNotEmpty prepend=',' property='cpumodel'>#cpumodel#</isNotEmpty>
			<isNotEmpty prepend=',' property='cpucoresnum'>#cpucoresnum#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmunderlevel'>#alarmunderlevel#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmupperlevel'>#alarmupperlevel#</isNotEmpty>
			<isNotEmpty prepend=',' property='currentusage'>#currentusage#</isNotEmpty>
			<isNotEmpty prepend=',' property='currentusageuptime'>#currentusageuptime#</isNotEmpty>
			<isNotEmpty prepend=',' property='detectionswitch'>#detectionswitch#</isNotEmpty>
			<isNotEmpty prepend=',' property='detectionstarttime'>#detectionstarttime#</isNotEmpty>
			<isNotEmpty prepend=',' property='createaccount'>#createaccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='createtime'>#createtime#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifyaccount'>#modifyaccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifytime'>#modifytime#</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks'>#remarks#</isNotEmpty>
			<isNotEmpty prepend=',' property='extend1'>#extend1#</isNotEmpty>
			<isNotEmpty prepend=',' property='extend2'>#extend2#</isNotEmpty>
			<isNotEmpty prepend=',' property='extend3'>#extend3#</isNotEmpty>
			<isNotEmpty prepend=',' property='extend4'>#extend4#</isNotEmpty>

		 </dynamic>  
	    <![CDATA[ 
	        ) 
	    ]]> 
	</insert>
	
	<!-- edit object  -->
	<update id="update_Ywmachinecpu" parameterClass="java.util.Map">
		update ywmachinecpu 
		<dynamic prepend="set ">   
			
			<isNotEmpty prepend=',' property='machineid'>machineid=#machineid#</isNotEmpty>
			<isNotEmpty prepend=',' property='cpunum'>cpunum=#cpunum#</isNotEmpty>
			<isNotEmpty prepend=',' property='cpubrand'>cpubrand=#cpubrand#</isNotEmpty>
			<isNotEmpty prepend=',' property='cpumodel'>cpumodel=#cpumodel#</isNotEmpty>
			<isNotEmpty prepend=',' property='cpucoresnum'>cpucoresnum=#cpucoresnum#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmunderlevel'>alarmunderlevel=#alarmunderlevel#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmupperlevel'>alarmupperlevel=#alarmupperlevel#</isNotEmpty>
			<isNotEmpty prepend=',' property='currentusage'>currentusage=#currentusage#</isNotEmpty>
			<isNotEmpty prepend=',' property='currentusageuptime'>currentusageuptime=#currentusageuptime#</isNotEmpty>
			<isNotEmpty prepend=',' property='detectionswitch'>detectionswitch=#detectionswitch#</isNotEmpty>
			<isNotEmpty prepend=',' property='detectionstarttime'>detectionstarttime=#detectionstarttime#</isNotEmpty>
			<isNotEmpty prepend=',' property='createaccount'>createaccount=#createaccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='createtime'>createtime=#createtime#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifyaccount'>modifyaccount=#modifyaccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifytime'>modifytime=#modifytime#</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks'>remarks=#remarks#</isNotEmpty>
			<isNotEmpty prepend=',' property='extend1'>extend1=#extend1#</isNotEmpty>
			<isNotEmpty prepend=',' property='extend2'>extend2=#extend2#</isNotEmpty>
			<isNotEmpty prepend=',' property='extend3'>extend3=#extend3#</isNotEmpty>
			<isNotEmpty prepend=',' property='extend4'>extend4=#extend4#</isNotEmpty>

		</dynamic>
		where 1=1 
			<isNotEmpty prepend='AND' property='XGTJcpuid'> cpuid = #XGTJcpuid#</isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJmachineid'> machineid = #XGTJmachineid# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJcpunum'> cpunum = #XGTJcpunum# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJcpubrand'> cpubrand = #XGTJcpubrand# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJcpumodel'> cpumodel = #XGTJcpumodel# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJcpucoresnum'> cpucoresnum = #XGTJcpucoresnum# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmunderlevel'> alarmunderlevel = #XGTJalarmunderlevel# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJalarmupperlevel'> alarmupperlevel = #XGTJalarmupperlevel# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJcurrentusage'> currentusage = #XGTJcurrentusage# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJcurrentusageuptime'> currentusageuptime = #XGTJcurrentusageuptime# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJdetectionswitch'> detectionswitch = #XGTJdetectionswitch# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJdetectionstarttime'> detectionstarttime = #XGTJdetectionstarttime# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJcreateaccount'> createaccount = #XGTJcreateaccount# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJcreatetime'> createtime = #XGTJcreatetime# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJmodifyaccount'> modifyaccount = #XGTJmodifyaccount# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJmodifytime'> modifytime = #XGTJmodifytime# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJremarks'> remarks = #XGTJremarks# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJextend1'> extend1 = #XGTJextend1# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJextend2'> extend2 = #XGTJextend2# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJextend3'> extend3 = #XGTJextend3# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJextend4'> extend4 = #XGTJextend4# </isNotEmpty>

	</update>
	
	<!-- delete object -->
	<delete id="delete_Ywmachinecpu" parameterClass="java.util.Map">
		delete from ywmachinecpu 
		<include refid="condition_Ywmachinecpu"/>
	</delete>
	
	<!-- batch delete object -->
	<delete id="batch_delete_Ywmachinecpu" parameterClass="java.util.Map">
		delete from ywmachinecpu 
		where 
		<isNotEmpty prepend=' ' property='ids'>
			cpuid in
			<iterate open="("  close=")"  conjunction=","  property="ids">
				#ids[]#  
			</iterate>
		</isNotEmpty>
	</delete>
	
	<!-- query objects by page-->
	<select id="query_Ywmachinecpu" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select a.*,b.csdm,b.csmc from (
			select 
				cpuid,machineid,cpunum,cpubrand,cpumodel,cpucoresnum,alarmunderlevel,alarmupperlevel,currentusage,currentusageuptime,detectionswitch,detectionstarttime,createaccount,createtime,modifyaccount,modifytime,remarks,extend1,extend2,extend3,extend4
			from ywmachinecpu 
			<include refid="condition_Ywmachinecpu"/>
			<!-- <isNotEmpty prepend=' ' property='start'>
				limit #start# ,#limit#
			</isNotEmpty> -->		
		) a 
		left join xtcl b on a.detectionswitch = b.csdm and b.csdl = 'ywTaskEnable'	
	</select>
	
	<!-- query objects totalcount -->
	<select id="count_Ywmachinecpu" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from ywmachinecpu 
		<include refid="condition_Ywmachinecpu"/>			
	</select>
	
	<!-- batch add objects -->
	<insert id="batch_insert_Ywmachinecpu" parameterClass="java.util.List">
	 	<![CDATA[
          INSERT
      	]]>
      	<iterate conjunction=" " > 
			into ywmachinecpu(
			 <![CDATA[ 
				cpuid,machineid,cpunum,cpubrand,cpumodel,cpucoresnum,alarmunderlevel,alarmupperlevel,currentusage,currentusageuptime,detectionswitch,detectionstarttime,createaccount,createtime,modifyaccount,modifytime,remarks,extend1,extend2,extend3,extend4
			)values
			 ]]>  		 
			 <![CDATA[ 
				(
				#list[].cpuid#,#list[].machineid#,#list[].cpunum#,#list[].cpubrand#,#list[].cpumodel#,#list[].cpucoresnum#,#list[].alarmunderlevel#,#list[].alarmupperlevel#,#list[].currentusage#,#list[].currentusageuptime#,#list[].detectionswitch#,#list[].detectionstarttime#,#list[].createaccount#,#list[].createtime#,#list[].modifyaccount#,#list[].modifytime#,#list[].remarks#,#list[].extend1#,#list[].extend2#,#list[].extend3#,#list[].extend4#
				)
			]]>    
    	</iterate> 
	</insert>
	
	<!-- 根据 cpuid 批量更新启用状态 -->
	<update id="edit_Ywmachinecpu" parameterClass="java.util.Map">
		update ywmachinecpu 
		<dynamic prepend="set ">   		
			<isNotEmpty prepend=',' property='detectionswitch'>detectionswitch=#detectionswitch#</isNotEmpty>			
			<isNotEmpty prepend=',' property='modifyaccount'>modifyaccount=#modifyaccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifytime'>modifytime=#modifytime#</isNotEmpty>
		</dynamic>
		where  
		<isNotEmpty prepend=' ' property='keys'>
			cpuid in
			<iterate open="("  close=")"  conjunction=","  property="keys">
				#keys[]#  
			</iterate>
		</isNotEmpty>
	</update>
</sqlMap>











