<?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="Sbcjbean" type="cn.vp.XXX.model.SbcjBean"/> -->	<typeAlias alias="Sbcj" type="cn.im.sbcj.SbcjBean"/>
	
	<sql id="condition_Sbcj">
		where 1=1
		<isNotEmpty prepend='AND ' property='LIKExh'>
			(xh like '%$LIKExh$%'   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='xh'>
			(xh = #xh#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEcjbh'>
			(cjbh like '%$LIKEcjbh$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='cjbh'>
			(cjbh = #cjbh# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEcjmc'>
			(cjmc like '%$LIKEcjmc$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='cjmc'>
			(cjmc = #cjmc# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEcjmm'>
			(cjmm like '%$LIKEcjmm$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='cjmm'>
			(cjmm = #cjmm# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEcjry'>
			(cjry like '%$LIKEcjry$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='cjry'>
			(cjry = #cjry# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEcjrq'>
			(cjrq like '%$LIKEcjrq$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='cjrq'>
			(cjrq = #cjrq# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKExgry'>
			(xgry like '%$LIKExgry$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='xgry'>
			(xgry = #xgry# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKExgrq'>
			(xgrq like '%$LIKExgrq$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='xgrq'>
			(xgrq = #xgrq# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEbz'>
			(bz like '%$LIKEbz$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='bz'>
			(bz = #bz# )
		</isNotEmpty>
		<isNotEmpty property='tableparam'>
			$tableparam$
		</isNotEmpty>
		<isNotEmpty property='order'>
			$order$
		</isNotEmpty>
	</sql>
	
	<!-- add object -->
	<insert id="insert_Sbcj" parameterClass="java.util.Map">
		insert into 
		sbcj(
		<dynamic prepend=" ">  
			<isNotEmpty prepend=',' property='xh'>xh</isNotEmpty>
			<isNotEmpty prepend=',' property='cjbh'>cjbh</isNotEmpty>
			<isNotEmpty prepend=',' property='cjmc'>cjmc</isNotEmpty>
			<isNotEmpty prepend=',' property='cjmm'>cjmm</isNotEmpty>
			<isNotEmpty prepend=',' property='cjry'>cjry</isNotEmpty>
			<isNotEmpty prepend=',' property='cjrq'>cjrq</isNotEmpty>
			<isNotEmpty prepend=',' property='xgry'>xgry</isNotEmpty>
			<isNotEmpty prepend=',' property='xgrq'>xgrq</isNotEmpty>
			<isNotEmpty prepend=',' property='bz'>bz</isNotEmpty>

		</dynamic>  
	    <![CDATA[ 
	        ) values ( 
	    ]]>  
	     <dynamic prepend=" "> 
			<isNotEmpty prepend=',' property='xh'>#xh#</isNotEmpty>
			<isNotEmpty prepend=',' property='cjbh'>#cjbh#</isNotEmpty>
			<isNotEmpty prepend=',' property='cjmc'>#cjmc#</isNotEmpty>
			<isNotEmpty prepend=',' property='cjmm'>#cjmm#</isNotEmpty>
			<isNotEmpty prepend=',' property='cjry'>#cjry#</isNotEmpty>
			<isNotEmpty prepend=',' property='cjrq'>#cjrq#</isNotEmpty>
			<isNotEmpty prepend=',' property='xgry'>#xgry#</isNotEmpty>
			<isNotEmpty prepend=',' property='xgrq'>#xgrq#</isNotEmpty>
			<isNotEmpty prepend=',' property='bz'>#bz#</isNotEmpty>

		 </dynamic>  
	    <![CDATA[ 
	        ) 
	    ]]> 
	</insert>
	
	<!-- edit object  -->
	<update id="update_Sbcj" parameterClass="java.util.Map">
		update sbcj 
		<dynamic prepend="set ">   
			
			<isNotEmpty prepend=',' property='cjbh'>cjbh=#cjbh#</isNotEmpty>
			<isNotEmpty prepend=',' property='cjmc'>cjmc=#cjmc#</isNotEmpty>
			<isNotEmpty prepend=',' property='cjmm'>cjmm=#cjmm#</isNotEmpty>
			<isNotEmpty prepend=',' property='cjry'>cjry=#cjry#</isNotEmpty>
			<isNotEmpty prepend=',' property='cjrq'>cjrq=#cjrq#</isNotEmpty>
			<isNotEmpty prepend=',' property='xgry'>xgry=#xgry#</isNotEmpty>
			<isNotEmpty prepend=',' property='xgrq'>xgrq=#xgrq#</isNotEmpty>
			<isNotEmpty prepend=',' property='bz'>bz=#bz#</isNotEmpty>

		</dynamic>
		where xh = #XGTJxh#

			<isNotEmpty prepend='AND ' property='XGTJcjbh'> cjbh = #XGTJcjbh# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJcjmc'> cjmc = #XGTJcjmc# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJcjmm'> cjmm = #XGTJcjmm# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJcjry'> cjry = #XGTJcjry# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJcjrq'> cjrq = #XGTJcjrq# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJxgry'> xgry = #XGTJxgry# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJxgrq'> xgrq = #XGTJxgrq# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJbz'> bz = #XGTJbz# </isNotEmpty>

	</update>
	
	<!-- delete object -->
	<delete id="delete_Sbcj" parameterClass="java.util.Map">
		delete from sbcj 
		<include refid="condition_Sbcj"/>
	</delete>
	
	<!-- batch delete object -->
	<delete id="batch_delete_Sbcj" parameterClass="java.util.Map">
		delete from sbcj 
		where 1=1
			<isNotEmpty prepend='AND ' property='keyword'>
			key  in (#keyword#)
			</isNotEmpty>
	</delete>
	
	<!-- query objects by page-->
	<select id="query_Sbcj" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
			xh,cjbh,cjmc,cjmm,cjry,cjrq,xgry,xgrq,bz
		from sbcj 
		<include refid="condition_Sbcj"/>		
	</select>
	
	<!-- query objects totalcount -->
	<select id="count_Sbcj" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from sbcj 
		<include refid="condition_Sbcj"/>			
	</select>
	
	<!-- batch add objects -->
	<insert id="batch_insert_Sbcj" parameterClass="java.util.List">
	 	<![CDATA[
          INSERT
      	]]>
      	<iterate conjunction=" " > 
			into sbcj(
			 <![CDATA[ 
				xh,cjbh,cjmc,cjmm,cjry,cjrq,xgry,xgrq,bz
			)values
			 ]]>  		 
			 <![CDATA[ 
				(
				#list[].xh#,#list[].cjbh#,#list[].cjmc#,#list[].cjmm#,#list[].cjry#,#list[].cjrq#,#list[].xgry#,#list[].xgrq#,#list[].bz#
				)
			]]>    
    	</iterate> 
	</insert>
</sqlMap>











