<?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="Ptyhhmdlbean" type="cn.vp.XXX.model.PtyhhmdlBean"/> -->	<typeAlias alias="Ptyhhmdl" type="cn.bsystem.ptuserrole.PtyhhmdlBean"/>
	
	<sql id="condition_Ptyhhmdl">
		where 1=1
		<isNotEmpty prepend='AND' property='LIKEyhzh'>
			(yhzh like concat('%',#LIKEyhzh# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='yhzh'>
			(yhzh = #yhzh#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEyhmc'>
			(yhmc like concat('%',#LIKEyhmc# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='yhmc'>
			(yhmc = #yhmc# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEkhbh'>
			(khbh like concat('%',#LIKEkhbh# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='khbh'>
			(khbh = #khbh# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEzyhmsj'>
			(zyhmsj like concat('%',#LIKEzyhmsj# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='zyhmsj'>
			(zyhmsj = #zyhmsj# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEyyhmsj'>
			(yyhmsj like concat('%',#LIKEyyhmsj# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='yyhmsj'>
			(yyhmsj = #yyhmsj# )
		</isNotEmpty>
		<isNotEmpty property='tableparam'>
			$tableparam$
		</isNotEmpty>
		<isNotEmpty property='order'>
			$order$
		</isNotEmpty>
	</sql>
	
	<!-- add object -->
	<insert id="insert_Ptyhhmdl" parameterClass="java.util.Map">
		insert into 
		ptyhhmdl(
		<dynamic prepend=" ">  
			<isNotEmpty prepend=',' property='yhzh'>yhzh</isNotEmpty>
			<isNotEmpty prepend=',' property='yhmc'>yhmc</isNotEmpty>
			<isNotEmpty prepend=',' property='khbh'>khbh</isNotEmpty>
			<isNotEmpty prepend=',' property='zyhmsj'>zyhmsj</isNotEmpty>
			<isNotEmpty prepend=',' property='yyhmsj'>yyhmsj</isNotEmpty>

		</dynamic>  
	    <![CDATA[ 
	        ) values ( 
	    ]]>  
	     <dynamic prepend=" "> 
			<isNotEmpty prepend=',' property='yhzh'>#yhzh#</isNotEmpty>
			<isNotEmpty prepend=',' property='yhmc'>#yhmc#</isNotEmpty>
			<isNotEmpty prepend=',' property='khbh'>#khbh#</isNotEmpty>
			<isNotEmpty prepend=',' property='zyhmsj'>#zyhmsj:BLOB#</isNotEmpty>
			<isNotEmpty prepend=',' property='yyhmsj'>#yyhmsj:BLOB#</isNotEmpty>

		 </dynamic>  
	    <![CDATA[ 
	        ) 
	    ]]> 
	</insert>
	
	<!-- edit object  -->
	<update id="update_Ptyhhmdl" parameterClass="java.util.Map">
		update ptyhhmdl 
		<dynamic prepend="set ">   
			
			<isNotEmpty prepend=',' property='yhmc'>yhmc=#yhmc#</isNotEmpty>
			<isNotEmpty prepend=',' property='khbh'>khbh=#khbh#</isNotEmpty>
			<isNotEmpty prepend=',' property='zyhmsj'>zyhmsj=#zyhmsj#</isNotEmpty>
			<isNotEmpty prepend=',' property='yyhmsj'>yyhmsj=#yyhmsj#</isNotEmpty>

		</dynamic>
		where 1=1 
			<isNotEmpty prepend='AND' property='XGTJyhzh'> yhzh = #XGTJyhzh#</isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJyhmc'> yhmc = #XGTJyhmc# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJkhbh'> khbh = #XGTJkhbh# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJzyhmsj'> zyhmsj = #XGTJzyhmsj# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJyyhmsj'> yyhmsj = #XGTJyyhmsj# </isNotEmpty>

	</update>
	
	<!-- delete object -->
	<delete id="delete_Ptyhhmdl" parameterClass="java.util.Map">
		delete from ptyhhmdl 
		<include refid="condition_Ptyhhmdl"/>
	</delete>
	
	<!-- query objects by page-->
	<select id="query_Ptyhhmdl" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
			yhzh,yhmc,khbh,zyhmsj,yyhmsj
		from ptyhhmdl 
		<include refid="condition_Ptyhhmdl"/>
		<isNotEmpty prepend=' ' property='start'>
			limit #start# ,#limit#
		</isNotEmpty>
	</select>
	
	<!-- query objects totalcount -->
	<select id="count_Ptyhhmdl" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from ptyhhmdl 
		<include refid="condition_Ptyhhmdl"/>			
	</select>
	
</sqlMap>











