<?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="" >
	
	<sql id="condition_Ywuserrolerelation">
		where 1=1
		<isNotEmpty prepend='AND' property='LIKErelationid'>
			(relationid like '%$LIKErelationid$%'   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='relationid'>
			(relationid = #relationid#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEusernum'>
			(usernum like '%$LIKEusernum$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='usernum'>
			(usernum = #usernum# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEisadministrator'>
			(isadministrator like '%$LIKEisadministrator$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='isadministrator'>
			(isadministrator = #isadministrator# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEuseraccount'>
			(useraccount like '%$LIKEuseraccount$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='useraccount'>
			(useraccount = #useraccount# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEseealarmauthory'>
			(seealarmauthory like '%$LIKEseealarmauthory$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='seealarmauthory'>
			(seealarmauthory = #seealarmauthory# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEreceivealarmsms'>
			(receivealarmsms like '%$LIKEreceivealarmsms$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='receivealarmsms'>
			(receivealarmsms = #receivealarmsms# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEisapprovalauthory'>
			(isapprovalauthory like '%$LIKEisapprovalauthory$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='isapprovalauthory'>
			(isapprovalauthory = #isapprovalauthory# )
		</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_Ywuserrolerelation" parameterClass="java.util.Map">
		insert into 
		ywuserrolerelation(
		<dynamic prepend=" ">  
			<isNotEmpty prepend=',' property='relationid'>relationid</isNotEmpty>
			<isNotEmpty prepend=',' property='usernum'>usernum</isNotEmpty>
			<isNotEmpty prepend=',' property='isadministrator'>isadministrator</isNotEmpty>
			<isNotEmpty prepend=',' property='useraccount'>useraccount</isNotEmpty>
			<isNotEmpty prepend=',' property='seealarmauthory'>seealarmauthory</isNotEmpty>
			<isNotEmpty prepend=',' property='receivealarmsms'>receivealarmsms</isNotEmpty>
			<isNotEmpty prepend=',' property='isapprovalauthory'>isapprovalauthory</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='relationid'>#relationid#</isNotEmpty>
			<isNotEmpty prepend=',' property='usernum'>#usernum#</isNotEmpty>
			<isNotEmpty prepend=',' property='isadministrator'>#isadministrator#</isNotEmpty>
			<isNotEmpty prepend=',' property='useraccount'>#useraccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='seealarmauthory'>#seealarmauthory#</isNotEmpty>
			<isNotEmpty prepend=',' property='receivealarmsms'>#receivealarmsms#</isNotEmpty>
			<isNotEmpty prepend=',' property='isapprovalauthory'>#isapprovalauthory#</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_Ywuserrolerelation" parameterClass="java.util.Map">
		update ywuserrolerelation 
		<dynamic prepend="set ">   
			
			<isNotEmpty prepend=',' property='usernum'>usernum=#usernum#</isNotEmpty>
			<isNotEmpty prepend=',' property='isadministrator'>isadministrator=#isadministrator#</isNotEmpty>
			<isNotEmpty prepend=',' property='useraccount'>useraccount=#useraccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='seealarmauthory'>seealarmauthory=#seealarmauthory#</isNotEmpty>
			<isNotEmpty prepend=',' property='receivealarmsms'>receivealarmsms=#receivealarmsms#</isNotEmpty>
			<isNotEmpty prepend=',' property='isapprovalauthory'>isapprovalauthory=#isapprovalauthory#</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='XGTJrelationid'> relationid = #XGTJrelationid#</isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJusernum'> usernum = #XGTJusernum# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJisadministrator'> isadministrator = #XGTJisadministrator# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJuseraccount'> useraccount = #XGTJuseraccount# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJseealarmauthory'> seealarmauthory = #XGTJseealarmauthory# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJreceivealarmsms'> receivealarmsms = #XGTJreceivealarmsms# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJisapprovalauthory'> isapprovalauthory = #XGTJisapprovalauthory# </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_Ywuserrolerelation" parameterClass="java.util.Map">
		delete from ywuserrolerelation 
		<include refid="condition_Ywuserrolerelation"/>
	</delete>
	
	<!-- batch delete object -->
	<delete id="batch_delete_Ywuserrolerelation" parameterClass="java.util.Map">
		delete from ywuserrolerelation 
		where 1=1
			<isNotEmpty prepend='AND' property='keyword'>
			key  in (#keyword#)
			</isNotEmpty>
	</delete>
	
	<!-- query objects by page-->
	<select id="query_Ywuserrolerelation" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
			relationid,usernum,isadministrator,useraccount,seealarmauthory,receivealarmsms,isapprovalauthory,createaccount,createtime,modifyaccount,modifytime,remarks,extend1,extend2,extend3,extend4
		from ywuserrolerelation 
		<include refid="condition_Ywuserrolerelation"/>		
	</select>
	<select id="getALlUserByPower" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
			usernum,useraccount,extend1
		from ywuserrolerelation 
		where extend1='1' 
		order by useraccount desc
	</select>
	
	<!-- query objects totalcount -->
	<select id="count_Ywuserrolerelation" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from ywuserrolerelation 
		<include refid="condition_Ywuserrolerelation"/>			
	</select>
	
	<!-- batch add objects -->
	<insert id="batch_insert_Ywuserrolerelation" parameterClass="java.util.List">
	 	<![CDATA[
          INSERT
      	]]>
      	<iterate conjunction=" " > 
			into ywuserrolerelation(
			 <![CDATA[ 
				relationid,usernum,isadministrator,useraccount,seealarmauthory,receivealarmsms,isapprovalauthory,createaccount,createtime,modifyaccount,modifytime,remarks,extend1,extend2,extend3,extend4
			)values
			 ]]>  		 
			 <![CDATA[ 
				(
				#list[].relationid#,#list[].usernum#,#list[].isadministrator#,#list[].useraccount#,#list[].seealarmauthory#,#list[].receivealarmsms#,#list[].isapprovalauthory#,#list[].createaccount#,#list[].createtime#,#list[].modifyaccount#,#list[].modifytime#,#list[].remarks#,#list[].extend1#,#list[].extend2#,#list[].extend3#,#list[].extend4#
				)
			]]>    
    	</iterate> 
	</insert>
</sqlMap>











