<?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="Xtbbxxbean" type="cn.vp.XXX.model.XtbbxxBean"/> -->	<typeAlias alias="Xtbbxx" type="cn.bsystem.ptconst.XtbbxxBean"/>
	
	<sql id="condition_Xtbbxx">
		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='LIKEyycxbh'>
			(yycxbh like concat('%',#LIKEyycxbh# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='yycxbh'>
			(yycxbh = #yycxbh# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEbbbh'>
			(bbbh like concat('%',#LIKEbbbh# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='bbbh'>
			(bbbh = #bbbh# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEbbmc'>
			(bbmc like concat('%',#LIKEbbmc# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='bbmc'>
			(bbmc = #bbmc# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKExzdz'>
			(xzdz like concat('%',#LIKExzdz# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='xzdz'>
			(xzdz = #xzdz# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEgxsm'>
			(gxsm like concat('%',#LIKEgxsm# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='gxsm'>
			(gxsm = #gxsm# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEsffb'>
			(sffb like concat('%',#LIKEsffb# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='sffb'>
			(sffb = #sffb# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEfbsj'>
			(fbsj like concat('%',#LIKEfbsj# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='fbsj'>
			(fbsj = #fbsj# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEpx'>
			(px like concat('%',#LIKEpx# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='px'>
			(px = #px# )
		</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_Xtbbxx" parameterClass="java.util.Map">
		insert into 
		xtbbxx(
		<dynamic prepend=" ">  
			<isNotEmpty prepend=',' property='xh'>xh</isNotEmpty>
			<isNotEmpty prepend=',' property='yycxbh'>yycxbh</isNotEmpty>
			<isNotEmpty prepend=',' property='bbbh'>bbbh</isNotEmpty>
			<isNotEmpty prepend=',' property='bbmc'>bbmc</isNotEmpty>
			<isNotEmpty prepend=',' property='xzdz'>xzdz</isNotEmpty>
			<isNotEmpty prepend=',' property='gxsm'>gxsm</isNotEmpty>
			<isNotEmpty prepend=',' property='sffb'>sffb</isNotEmpty>
			<isNotEmpty prepend=',' property='fbsj'>fbsj</isNotEmpty>
			<isNotEmpty prepend=',' property='px'>px</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='yycxbh'>#yycxbh#</isNotEmpty>
			<isNotEmpty prepend=',' property='bbbh'>#bbbh#</isNotEmpty>
			<isNotEmpty prepend=',' property='bbmc'>#bbmc#</isNotEmpty>
			<isNotEmpty prepend=',' property='xzdz'>#xzdz#</isNotEmpty>
			<isNotEmpty prepend=',' property='gxsm'>#gxsm#</isNotEmpty>
			<isNotEmpty prepend=',' property='sffb'>#sffb#</isNotEmpty>
			<isNotEmpty prepend=',' property='fbsj'>#fbsj#</isNotEmpty>
			<isNotEmpty prepend=',' property='px'>#px#</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_Xtbbxx" parameterClass="java.util.Map">
		update xtbbxx 
		<dynamic prepend="set ">   
			
			<isNotEmpty prepend=',' property='yycxbh'>yycxbh=#yycxbh#</isNotEmpty>
			<isNotEmpty prepend=',' property='bbbh'>bbbh=#bbbh#</isNotEmpty>
			<isNotEmpty prepend=',' property='bbmc'>bbmc=#bbmc#</isNotEmpty>
			<isNotEmpty prepend=',' property='xzdz'>xzdz=#xzdz#</isNotEmpty>
			<isNotEmpty prepend=',' property='gxsm'>gxsm=#gxsm#</isNotEmpty>
			<isNotEmpty prepend=',' property='sffb'>sffb=#sffb#</isNotEmpty>
			<isNotEmpty prepend=',' property='fbsj'>fbsj=#fbsj#</isNotEmpty>
			<isNotEmpty prepend=',' property='px'>px=#px#</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='XGTJxh'> xh = #XGTJxh#</isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJyycxbh'> yycxbh = #XGTJyycxbh# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJbbbh'> bbbh = #XGTJbbbh# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJbbmc'> bbmc = #XGTJbbmc# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJxzdz'> xzdz = #XGTJxzdz# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJgxsm'> gxsm = #XGTJgxsm# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJsffb'> sffb = #XGTJsffb# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJfbsj'> fbsj = #XGTJfbsj# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJpx'> px = #XGTJpx# </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_Xtbbxx" parameterClass="java.util.Map">
		delete from xtbbxx 
		<include refid="condition_Xtbbxx"/>
	</delete>
	
	<!-- query objects by page-->
	<select id="query_Xtbbxx" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select a.*,b.csmc as yycxmc,c.csmc as sffbmc from(
			select 
				xh,yycxbh,bbbh,bbmc,xzdz,gxsm,sffb,fbsj,px,cjry,cjrq,xgry,xgrq,bz
			from xtbbxx 
			<include refid="condition_Xtbbxx"/>
		)a 
		left join xtcl b on a.yycxbh =  b.csdm AND b.csdl = 'appCode'
		left join xtcl c on a.sffb =  c.csdm AND c.csdl = 'enable'
		<include refid="condition_Xtbbxx"/>		
		<isNotEmpty prepend=' ' property='start'>
			limit #start# ,#limit#
		</isNotEmpty>
	</select>
	
	<!-- query objects totalcount -->
	<select id="count_Xtbbxx" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from xtbbxx 
		<include refid="condition_Xtbbxx"/>			
	</select>
	
</sqlMap>











