<?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="Ywarchivecompanypersonbean" type="cn.vp.XXX.model.YwarchivecompanypersonBean"/> -->	<typeAlias alias="Ywarchivecompanyperson" type="cn.im.companymanage.YwarchivecompanypersonBean"/>
	
	<sql id="condition_Ywarchivecompanyperson">
		where 1=1
		<isNotEmpty prepend='AND' property='LIKEpersonid'>
			(personid like '%$LIKEpersonid$%'   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='personid'>
			(personid = #personid#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcompanyid'>
			(companyid like '%$LIKEcompanyid$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='companyid'>
			(companyid = #companyid# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcompanyname'>
			(companyname like '%$LIKEcompanyname$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='companyname'>
			(companyname = #companyname# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEpersontype'>
			(persontype like '%$LIKEpersontype$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='persontype'>
			(persontype = #persontype# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEpersonname'>
			(personname like '%$LIKEpersonname$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='personname'>
			(personname = #personname# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEpersonphone'>
			(personphone like '%$LIKEpersonphone$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='personphone'>
			(personphone = #personphone# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEpersonaddrarea'>
			(personaddrarea like '%$LIKEpersonaddrarea$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='personaddrarea'>
			(personaddrarea = #personaddrarea# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEpersonaddress'>
			(personaddress like '%$LIKEpersonaddress$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='personaddress'>
			(personaddress = #personaddress# )
		</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_Ywarchivecompanyperson" parameterClass="java.util.Map">
		insert into 
		ywarchivecompanyperson(
		<dynamic prepend=" ">  
			<isNotEmpty prepend=',' property='personid'>personid</isNotEmpty>
			<isNotEmpty prepend=',' property='companyid'>companyid</isNotEmpty>
			<isNotEmpty prepend=',' property='companyname'>companyname</isNotEmpty>
			<isNotEmpty prepend=',' property='persontype'>persontype</isNotEmpty>
			<isNotEmpty prepend=',' property='personname'>personname</isNotEmpty>
			<isNotEmpty prepend=',' property='personphone'>personphone</isNotEmpty>
			<isNotEmpty prepend=',' property='personaddrarea'>personaddrarea</isNotEmpty>
			<isNotEmpty prepend=',' property='personaddress'>personaddress</isNotEmpty>
			<isNotEmpty prepend=',' property='xgry'>createaccount</isNotEmpty>
			<isNotEmpty prepend=',' property='xgrq'>createtime</isNotEmpty>
			<isNotEmpty prepend=',' property='cjry'>modifyaccount</isNotEmpty>
			<isNotEmpty prepend=',' property='cjrq'>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='personid'>#personid#</isNotEmpty>
			<isNotEmpty prepend=',' property='companyid'>#companyid#</isNotEmpty>
			<isNotEmpty prepend=',' property='companyname'>#companyname#</isNotEmpty>
			<isNotEmpty prepend=',' property='persontype'>#persontype#</isNotEmpty>
			<isNotEmpty prepend=',' property='personname'>#personname#</isNotEmpty>
			<isNotEmpty prepend=',' property='personphone'>#personphone#</isNotEmpty>
			<isNotEmpty prepend=',' property='personaddrarea'>#personaddrarea#</isNotEmpty>
			<isNotEmpty prepend=',' property='personaddress'>#personaddress#</isNotEmpty>
			<isNotEmpty prepend=',' property='xgry'>#xgry#</isNotEmpty>
			<isNotEmpty prepend=',' property='xgrq'>#xgrq#</isNotEmpty>
			<isNotEmpty prepend=',' property='cjry'>#cjry#</isNotEmpty>
			<isNotEmpty prepend=',' property='cjrq'>#cjrq#</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_Ywarchivecompanyperson" parameterClass="java.util.Map">
		update ywarchivecompanyperson 
		<dynamic prepend="set ">   
			
			<isNotEmpty prepend=',' property='companyid'>companyid=#companyid#</isNotEmpty>
			<isNotEmpty prepend=',' property='companyname'>companyname=#companyname#</isNotEmpty>
			<isNotEmpty prepend=',' property='persontype'>persontype=#persontype#</isNotEmpty>
			<isNotEmpty prepend=',' property='personname'>personname=#personname#</isNotEmpty>
			<isNotEmpty prepend=',' property='personphone'>personphone=#personphone#</isNotEmpty>
			<isNotEmpty prepend=',' property='personaddrarea'>personaddrarea=#personaddrarea#</isNotEmpty>
			<isNotEmpty prepend=',' property='personaddress'>personaddress=#personaddress#</isNotEmpty>
			<isNotEmpty prepend=',' property='xgry'>modifyaccount=#xgry#</isNotEmpty>
			<isNotEmpty prepend=',' property='xgrq'>modifytime=#xgrq#</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='XGTJpersonid'> personid = #XGTJpersonid#</isNotEmpty>

	</update>
	
	<!-- delete object -->
	<delete id="delete_Ywarchivecompanyperson" parameterClass="java.util.Map">
		delete from ywarchivecompanyperson 
		<include refid="condition_Ywarchivecompanyperson"/>
	</delete>
	
	<!-- batch delete object -->
	<delete id="batch_delete_Ywarchivecompanyperson" parameterClass="java.util.Map">
		delete from ywarchivecompanyperson 
		where 1=1
			<isNotEmpty prepend='AND' property='keyword'>
			key  in (#keyword#)
			</isNotEmpty>
	</delete>
	
	<!-- query objects by page-->
	<select id="query_Ywarchivecompanyperson" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
			personid,companyid,companyname,persontype,personname,personphone,personaddrarea,personaddress,createaccount,createtime,modifyaccount,modifytime,remarks,extend1,extend2,extend3,extend4
		from ywarchivecompanyperson 
		<include refid="condition_Ywarchivecompanyperson"/>	
		<!-- <isNotEmpty prepend=' ' property='start'>
			limit #start# ,#limit#
		</isNotEmpty>	 -->
	</select>
	
	<!-- query objects totalcount -->
	<select id="count_Ywarchivecompanyperson" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from ywarchivecompanyperson 
		<include refid="condition_Ywarchivecompanyperson"/>			
	</select>
	
	<!-- batch add objects -->
	<insert id="batch_insert_Ywarchivecompanyperson" parameterClass="java.util.List">
	 	<![CDATA[
          INSERT
      	]]>
      	<iterate conjunction=" " > 
			into ywarchivecompanyperson(
			 <![CDATA[ 
				personid,companyid,companyname,persontype,personname,personphone,personaddrarea,personaddress,createaccount,createtime,modifyaccount,modifytime,remarks,extend1,extend2,extend3,extend4
			)values
			 ]]>  		 
			 <![CDATA[ 
				(
				#list[].personid#,#list[].companyid#,#list[].companyname#,#list[].persontype#,#list[].personname#,#list[].personphone#,#list[].personaddrarea#,#list[].personaddress#,#list[].createaccount#,#list[].createtime#,#list[].modifyaccount#,#list[].modifytime#,#list[].remarks#,#list[].extend1#,#list[].extend2#,#list[].extend3#,#list[].extend4#
				)
			]]>    
    	</iterate> 
	</insert>
</sqlMap>











