<?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="Ptdlfw" >
<!-- 	<typeAlias alias="Ptdlfwbean" type="com.vp.XXX.model.PtdlfwBean"/> -->
	
	<sql id="condition_Ptdlfw">
		where 1=1
		<isNotEmpty prepend='AND' property='LIKEfwbh'>
			(fwbh like concat('%',#LIKEfwbh# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='fwbh'>
			(fwbh = #fwbh#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEfwmc'>
			(fwmc like concat('%',#LIKEfwmc# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='fwmc'>
			(fwmc = #fwmc#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEfwqip'>
			(fwqip like concat('%',#LIKEfwqip# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='fwqip'>
			(fwqip = #fwqip#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcjbh'>
			(cjbh like concat('%',#LIKEcjbh# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='cjbh'>
			(cjbh = #cjbh#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEfwqdk'>
			(fwqdk like concat('%',#LIKEfwqdk# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='fwqdk'>
			(fwqdk = #fwqdk#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEzxh'>
			(zxh like concat('%',#LIKEzxh# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='zxh'>
			(zxh = #zxh#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEfwqjs'>
			(fwqjs like concat('%',#LIKEfwqjs# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='fwqjs'>
			(fwqjs = #fwqjs#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEfzjf'>
			(fzjf like concat('%',#LIKEfzjf# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='fzjf'>
			(fzjf = #fzjf#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEzddlls'>
			(zddlls like concat('%',#LIKEzddlls# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='zddlls'>
			(zddlls = #zddlls#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEdqdlls'>
			(dqdlls like concat('%',#LIKEdqdlls# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='dqdlls'>
			(dqdlls = #dqdlls#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEdllx'>
			(dllx like concat('%',#LIKEdllx# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='dllx'>
			(dllx = #dllx#  )
		</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_Ptdlfw" parameterClass="java.util.Map">
		insert into 
		Ptdlfw(
		<dynamic prepend=" ">  
			<isNotEmpty prepend=',' property='fwbh'>fwbh</isNotEmpty>
<isNotEmpty prepend=',' property='fwmc'>fwmc</isNotEmpty>
<isNotEmpty prepend=',' property='fwqip'>fwqip</isNotEmpty>
<isNotEmpty prepend=',' property='cjbh'>cjbh</isNotEmpty>
<isNotEmpty prepend=',' property='fwqdk'>fwqdk</isNotEmpty>
<isNotEmpty prepend=',' property='zxh'>zxh</isNotEmpty>
<isNotEmpty prepend=',' property='fwqjs'>fwqjs</isNotEmpty>
<isNotEmpty prepend=',' property='fzjf'>fzjf</isNotEmpty>
<isNotEmpty prepend=',' property='zddlls'>zddlls</isNotEmpty>
<isNotEmpty prepend=',' property='dqdlls'>dqdlls</isNotEmpty>
<isNotEmpty prepend=',' property='dllx'>dllx</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='fwbh'>#fwbh#</isNotEmpty>
<isNotEmpty prepend=',' property='fwmc'>#fwmc#</isNotEmpty>
<isNotEmpty prepend=',' property='fwqip'>#fwqip#</isNotEmpty>
<isNotEmpty prepend=',' property='cjbh'>#cjbh#</isNotEmpty>
<isNotEmpty prepend=',' property='fwqdk'>#fwqdk#</isNotEmpty>
<isNotEmpty prepend=',' property='zxh'>#zxh#</isNotEmpty>
<isNotEmpty prepend=',' property='fwqjs'>#fwqjs#</isNotEmpty>
<isNotEmpty prepend=',' property='fzjf'>#fzjf#</isNotEmpty>
<isNotEmpty prepend=',' property='zddlls'>#zddlls#</isNotEmpty>
<isNotEmpty prepend=',' property='dqdlls'>#dqdlls#</isNotEmpty>
<isNotEmpty prepend=',' property='dllx'>#dllx#</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_Ptdlfw" parameterClass="java.util.Map">
		update Ptdlfw 
		<dynamic prepend="set ">   
			<isNotEmpty prepend=',' property='fwmc'>fwmc=#fwmc#</isNotEmpty>
<isNotEmpty prepend=',' property='fwqip'>fwqip=#fwqip#</isNotEmpty>
<isNotEmpty prepend=',' property='cjbh'>cjbh=#cjbh#</isNotEmpty>
<isNotEmpty prepend=',' property='fwqdk'>fwqdk=#fwqdk#</isNotEmpty>
<isNotEmpty prepend=',' property='zxh'>zxh=#zxh#</isNotEmpty>
<isNotEmpty prepend=',' property='fwqjs'>fwqjs=#fwqjs#</isNotEmpty>
<isNotEmpty prepend=',' property='fzjf'>fzjf=#fzjf#</isNotEmpty>
<isNotEmpty prepend=',' property='zddlls'>zddlls=#zddlls#</isNotEmpty>
<isNotEmpty prepend=',' property='dqdlls'>dqdlls=#dqdlls#</isNotEmpty>
<isNotEmpty prepend=',' property='dllx'>dllx=#dllx#</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='XGTJfwbh'>
fwbh= #XGTJfwbh#
 </isNotEmpty>
	</update>
	
	<!-- delete object -->
	<delete id="delete_Ptdlfw" parameterClass="java.util.Map">
		delete from Ptdlfw 
		<include refid="condition_Ptdlfw"/>
	</delete>
	
	<!-- batch delete object -->
	<delete id="batch_delete_Ptdlfw" parameterClass="java.util.Map">
		delete from Ptdlfw 
		where 1=1
			<isNotEmpty prepend='AND' property='keyword'>
			key  in (#keyword#)
			</isNotEmpty>
	</delete>
	
	<!-- query objects by page-->
	<select id="query_Ptdlfw" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
			a.fwbh,a.fwmc,a.fwqip,a.cjbh,a.fwqdk,a.zxh,a.fwqjs,a.fzjf,a.zddlls,a.dqdlls,a.dllx,a.cjry,a.cjrq,a.xgry,a.xgrq,a.bz,
			b.cjmc,c.csmc,c.csdm from Ptdlfw a 
		left join sbcj b on a.cjbh = cast(b.cjbh as SIGNED INTEGER)
		left join xtcl c on a.dllx = c.csdm and c.csdl = 'agentType'
		<include refid="condition_Ptdlfw"/>
		<isNotEmpty prepend=' ' property='start'>
			limit #start# ,#limit#
		</isNotEmpty>
	</select>
	
	<!-- query objects totalcount -->
	<select id="count_Ptdlfw" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from (
			select 
			a.fwbh,a.fwmc,a.fwqip,a.cjbh,a.fwqdk,a.zxh,a.fwqjs,a.fzjf,a.zddlls,a.dqdlls,a.dllx,a.cjry,a.cjrq,a.xgry,a.xgrq,a.bz,
			b.cjmc,c.csmc,c.csdm	from Ptdlfw a 
		left join sbcj b on a.cjbh = cast(b.cjbh as SIGNED INTEGER)
		left join xtcl c on a.dllx = c.csdm and c.csdl = 'agentType'
		<include refid="condition_Ptdlfw"/>
		) d
	</select>
	
	<!-- batch add objects -->
	<insert id="batch_insert_Ptdlfw" parameterClass="java.util.List">
	 	<![CDATA[
          INSERT
      	]]>
      	<iterate conjunction=" " > 
			into Ptdlfw(
			 <![CDATA[ 
				fwbh,fwmc,fwqip,cjbh,fwqdk,zxh,fwqjs,fzjf,zddlls,dqdlls,dllx,cjry,cjrq,xgry,xgrq,bz
			)values
			 ]]>  		 
			 <![CDATA[ 
				(
			#list[].fwbh#
				)
			]]>    
    	</iterate> 
	</insert>
</sqlMap>











