<?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="Ptxzs">
	<!-- <typeAlias alias="Ptxzsbean" type="com.vp.XXX.model.PtxzsBean"/> -->
	<typeAlias alias="ptxzsNode" type="cn.im.ptxztree.model.PtxzsNode"/>

	<sql id="condition_Ptxzs">
		where 1=1
		<isNotEmpty prepend='AND ' property='LIKExzbh'>
			(xzbh like '%$LIKExzbh$%')
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='xzbh'>
			(xzbh = #xzbh# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKExzmc'>
			(xzmc like '%$LIKExzmc$%')
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='xzmc'>
			(xzmc = #xzmc# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKExzmcpy'>
			(xzmcpy like '%$LIKExzmcpy$%')
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='xzmcpy'>
			(xzmcpy = #xzmcpy# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEsjxzbh'>
			(sjxzbh like '%$LIKEsjxzbh$%')
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='sjxzbh'>
			(sjxzbh = #sjxzbh# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEqlj'>
			(qlj like '%$LIKEqlj$%')
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='qlj'>
			(qlj = #qlj# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEwbbh'>
			(wbbh like '%$LIKEwbbh$%')
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='wbbh'>
			(wbbh = #wbbh# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEsm'>
			(sm like '%$LIKEsm$%')
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='sm'>
			(sm = #sm# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEjdpx'>
			(jdpx like '%$LIKEjdpx$%')
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='jdpx'>
			(jdpx = #jdpx# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEkhbh'>
			(khbh like '%$LIKEkhbh$%')
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='khbh'>
			(khbh = #khbh# )
		</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='LIKEkz1'>
			(kz1 like '%$LIKEkz1$%')
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='kz1'>
			(kz1 = #kz1# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEkz2'>
			(kz2 like '%$LIKEkz2$%')
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='kz2'>
			(kz2 = #kz2# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEkz3'>
			(kz3 like '%$LIKEkz3$%')
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='kz3'>
			(kz3 = #kz3# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEkz4'>
			(kz4 like '%$LIKEkz4$%')
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='kz4'>
			(kz4 = #kz4# )
		</isNotEmpty>
		<isNotEmpty property='tableparam'>
			$tableparam$
		</isNotEmpty>
		<isNotEmpty property='order'>
			$order$
		</isNotEmpty>
	</sql>

	<!-- ???? -->
	<insert id="insert_Ptxzs" parameterClass="java.util.Map">
		insert into
		Ptxzs(
		<dynamic prepend=" ">
			<isNotEmpty prepend=',' property='xzbh'>xzbh</isNotEmpty>
			<isNotEmpty prepend=',' property='xzmc'>xzmc</isNotEmpty>
			<isNotEmpty prepend=',' property='xzmcpy'>xzmcpy</isNotEmpty>
			<isNotEmpty prepend=',' property='sjxzbh'>sjxzbh</isNotEmpty>
			<isNotEmpty prepend=',' property='qlj'>qlj</isNotEmpty>
			<isNotEmpty prepend=',' property='wbbh'>wbbh</isNotEmpty>
			<isNotEmpty prepend=',' property='sm'>sm</isNotEmpty>
			<isNotEmpty prepend=',' property='jdpx'>jdpx</isNotEmpty>
			<isNotEmpty prepend=',' property='khbh'>khbh</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='kz1'>kz1</isNotEmpty>
			<isNotEmpty prepend=',' property='kz2'>kz2</isNotEmpty>
			<isNotEmpty prepend=',' property='kz3'>kz3</isNotEmpty>
			<isNotEmpty prepend=',' property='kz4'>kz4</isNotEmpty>

		</dynamic>  
	    <![CDATA[ 
	        ) values ( 
	    ]]>
		<dynamic prepend=" ">
			<isNotEmpty prepend=',' property='xzbh'>#xzbh#</isNotEmpty>
			<isNotEmpty prepend=',' property='xzmc'>#xzmc#</isNotEmpty>
			<isNotEmpty prepend=',' property='xzmcpy'>#xzmcpy#</isNotEmpty>
			<isNotEmpty prepend=',' property='sjxzbh'>#sjxzbh#</isNotEmpty>
			<isNotEmpty prepend=',' property='qlj'>#qlj#</isNotEmpty>
			<isNotEmpty prepend=',' property='wbbh'>#wbbh#</isNotEmpty>
			<isNotEmpty prepend=',' property='sm'>#sm#</isNotEmpty>
			<isNotEmpty prepend=',' property='jdpx'>#jdpx#</isNotEmpty>
			<isNotEmpty prepend=',' property='khbh'>#khbh#</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='kz1'>#kz1#</isNotEmpty>
			<isNotEmpty prepend=',' property='kz2'>#kz2#</isNotEmpty>
			<isNotEmpty prepend=',' property='kz3'>#kz3#</isNotEmpty>
			<isNotEmpty prepend=',' property='kz4'>#kz4#</isNotEmpty>

		</dynamic>  
	    <![CDATA[ 
	        ) 
	    ]]>
	</insert>

	<!-- ??? -->
	<update id="update_Ptxzs" parameterClass="java.util.Map">
		update Ptxzs
		<dynamic prepend="set ">
			<isNotEmpty prepend=',' property='xzmc'>xzmc=#xzmc#</isNotEmpty>
			<isNotEmpty prepend=',' property='xzmcpy'>xzmcpy=#xzmcpy#</isNotEmpty>
			<isNotEmpty prepend=',' property='sjxzbh'>sjxzbh=#sjxzbh#</isNotEmpty>
			<isNotEmpty prepend=',' property='qlj'>qlj=#qlj#</isNotEmpty>
			<isNotEmpty prepend=',' property='wbbh'>wbbh=#wbbh#</isNotEmpty>
			<isNotEmpty prepend=',' property='sm'>sm=#sm#</isNotEmpty>
			<isNotEmpty prepend=',' property='jdpx'>jdpx=#jdpx#</isNotEmpty>
			<isNotEmpty prepend=',' property='khbh'>khbh=#khbh#</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='kz1'>kz1=#kz1#</isNotEmpty>
			<isNotEmpty prepend=',' property='kz2'>kz2=#kz2#</isNotEmpty>
			<isNotEmpty prepend=',' property='kz3'>kz3=#kz3#</isNotEmpty>
			<isNotEmpty prepend=',' property='kz4'>kz4=#kz4#</isNotEmpty>
		</dynamic>
		where xzbh= #xzbh#
	</update>

	<!-- ??? -->
	<delete id="delete_Ptxzs" parameterClass="java.util.Map">
		delete from Ptxzs
		<include refid="condition_Ptxzs" />
	</delete>

	<!-- ??????? -->
	<delete id="batch_delete_Ptxzs" parameterClass="java.util.Map">
		delete from Ptxzs
		where 1=1
		<isNotEmpty prepend='AND ' property='keyword'>
			key in (#keyword#)
		</isNotEmpty>videoCurrentStateStatistics
	</delete>

	<!-- ??? -->
	<select id="query_Ptxzs" resultClass="java.util.HashMap"
		parameterClass="java.util.Map">
		select	xzbh,xzmc,xzmcpy,sjxzbh,qlj,wbbh,sm,jdpx,khbh,cjry,cjrq,xgry,xgrq,kz1,kz2,kz3,kz4
		from Ptxzs
		<include refid="condition_Ptxzs" />
		start with sjxzbh='-1'  connect by    sjxzbh =prior  xzbh
	</select>


	<!--resultClass="java.util.HashMap"-->

	<select id="query_PtxzsTree" resultClass="java.util.HashMap"	parameterClass="java.util.Map">
		select     xzbh  id ,xzmc  name ,sjxzbh pid  from Ptxzs   start with sjxzbh='-1'  connect by    sjxzbh =prior  xzbh
	</select>
	<!-- ??????? -->
	<select id="count_Ptxzs" resultClass="java.lang.Integer"
		parameterClass="java.util.Map">
		select count(*) from Ptxzs
		<include refid="condition_Ptxzs" />
	</select>

	<!-- ???????? -->
	<insert id="batch_insert_Ptxzs" parameterClass="java.util.List">
	 	<![CDATA[
          INSERT
      	]]>
		<iterate conjunction=" ">
			into Ptxzs(
			 <![CDATA[ 
				xzbh,xzmc,xzmcpy,sjxzbh,qlj,wbbh,sm,jdpx,khbh,cjry,cjrq,xgry,xgrq,kz1,kz2,kz3,kz4
			)values
			 ]]>  		 
			 <![CDATA[ 
				(
			#list[].xzbh#
				)
			]]>
		</iterate>
	</insert>

	<select id="queryAllPtxzs" resultClass="java.util.HashMap"	parameterClass="java.util.Map">
		select count(*) from Ptxzs
		<include refid="condition_Ptxzs" />
	</select>


</sqlMap>











