<?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="Trafficroadgridinfobean" type="cn.im.trafficdevice.model.TrafficroadgridinfoBean"/> 
 
 	<sql id="condition_Trafficroadgridinfo">
		where 1=1
		<isNotEmpty prepend='AND' property='LIKEroadGridId'>
			(roadGridId like '%$LIKEroadGridId$%'   )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='roadGridId'>
			(roadGridId = #roadGridId#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEroadNumber'>
			(roadNumber like '%$LIKEroadNumber$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='roadNumber'>
			(roadNumber = #roadNumber# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEroadName'>
			(roadName like '%$LIKEroadName$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='roadName'>
			(roadName = #roadName# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEvdid'>
			(vdid like '%$LIKEvdid$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='vdid'>
			(vdid = #vdid# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEchannelId'>
			(channelId like '%$LIKEchannelId$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='channelId'>
			(channelId = #channelId# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEchannelName'>
			(channelName like '%$LIKEchannelName$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='channelName'>
			(channelName = #channelName# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEroadGridPosition'>
			(roadGridPosition like '%$LIKEroadGridPosition$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='roadGridPosition'>
			(roadGridPosition = #roadGridPosition# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEroadGridPicture'>
			(roadGridPicture like '%$LIKEroadGridPicture$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='roadGridPicture'>
			(roadGridPicture = #roadGridPicture# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEremarks'>
			(remarks like '%$LIKEremarks$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='remarks'>
			(remarks = #remarks# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcreateAccount'>
			(createAccount like '%$LIKEcreateAccount$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='createAccount'>
			(createAccount = #createAccount# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEcreateTime'>
			(createTime like '%$LIKEcreateTime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='createTime'>
			(createTime = #createTime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEmodifyAccount'>
			(modifyAccount like '%$LIKEmodifyAccount$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='modifyAccount'>
			(modifyAccount = #modifyAccount# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEmodifyTime'>
			(modifyTime like '%$LIKEmodifyTime$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='modifyTime'>
			(modifyTime = #modifyTime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEremarks1'>
			(remarks1 like '%$LIKEremarks1$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='remarks1'>
			(remarks1 = #remarks1# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEremarks2'>
			(remarks2 like '%$LIKEremarks2$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='remarks2'>
			(remarks2 = #remarks2# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEremarks4'>
			(remarks4 like '%$LIKEremarks4$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='remarks4'>
			(remarks4 = #remarks4# )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='LIKEremarks3'>
			(remarks3 like '%$LIKEremarks3$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND' property='remarks3'>
			(remarks3 = #remarks3# )
		</isNotEmpty>
		<isNotEmpty property='tableparam'>
			$tableparam$
		</isNotEmpty>
		<isNotEmpty property='order'>
			$order$
		</isNotEmpty>
	</sql>
	
	<!-- add object -->
	<insert id="insert_Trafficroadgridinfo" parameterClass="java.util.Map">
		insert into 
		trafficroadgridinfo(
		<dynamic prepend=" ">  
			<isNotEmpty prepend=',' property='roadGridId'>roadGridId</isNotEmpty>
			<isNotEmpty prepend=',' property='roadNumber'>roadNumber</isNotEmpty>
			<isNotEmpty prepend=',' property='roadName'>roadName</isNotEmpty>
			<isNotEmpty prepend=',' property='vdid'>vdid</isNotEmpty>
			<isNotEmpty prepend=',' property='channelId'>channelId</isNotEmpty>
			<isNotEmpty prepend=',' property='channelName'>channelName</isNotEmpty>
			<isNotEmpty prepend=',' property='roadGridPosition'>roadGridPosition</isNotEmpty>
			<isNotEmpty prepend=',' property='roadGridPicture'>roadGridPicture</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks'>remarks</isNotEmpty>
			<isNotEmpty prepend=',' property='createAccount'>createAccount</isNotEmpty>
			<isNotEmpty prepend=',' property='createTime'>createTime</isNotEmpty>
			<isNotEmpty prepend=',' property='modifyAccount'>modifyAccount</isNotEmpty>
			<isNotEmpty prepend=',' property='modifyTime'>modifyTime</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks1'>remarks1</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks2'>remarks2</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks4'>remarks4</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks3'>remarks3</isNotEmpty>

		</dynamic>  
	    <![CDATA[ 
	        ) values ( 
	    ]]>  
	     <dynamic prepend=" "> 
			<isNotEmpty prepend=',' property='roadGridId'>#roadGridId#</isNotEmpty>
			<isNotEmpty prepend=',' property='roadNumber'>#roadNumber#</isNotEmpty>
			<isNotEmpty prepend=',' property='roadName'>#roadName#</isNotEmpty>
			<isNotEmpty prepend=',' property='vdid'>#vdid#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelId'>#channelId#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelName'>#channelName#</isNotEmpty>
			<isNotEmpty prepend=',' property='roadGridPosition'>#roadGridPosition#</isNotEmpty>
			<isNotEmpty prepend=',' property='roadGridPicture'>#roadGridPicture#</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks'>#remarks#</isNotEmpty>
			<isNotEmpty prepend=',' property='createAccount'>#createAccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='createTime'>#createTime#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifyAccount'>#modifyAccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifyTime'>#modifyTime#</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks1'>#remarks1#</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks2'>#remarks2#</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks4'>#remarks4#</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks3'>#remarks3#</isNotEmpty>

		 </dynamic>  
	    <![CDATA[ 
	        ) 
	    ]]> 
	</insert>
	
	<!-- edit object  -->
	<update id="update_Trafficroadgridinfo" parameterClass="java.util.Map">
		update trafficroadgridinfo 
		<dynamic prepend="set ">   
			
			<isNotEmpty prepend=',' property='roadNumber'>roadNumber=#roadNumber#</isNotEmpty>
			<isNotEmpty prepend=',' property='roadName'>roadName=#roadName#</isNotEmpty>
			<isNotEmpty prepend=',' property='vdid'>vdid=#vdid#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelId'>channelId=#channelId#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelName'>channelName=#channelName#</isNotEmpty>
			<isNotEmpty prepend=',' property='roadGridPosition'>roadGridPosition=#roadGridPosition#</isNotEmpty>
			<isNotEmpty prepend=',' property='roadGridPicture'>roadGridPicture=#roadGridPicture#</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks'>remarks=#remarks#</isNotEmpty>
			<isNotEmpty prepend=',' property='createAccount'>createAccount=#createAccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='createTime'>createTime=#createTime#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifyAccount'>modifyAccount=#modifyAccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifyTime'>modifyTime=#modifyTime#</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks1'>remarks1=#remarks1#</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks2'>remarks2=#remarks2#</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks4'>remarks4=#remarks4#</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks3'>remarks3=#remarks3#</isNotEmpty>

		</dynamic>
		where 1=1 
			<isNotEmpty prepend='AND' property='XGTJroadGridId'> roadGridId = #XGTJroadGridId#</isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJroadNumber'> roadNumber = #XGTJroadNumber# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJroadName'> roadName = #XGTJroadName# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJvdid'> vdid = #XGTJvdid# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJchannelId'> channelId = #XGTJchannelId# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJchannelName'> channelName = #XGTJchannelName# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJroadGridPosition'> roadGridPosition = #XGTJroadGridPosition# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJroadGridPicture'> roadGridPicture = #XGTJroadGridPicture# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJremarks'> remarks = #XGTJremarks# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJcreateAccount'> createAccount = #XGTJcreateAccount# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJcreateTime'> createTime = #XGTJcreateTime# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJmodifyAccount'> modifyAccount = #XGTJmodifyAccount# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJmodifyTime'> modifyTime = #XGTJmodifyTime# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJremarks1'> remarks1 = #XGTJremarks1# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJremarks2'> remarks2 = #XGTJremarks2# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJremarks4'> remarks4 = #XGTJremarks4# </isNotEmpty>
			<isNotEmpty prepend='AND' property='XGTJremarks3'> remarks3 = #XGTJremarks3# </isNotEmpty>

	</update>
	
	<!-- delete object -->
	<delete id="delete_Trafficroadgridinfo" parameterClass="java.util.Map">
		delete from trafficroadgridinfo 
		<include refid="condition_Trafficroadgridinfo"/>
	</delete>
	
	<!-- batch delete object -->
	<delete id="batch_delete_Trafficroadgridinfo" parameterClass="java.util.Map">
		delete from trafficroadgridinfo 
		where 1=1
			<isNotEmpty prepend='AND' property='keyword'>
			key  in (#keyword#)
			</isNotEmpty>
	</delete>
	
	<!-- query objects by page-->
	<select id="query_Trafficroadgridinfo" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select 
			roadGridId,roadNumber,roadName,vdid,channelId,channelName,roadGridPosition,roadGridPicture,remarks,createAccount,createTime,modifyAccount,modifyTime,remarks1,remarks2,remarks4,remarks3
		from trafficroadgridinfo 
		<include refid="condition_Trafficroadgridinfo"/>		
	</select>
	
	<!-- query objects totalcount -->
	<select id="count_Trafficroadgridinfo" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from trafficroadgridinfo 
		<include refid="condition_Trafficroadgridinfo"/>			
	</select>
	
	<!-- batch add objects -->
	<insert id="batch_insert_Trafficroadgridinfo" parameterClass="java.util.List">
	 	<![CDATA[
          INSERT
      	]]>
      	<iterate conjunction=" " > 
			into trafficroadgridinfo(
			 <![CDATA[ 
				roadGridId,roadNumber,roadName,vdid,channelId,channelName,roadGridPosition,roadGridPicture,remarks,createAccount,createTime,modifyAccount,modifyTime,remarks1,remarks2,remarks4,remarks3
			)values
			 ]]>  		 
			 <![CDATA[ 
				(
				#list[].roadGridId#,#list[].roadNumber#,#list[].roadName#,#list[].vdid#,#list[].channelId#,#list[].channelName#,#list[].roadGridPosition#,#list[].roadGridPicture#,#list[].remarks#,#list[].createAccount#,#list[].createTime#,#list[].modifyAccount#,#list[].modifyTime#,#list[].remarks1#,#list[].remarks2#,#list[].remarks4#,#list[].remarks3#
				)
			]]>    
    	</iterate> 
	</insert>
	
	<!-- <select id="getPreRoad" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select a.*,b.xh as vId from trafficroadgridinfo a left join sbtdspsr b 
		on a.vdid=b.sbbh and a.channelId = b.tdbh
	</select> -->
	
	
	<!-- select a.roadGridId,a.remarks1,a.roadName,b.roadId,b.roadNumber,standardName,upDirection,downDirection,
		startPile,endPile from trafficroadgridinfo a, trafficroadinfo b 
		where a.roadNumber = b.roadId and a.roadGridId=#roadGridId# -->
	<select id="get_TrafficroadgridinfoById" resultClass="java.util.HashMap" parameterClass="java.util.Map">		
		select a.roadGridId,a.remarks1,a.roadName,a.roadGridPosition,a.createTime,b.tdmc,c.upDirection,
		c.downDirection from trafficroadgridinfo a, sbtdspsr b, trafficroadinfo c
		where a.vdid = b.sbbh and a.channelId = b.tdbh and a.roadNumber = c.roadId and a.roadGridId=#roadGridId#
	</select>
	
</sqlMap>











