<?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="Ptlxccqzgl" >
<!-- 	<typeAlias alias="Ptlxccqzglbean" type="com.vp.XXX.model.PtlxccqzglBean"/> -->
	
	<sql id="condition_Ptlxccqzgl">
		where 1=1
		<isNotEmpty prepend='AND' property='LIKExh'>
			(xh like concat('%',#LIKExh# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='xh'>
			(xh = #xh#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEzxh'>
			(zxh like concat('%',#LIKEzxh# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='zxh'>
			(zxh = #zxh#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEccqbh'>
			(ccqbh like concat('%',#LIKEccqbh# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='ccqbh'>
			(ccqbh = #ccqbh#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEccqjb'>
			(ccqjb like concat('%',#LIKEccqjb# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='ccqjb'>
			(ccqjb = #ccqjb#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcjry'>
			(cjry like concat('%',#LIKEcjry# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='cjry'>
			(cjry = #cjry#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcjrq'>
			(cjrq like concat('%',#LIKEcjrq# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='cjrq'>
			(cjrq = #cjrq#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKExgry'>
			(xgry like concat('%',#LIKExgry# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='xgry'>
			(xgry = #xgry#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKExgrq'>
			(xgrq like concat('%',#LIKExgrq# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='xgrq'>
			(xgrq = #xgrq#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEbz'>
			(bz like concat('%',#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_Ptlxccqzgl" parameterClass="java.util.Map">
		insert into 
		Ptlxccqzgl(
		<dynamic prepend=" ">  
			<isNotEmpty prepend=',' property='xh'>xh</isNotEmpty>
<isNotEmpty prepend=',' property='zxh'>zxh</isNotEmpty>
<isNotEmpty prepend=',' property='ccqbh'>ccqbh</isNotEmpty>
<isNotEmpty prepend=',' property='ccqjb'>ccqjb</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='zxh'>#zxh#</isNotEmpty>
<isNotEmpty prepend=',' property='ccqbh'>#ccqbh#</isNotEmpty>
<isNotEmpty prepend=',' property='ccqjb'>#ccqjb#</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_Ptlxccqzgl" parameterClass="java.util.Map">
		update Ptlxccqzgl 
		<dynamic prepend="set ">   
			<isNotEmpty prepend=',' property='zxh'>zxh=#zxh#</isNotEmpty>
<isNotEmpty prepend=',' property='ccqbh'>ccqbh=#ccqbh#</isNotEmpty>
<isNotEmpty prepend=',' property='ccqjb'>ccqjb=#ccqjb#</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 1=1 
			<isNotEmpty  prepend='AND' property='xh'>
xh= #xh#
 </isNotEmpty>
<isNotEmpty prepend='AND' property='zxh'>
zxh= #zxh#
</isNotEmpty>
<isNotEmpty prepend='AND' property='ccqbh'>
ccqbh= #ccqbh#
</isNotEmpty>
<isNotEmpty prepend='AND' property='ccqjb'>
ccqjb= #ccqjb#
</isNotEmpty>
<isNotEmpty prepend='AND' property='cjry'>
cjry= #cjry#
</isNotEmpty>
<isNotEmpty prepend='AND' property='cjrq'>
cjrq= #cjrq#
</isNotEmpty>
<isNotEmpty prepend='AND' property='xgry'>
xgry= #xgry#
</isNotEmpty>
<isNotEmpty prepend='AND' property='xgrq'>
xgrq= #xgrq#
</isNotEmpty>
<isNotEmpty prepend='AND' property='bz'>
bz= #bz#
</isNotEmpty>

	</update>
	
	<!-- delete object -->
	<delete id="delete_Ptlxccqzgl" parameterClass="java.util.Map">
		delete from Ptlxccqzgl 
		<include refid="condition_Ptlxccqzgl"/>
	</delete>
	
	<!-- batch delete object -->
	<delete id="batch_delete_Ptlxccqzgl" parameterClass="java.util.Map">
		delete from Ptlxccqzgl 
		where 1=1
			<isNotEmpty prepend='AND' property='keyword'>
			key  in (#keyword#)
			</isNotEmpty>
	</delete>
	
	<!-- query objects by page-->
	<select id="query_Ptlxccqzgl" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
			a.xh,a.zxh,a.ccqbh,a.ccqjb,a.cjry,a.cjrq,a.xgry,a.xgrq,a.bz,b.csmc
		from Ptlxccqzgl a left join xtcl b on a.ccqjb = b.csdm and b.csdl='areaLevel'
		<include refid="condition_Ptlxccqzgl"/>
		<isNotEmpty prepend=' ' property='start'>
			limit #start# ,#limit#
		</isNotEmpty>
	</select>
	
	<!-- query objects totalcount -->
	<select id="count_Ptlxccqzgl" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from Ptlxccqzgl 
		<include refid="condition_Ptlxccqzgl"/>			
	</select>
	
	<!-- batch add objects -->
	<insert id="batch_insert_Ptlxccqzgl" parameterClass="java.util.List">
	 	<![CDATA[
          INSERT
      	]]>
      	<iterate conjunction=" " > 
			into Ptlxccqzgl(
			 <![CDATA[ 
				xh,zxh,ccqbh,ccqjb,cjry,cjrq,xgry,xgrq,bz
			)values
			 ]]>  		 
			 <![CDATA[ 
				(
			#list[].xh#
				)
			]]>    
    	</iterate> 
	</insert>
	
	<select id="query_ptlxccqzgl_no" resultClass="java.util.HashMap" parameterClass="java.util.Map">
			select 
				*
			from ptlxccq a
		 where 1=1 and
 		   NOT EXISTS (SELECT 1 FROM ptlxccqzgl b WHERE a.ccqbh = b.ccqbh  )
	</select>
</sqlMap>











