<?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="Trafficaccidentinfobean" type="cn.vp.XXX.model.TrafficaccidentinfoBean"/> -->	
    <typeAlias alias="Trafficaccidentinfo" type="cn.im.trafficalarm.model.TrafficaccidentinfoBean"/> 
	
	<sql id="condition_Trafficaccidentinfo">
		where 1=1
		<isNotEmpty prepend='AND ' property='LIKEaccidentId'>
			(accidentId like concat('%',#LIKEaccidentId# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='accidentId'>
			(accidentId = #accidentId#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEaccidentState'>
			(accidentState like concat('%',#LIKEaccidentState# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='accidentState'>
			(accidentState = #accidentState# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEdeviceId'>
			(deviceId like concat('%',#LIKEdeviceId# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='deviceId'>
			(deviceId = #deviceId# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEdeviceType'>
			(deviceType like concat('%',#LIKEdeviceType# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='deviceType'>
			(deviceType = #deviceType# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEregionId'>
			(regionId like concat('%',#LIKEregionId# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='regionId'>
			(regionId = #regionId# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKElocationDesc'>
			(locationDesc like concat('%',#LIKElocationDesc# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='locationDesc'>
			(locationDesc = #locationDesc# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKElocationId'>
			(locationId like concat('%',#LIKElocationId# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='locationId'>
			(locationId = #locationId# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEdirection'>
			(direction like concat('%',#LIKEdirection# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='direction'>
			(direction = #direction# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEeventId'>
			(eventId like concat('%',#LIKEeventId# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='eventId'>
			(eventId = #eventId# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEeventSource'>
			(eventSource like concat('%',#LIKEeventSource# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='eventSource'>
			(eventSource = #eventSource# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEeventType'>
			(eventType like concat('%',#LIKEeventType# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='eventType'>
			(eventType = #eventType# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEoccurTime'>
			(occurTime like concat('%',#LIKEoccurTime# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='occurTime'>
			(occurTime = #occurTime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEoccurAddress'>
			(occurAddress like concat('%',#LIKEoccurAddress# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='occurAddress'>
			(occurAddress = #occurAddress# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEadminDivision'>
			(adminDivision like concat('%',#LIKEadminDivision# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='adminDivision'>
			(adminDivision = #adminDivision# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEalarmListId'>
			(alarmListId like concat('%',#LIKEalarmListId# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='alarmListId'>
			(alarmListId = #alarmListId# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEalarmTime'>
			(alarmTime like concat('%',#LIKEalarmTime# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='alarmTime'>
			(alarmTime = #alarmTime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEalarmPhone'>
			(alarmPhone like concat('%',#LIKEalarmPhone# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='alarmPhone'>
			(alarmPhone = #alarmPhone# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEalarmPerson'>
			(alarmPerson like concat('%',#LIKEalarmPerson# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='alarmPerson'>
			(alarmPerson = #alarmPerson# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEalarmLevel'>
			(alarmLevel like concat('%',#LIKEalarmLevel# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='alarmLevel'>
			(alarmLevel = #alarmLevel# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEalarmContent'>
			(alarmContent like concat('%',#LIKEalarmContent# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='alarmContent'>
			(alarmContent = #alarmContent# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEeventUrl'>
			(eventUrl like concat('%',#LIKEeventUrl# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='eventUrl'>
			(eventUrl = #eventUrl# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEeventSmallUrl'>
			(eventSmallUrl like concat('%',#LIKEeventSmallUrl# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='eventSmallUrl'>
			(eventSmallUrl = #eventSmallUrl# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEeventBigUrl'>
			(eventBigUrl like concat('%',#LIKEeventBigUrl# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='eventBigUrl'>
			(eventBigUrl = #eventBigUrl# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKElongitude'>
			(longitude like concat('%',#LIKElongitude# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='longitude'>
			(longitude = #longitude# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKElatitude'>
			(latitude like concat('%',#LIKElatitude# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='latitude'>
			(latitude = #latitude# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEvdId'>
			(vdId like concat('%',#LIKEvdId# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='vdId'>
			(vdId = #vdId# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEchannelId'>
			(channelId like concat('%',#LIKEchannelId# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='channelId'>
			(channelId = #channelId# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEplanID'>
			(planID like concat('%',#LIKEplanID# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='planID'>
			(planID = #planID# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEconfirmAccount'>
			(confirmAccount like concat('%',#LIKEconfirmAccount# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='confirmAccount'>
			(confirmAccount = #confirmAccount# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEconfirmTime'>
			(confirmTime like concat('%',#LIKEconfirmTime# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='confirmTime'>
			(confirmTime = #confirmTime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEcreateAccount'>
			(createAccount like concat('%',#LIKEcreateAccount# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='createAccount'>
			(createAccount = #createAccount# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEcreateTime'>
			(createTime like concat('%',#LIKEcreateTime# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='createTime'>
			(createTime = #createTime# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEmodifyAccount'>
			(modifyAccount like concat('%',#LIKEmodifyAccount# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='modifyAccount'>
			(modifyAccount = #modifyAccount# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEmodifyTime'>
			(modifyTime like concat('%',#LIKEmodifyTime# ,'%')   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='modifyTime'>
			(modifyTime = #modifyTime# )
		</isNotEmpty>
		
		<!-- 增加时间查询 -->
		<isNotEmpty prepend='AND ' property='time_start'>
			(alarmTime >= #time_start# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='time_end'>
			(alarmTime &lt;= #time_end# )
		</isNotEmpty>
		<isNotEmpty property='tableparam'>
			$tableparam$
		</isNotEmpty>
		<isNotEmpty property='order'>
			$order$
		</isNotEmpty>
	</sql>
	
	<!-- add object -->
	<insert id="insert_Trafficaccidentinfo" parameterClass="Trafficaccidentinfo">
		insert into 
		trafficaccidentinfo(
		<dynamic prepend=" ">  
			<isNotEmpty prepend=',' property='accidentId'>accidentId</isNotEmpty>
			<isNotEmpty prepend=',' property='accidentState'>accidentState</isNotEmpty>
			<isNotEmpty prepend=',' property='deviceId'>deviceId</isNotEmpty>
			<isNotEmpty prepend=',' property='deviceType'>deviceType</isNotEmpty>
			<isNotEmpty prepend=',' property='regionId'>regionId</isNotEmpty>
			<isNotEmpty prepend=',' property='locationDesc'>locationDesc</isNotEmpty>
			<isNotEmpty prepend=',' property='locationId'>locationId</isNotEmpty>
			<isNotEmpty prepend=',' property='direction'>direction</isNotEmpty>
			<isNotEmpty prepend=',' property='eventId'>eventId</isNotEmpty>
			<isNotEmpty prepend=',' property='eventSource'>eventSource</isNotEmpty>
			<isNotEmpty prepend=',' property='eventType'>eventType</isNotEmpty>
			<isNotEmpty prepend=',' property='occurTime'>occurTime</isNotEmpty>
			<isNotEmpty prepend=',' property='occurAddress'>occurAddress</isNotEmpty>
			<isNotEmpty prepend=',' property='adminDivision'>adminDivision</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmListId'>alarmListId</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmTime'>alarmTime</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmPhone'>alarmPhone</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmPerson'>alarmPerson</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmLevel'>alarmLevel</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmContent'>alarmContent</isNotEmpty>
			<isNotEmpty prepend=',' property='eventUrl'>eventUrl</isNotEmpty>
			<isNotEmpty prepend=',' property='eventSmallUrl'>eventSmallUrl</isNotEmpty>
			<isNotEmpty prepend=',' property='eventBigUrl'>eventBigUrl</isNotEmpty>
			<isNotEmpty prepend=',' property='longitude'>longitude</isNotEmpty>
			<isNotEmpty prepend=',' property='latitude'>latitude</isNotEmpty>
			<isNotEmpty prepend=',' property='vdId'>vdId</isNotEmpty>
			<isNotEmpty prepend=',' property='channelId'>channelId</isNotEmpty>
			<isNotEmpty prepend=',' property='planID'>planID</isNotEmpty>
			<isNotEmpty prepend=',' property='confirmAccount'>confirmAccount</isNotEmpty>
			<isNotEmpty prepend=',' property='confirmTime'>confirmTime</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>

		</dynamic>  
	    <![CDATA[ 
	        ) values ( 
	    ]]>  
	     <dynamic prepend=" "> 
			<isNotEmpty prepend=',' property='accidentId'>#accidentId#</isNotEmpty>
			<isNotEmpty prepend=',' property='accidentState'>#accidentState#</isNotEmpty>
			<isNotEmpty prepend=',' property='deviceId'>#deviceId#</isNotEmpty>
			<isNotEmpty prepend=',' property='deviceType'>#deviceType#</isNotEmpty>
			<isNotEmpty prepend=',' property='regionId'>#regionId#</isNotEmpty>
			<isNotEmpty prepend=',' property='locationDesc'>#locationDesc#</isNotEmpty>
			<isNotEmpty prepend=',' property='locationId'>#locationId#</isNotEmpty>
			<isNotEmpty prepend=',' property='direction'>#direction#</isNotEmpty>
			<isNotEmpty prepend=',' property='eventId'>#eventId#</isNotEmpty>
			<isNotEmpty prepend=',' property='eventSource'>#eventSource#</isNotEmpty>
			<isNotEmpty prepend=',' property='eventType'>#eventType#</isNotEmpty>
			<isNotEmpty prepend=',' property='occurTime'>#occurTime#</isNotEmpty>
			<isNotEmpty prepend=',' property='occurAddress'>#occurAddress#</isNotEmpty>
			<isNotEmpty prepend=',' property='adminDivision'>#adminDivision#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmListId'>#alarmListId#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmTime'>#alarmTime#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmPhone'>#alarmPhone#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmPerson'>#alarmPerson#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmLevel'>#alarmLevel#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmContent'>#alarmContent#</isNotEmpty>
			<isNotEmpty prepend=',' property='eventUrl'>#eventUrl#</isNotEmpty>
			<isNotEmpty prepend=',' property='eventSmallUrl'>#eventSmallUrl#</isNotEmpty>
			<isNotEmpty prepend=',' property='eventBigUrl'>#eventBigUrl#</isNotEmpty>
			<isNotEmpty prepend=',' property='longitude'>#longitude#</isNotEmpty>
			<isNotEmpty prepend=',' property='latitude'>#latitude#</isNotEmpty>
			<isNotEmpty prepend=',' property='vdId'>#vdId#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelId'>#channelId#</isNotEmpty>
			<isNotEmpty prepend=',' property='planID'>#planID#</isNotEmpty>
			<isNotEmpty prepend=',' property='confirmAccount'>#confirmAccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='confirmTime'>#confirmTime#</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>

		 </dynamic>  
	    <![CDATA[ 
	        ) 
	    ]]> 
	</insert>
	
	<!-- insert map -->
	<insert id="insert_Trafficaccidentinfo_map" parameterClass="java.util.Map">
		insert into 
		trafficaccidentinfo(
		<dynamic prepend=" ">  
			<isNotEmpty prepend=',' property='accidentId'>accidentId</isNotEmpty>
			<isNotEmpty prepend=',' property='accidentState'>accidentState</isNotEmpty>
			<isNotEmpty prepend=',' property='deviceId'>deviceId</isNotEmpty>
			<isNotEmpty prepend=',' property='deviceType'>deviceType</isNotEmpty>
			<isNotEmpty prepend=',' property='regionId'>regionId</isNotEmpty>
			<isNotEmpty prepend=',' property='locationDesc'>locationDesc</isNotEmpty>
			<isNotEmpty prepend=',' property='locationId'>locationId</isNotEmpty>
			<isNotEmpty prepend=',' property='direction'>direction</isNotEmpty>
			<isNotEmpty prepend=',' property='eventId'>eventId</isNotEmpty>
			<isNotEmpty prepend=',' property='eventSource'>eventSource</isNotEmpty>
			<isNotEmpty prepend=',' property='eventType'>eventType</isNotEmpty>
			<isNotEmpty prepend=',' property='occurTime'>occurTime</isNotEmpty>
			<isNotEmpty prepend=',' property='occurAddress'>occurAddress</isNotEmpty>
			<isNotEmpty prepend=',' property='adminDivision'>adminDivision</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmListId'>alarmListId</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmTime'>alarmTime</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmPhone'>alarmPhone</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmPerson'>alarmPerson</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmLevel'>alarmLevel</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmContent'>alarmContent</isNotEmpty>
			<isNotEmpty prepend=',' property='eventUrl'>eventUrl</isNotEmpty>
			<isNotEmpty prepend=',' property='eventSmallUrl'>eventSmallUrl</isNotEmpty>
			<isNotEmpty prepend=',' property='eventBigUrl'>eventBigUrl</isNotEmpty>
			<isNotEmpty prepend=',' property='longitude'>longitude</isNotEmpty>
			<isNotEmpty prepend=',' property='latitude'>latitude</isNotEmpty>
			<isNotEmpty prepend=',' property='vdId'>vdId</isNotEmpty>
			<isNotEmpty prepend=',' property='channelId'>channelId</isNotEmpty>
			<isNotEmpty prepend=',' property='planID'>planID</isNotEmpty>
			<isNotEmpty prepend=',' property='confirmAccount'>confirmAccount</isNotEmpty>
			<isNotEmpty prepend=',' property='confirmTime'>confirmTime</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>

		</dynamic>  
	    <![CDATA[ 
	        ) values ( 
	    ]]>  
	     <dynamic prepend=" "> 
			<isNotEmpty prepend=',' property='accidentId'>#accidentId#</isNotEmpty>
			<isNotEmpty prepend=',' property='accidentState'>#accidentState#</isNotEmpty>
			<isNotEmpty prepend=',' property='deviceId'>#deviceId#</isNotEmpty>
			<isNotEmpty prepend=',' property='deviceType'>#deviceType#</isNotEmpty>
			<isNotEmpty prepend=',' property='regionId'>#regionId#</isNotEmpty>
			<isNotEmpty prepend=',' property='locationDesc'>#locationDesc#</isNotEmpty>
			<isNotEmpty prepend=',' property='locationId'>#locationId#</isNotEmpty>
			<isNotEmpty prepend=',' property='direction'>#direction#</isNotEmpty>
			<isNotEmpty prepend=',' property='eventId'>#eventId#</isNotEmpty>
			<isNotEmpty prepend=',' property='eventSource'>#eventSource#</isNotEmpty>
			<isNotEmpty prepend=',' property='eventType'>#eventType#</isNotEmpty>
			<isNotEmpty prepend=',' property='occurTime'>#occurTime#</isNotEmpty>
			<isNotEmpty prepend=',' property='occurAddress'>#occurAddress#</isNotEmpty>
			<isNotEmpty prepend=',' property='adminDivision'>#adminDivision#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmListId'>#alarmListId#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmTime'>#alarmTime#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmPhone'>#alarmPhone#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmPerson'>#alarmPerson#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmLevel'>#alarmLevel#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmContent'>#alarmContent#</isNotEmpty>
			<isNotEmpty prepend=',' property='eventUrl'>#eventUrl#</isNotEmpty>
			<isNotEmpty prepend=',' property='eventSmallUrl'>#eventSmallUrl#</isNotEmpty>
			<isNotEmpty prepend=',' property='eventBigUrl'>#eventBigUrl#</isNotEmpty>
			<isNotEmpty prepend=',' property='longitude'>#longitude#</isNotEmpty>
			<isNotEmpty prepend=',' property='latitude'>#latitude#</isNotEmpty>
			<isNotEmpty prepend=',' property='vdId'>#vdId#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelId'>#channelId#</isNotEmpty>
			<isNotEmpty prepend=',' property='planID'>#planID#</isNotEmpty>
			<isNotEmpty prepend=',' property='confirmAccount'>#confirmAccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='confirmTime'>#confirmTime#</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>

		 </dynamic>  
	    <![CDATA[ 
	        ) 
	    ]]> 
	</insert>
	<update id="updateTrafficaccidentinfo_planEnd" parameterClass="java.util.Map">
		update trafficaccidentinfo 
		<dynamic prepend="set ">   
			
			<isNotEmpty prepend=',' property='accidentState'>accidentState=#accidentState#</isNotEmpty>
			<isNotEmpty prepend=',' property='planID'>planID=#planID#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifyAccount'>modifyAccount=#modifyAccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='modifyTime'>modifyTime=#modifyTime#</isNotEmpty>
		</dynamic>
		where 1=1 
			<isNotEmpty prepend='AND ' property='accidentId'> accidentId = #accidentId#</isNotEmpty>

	</update>
	
	<!-- edit object  -->
	<update id="update_Trafficaccidentinfo" parameterClass="java.util.Map">
		update trafficaccidentinfo 
		<dynamic prepend="set ">   
			
			<isNotEmpty prepend=',' property='accidentState'>accidentState=#accidentState#</isNotEmpty>
			<isNotEmpty prepend=',' property='deviceId'>deviceId=#deviceId#</isNotEmpty>
			<isNotEmpty prepend=',' property='deviceType'>deviceType=#deviceType#</isNotEmpty>
			<isNotEmpty prepend=',' property='regionId'>regionId=#regionId#</isNotEmpty>
			<isNotEmpty prepend=',' property='locationDesc'>locationDesc=#locationDesc#</isNotEmpty>
			<isNotEmpty prepend=',' property='locationId'>locationId=#locationId#</isNotEmpty>
			<isNotEmpty prepend=',' property='direction'>direction=#direction#</isNotEmpty>
			<isNotEmpty prepend=',' property='eventId'>eventId=#eventId#</isNotEmpty>
			<isNotEmpty prepend=',' property='eventSource'>eventSource=#eventSource#</isNotEmpty>
			<isNotEmpty prepend=',' property='eventType'>eventType=#eventType#</isNotEmpty>
			<isNotEmpty prepend=',' property='occurTime'>occurTime=#occurTime#</isNotEmpty>
			<isNotEmpty prepend=',' property='occurAddress'>occurAddress=#occurAddress#</isNotEmpty>
			<isNotEmpty prepend=',' property='adminDivision'>adminDivision=#adminDivision#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmListId'>alarmListId=#alarmListId#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmTime'>alarmTime=#alarmTime#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmPhone'>alarmPhone=#alarmPhone#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmPerson'>alarmPerson=#alarmPerson#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmLevel'>alarmLevel=#alarmLevel#</isNotEmpty>
			<isNotEmpty prepend=',' property='alarmContent'>alarmContent=#alarmContent#</isNotEmpty>
			<isNotEmpty prepend=',' property='eventUrl'>eventUrl=#eventUrl#</isNotEmpty>
			<isNotEmpty prepend=',' property='eventSmallUrl'>eventSmallUrl=#eventSmallUrl#</isNotEmpty>
			<isNotEmpty prepend=',' property='eventBigUrl'>eventBigUrl=#eventBigUrl#</isNotEmpty>
			<isNotEmpty prepend=',' property='longitude'>longitude=#longitude#</isNotEmpty>
			<isNotEmpty prepend=',' property='latitude'>latitude=#latitude#</isNotEmpty>
			<isNotEmpty prepend=',' property='vdId'>vdId=#vdId#</isNotEmpty>
			<isNotEmpty prepend=',' property='channelId'>channelId=#channelId#</isNotEmpty>
			<isNotEmpty prepend=',' property='planID'>planID=#planID#</isNotEmpty>
			<isNotEmpty prepend=',' property='confirmAccount'>confirmAccount=#confirmAccount#</isNotEmpty>
			<isNotEmpty prepend=',' property='confirmTime'>confirmTime=#confirmTime#</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='disposeReason'>disposeReason=#disposeReason#</isNotEmpty>
		</dynamic>
		where 1=1 
			<isNotEmpty prepend='AND ' property='XGTJaccidentId'> accidentId = #XGTJaccidentId#</isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJaccidentState'> accidentState = #XGTJaccidentState# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJdeviceId'> deviceId = #XGTJdeviceId# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJdeviceType'> deviceType = #XGTJdeviceType# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJregionId'> regionId = #XGTJregionId# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJlocationDesc'> locationDesc = #XGTJlocationDesc# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJlocationId'> locationId = #XGTJlocationId# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJdirection'> direction = #XGTJdirection# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJeventId'> eventId = #XGTJeventId# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJeventSource'> eventSource = #XGTJeventSource# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJeventType'> eventType = #XGTJeventType# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJoccurTime'> occurTime = #XGTJoccurTime# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJoccurAddress'> occurAddress = #XGTJoccurAddress# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJadminDivision'> adminDivision = #XGTJadminDivision# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJalarmListId'> alarmListId = #XGTJalarmListId# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJalarmTime'> alarmTime = #XGTJalarmTime# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJalarmPhone'> alarmPhone = #XGTJalarmPhone# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJalarmPerson'> alarmPerson = #XGTJalarmPerson# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJalarmLevel'> alarmLevel = #XGTJalarmLevel# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJalarmContent'> alarmContent = #XGTJalarmContent# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJeventUrl'> eventUrl = #XGTJeventUrl# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJeventSmallUrl'> eventSmallUrl = #XGTJeventSmallUrl# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJeventBigUrl'> eventBigUrl = #XGTJeventBigUrl# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJlongitude'> longitude = #XGTJlongitude# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJlatitude'> latitude = #XGTJlatitude# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJvdId'> vdId = #XGTJvdId# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJchannelId'> channelId = #XGTJchannelId# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJplanID'> planID = #XGTJplanID# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJconfirmAccount'> confirmAccount = #XGTJconfirmAccount# </isNotEmpty>
			<isNotEmpty prepend='AND ' property='XGTJconfirmTime'> confirmTime = #XGTJconfirmTime# </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>

	</update>
	
	<!-- delete object -->
	<delete id="delete_Trafficaccidentinfo" parameterClass="java.util.Map">
		delete from trafficaccidentinfo 
		<include refid="condition_Trafficaccidentinfo"/>
	</delete>
	
	<!-- batch delete object -->
	<delete id="batch_delete_Trafficaccidentinfo" parameterClass="java.util.Map">
		delete from trafficaccidentinfo 
		where 1=1		
			<isNotEmpty prepend="AND" property="accidentIds">
	              accidentId in
	              <iterate open="(" close=")" conjunction="," property="accidentIds" >  
	                 #accidentIds[]#  
	             </iterate> 
	         </isNotEmpty>
	</delete>
	
	<!-- query objects by page  
	(case b.eventType when '1' then '交通事故'  when '2' then '自然灾害' when '3' then '恶劣天气' 
		when '4' then '严重违法行为' when '5' then '路面损毁' when '6' then '交通拥堵' when '7' then '货物散落'
		when '20' then '特殊事件' when '30' then '非法逆行' when '31' then '非机动车闯入' 
		when '33' then '非法停车' when '99' then '其他事件' else '其他事件' END )
		(case eventType when '5' then '洒落物'  when '6' then '车辆违停' when '9' then '非法逆行' 
				when '11' then '车流量大' when '12' then '行人闯入' when '13' then '车辆缓行' when '16' then '交通拥堵'
				when '17' then '烟火告警' when '18' then '交通事故' when '19' then '占有率' when '20' then '能见度低'
				else '其他事件' END )
	-->
	<select id="query_Trafficaccidentinfo" resultClass="java.util.HashMap" parameterClass="java.util.Map">
			select b.*,(case b.eventType when '1' then '交通事故'   when '5' then '路面损毁' 
			when '6' then '交通拥堵' 
			when '30' then '车辆逆行' when '31' then '非机动车闯入' 
			when '32' then '非法停车' when '33' then '车辆异常缓驶' 
			when '34' then '车辆横穿路面' when '35' then '车辆驶离路面' 
			when '36' then '隧道内火灾' when '37' then '能见度过低' 
			when '38' then '行人横穿路面' when '39' then '道路障碍物' when '40' then '车辆禁行' 
		when '99' then '其他事件' else '其他事件' END ) as eventName,
		(case b.accidentState when '0' then '未处理'  when '1' then '未处理' when '5' then '未处理' when '2' then '处理中' 
		when '3' then '已忽略' 
		when '4' then '已处理' when '6' then '执行成功' when '7' then '执行失败' 
		else '未处理' END ) as accidentName,
		(case b.alarmLevel when '1' then '一般'  when '2' then '重大' when '3' then '特别重大' 
		 else '一般' END ) as alarmLevelName,
		(select deviceName from trafficdevicerelate where deviceType='10' and relationId=b.relationId limit 0,1) tdmc, 
		(select roadName from trafficroadinfo where roadId=b.roadId limit 0,1) roadName,
		(select CONCAT(startPile,'--',endPile) as startPile from trafficroadinfo where roadId=b.roadId limit 0,1) startPile,
		(select deviceName from trafficdevicerelate where deviceType='9' and roadId=b.roadId limit 0,1) tunnelName  ,
		(select planName from trafficplanmanage where planID=b.planID limit 1) as planName
		 from (
		select a.*,
		(select relationId from trafficdevicerelate where  deviceId=a.deviceId limit 0,1) relationId,
		(select roadId from trafficdevicerelate where deviceType='10' AND deviceId=a.deviceId limit 0,1) roadId
		from trafficaccidentinfo a
		
		where 1=1
		<isNotEmpty prepend='AND ' property='accidentId'>
			(accidentId = #accidentId#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='deviceId'>
			(deviceId = #deviceId# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='eventType'>
			(eventType = #eventType# )
		</isNotEmpty>
		
		<isNotEmpty prepend="AND" property='accidentType'>
		     eventType in
		     <iterate open="(" close=")" conjunction="," property="accidentType" >  
		        #accidentType[]#  
		    </iterate> 
		</isNotEmpty>
			
		<isNotEmpty prepend='AND ' property='alarmLevel'>
			(alarmLevel = #alarmLevel# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='time_start'>
			(occurTime >= #time_start#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='time_end'>
			(occurTime &lt;= #time_end#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='createAccount'>
			(createAccount != #createAccount#  )
		</isNotEmpty>
		<isNotEmpty prepend="AND" property='accidentState'>
		     accidentState in
		     <iterate open="(" close=")" conjunction="," property="accidentState" >  
		        #accidentState[]#  
		    </iterate> 
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='accidentStateNotIn'>
			(accidentState != #accidentStateNotIn#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='search'>
			(tdmc like concat('%',#search# ,'%')   )
		</isNotEmpty>
		
		<isNotEmpty prepend="AND" property='tdbh'>
		     deviceId in
		     <iterate open="(" close=")" conjunction="," property="tdbh" >  
		        #tdbh[]#  
		    </iterate> 
		</isNotEmpty>
		order by occurTime desc
		<isNotEmpty prepend=' ' property='start'>
			limit #start# ,#limit#
		</isNotEmpty>
		) b 
	</select>
	
	<!-- query objects by page-->
	<select id="query_TrafficaccidentPushlet" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select b.*,(case b.eventType when '1' then '交通事故'  when '5' then '路面损毁' when '6' then '交通拥堵'
		when '30' then '车辆逆行' when '31' then '行人闯入' when '32' then '非法停车' when '33' then '车辆异常缓驶'
		when '34' then '车辆横穿路面' when '35' then '车辆驶离路面' when '36' then '隧道内火灾'
		when '37' then '能见度过低' when '38' then '行人横穿路面' when '39' then '道路障碍物'
		when '40' then '车辆禁行' when '99' then '其他事件' else '其他事件' END ) as eventName,
		(case b.accidentState when '0' then '未处理'  when '1' then '未处理' when '2' then '处理中'
		when '3' then '已忽略' when '4' then '已处理' else '未处理' END ) as accidentName,
		(case b.alarmLevel when '1' then '一般'  when '2' then '重大' when '3' then '特别重大'
		else '一般' END ) as alarmLevelName,
		(select deviceName from trafficdevicerelate where deviceType='1' and relationId=b.relationId) tdmc,
		(select deviceName from trafficdevicerelate where deviceType='2' and relationId=b.relationId ) roadName,
		(select deviceInfo from trafficdevicerelate where deviceType='2' and relationId=b.relationId ) startPile,
		(select deviceName from trafficdevicerelate where deviceType='3' and relationId=b.relationId ) tunnelName
		from (    select a.*,
		(select relationId from trafficdevicerelate where deviceType='1' and deviceId=a.deviceId) relationId
		from trafficaccidentinfo a
		) b
		<!-- order by occurTime desc  -->
		<include refid="condition_Trafficaccidentinfo"/>
		<isNotEmpty prepend=' ' property='start'>
			rownum  &gt; #start#  and  rownum &lt;= #limit#
		</isNotEmpty>
		order by occurTime desc
	</select>
	
	<!--首页搜索功能-->
	<select id="query_TrafficHomePagetinfo" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select * from (
		select b.*,(case b.eventType when '1' then '交通事故'  when '5' then '路面损毁' when '6' then '交通拥堵' 
		when '31' then '行人闯入' when '32' then '非法停车' when '33' then '车辆异常缓驶' when '34' then '车辆横穿路面'
		when '35' then '车辆驶离路面' when '36' then '隧道内火灾' when '37' then '能见度过低' when '38' then '行人横穿路面' 
		when '39' then '道路障碍物' when '40' then '车辆禁行' when '99' then '其他事件' else '其他事件' END ) as eventName,
		(case b.accidentState when '0' then '未处理'  when '1' then '未处理' when '2' then '处理中' 
		when '3' then '已忽略' when '4' then '已处理' else '未处理' END ) as accidentName,
		(case b.alarmLevel when '1' then '一般'  when '2' then '重大' when '3' then '特别重大' 
		 else '一般' END ) as alarmLevelName,
		(select deviceName from trafficdevicerelate where deviceType='1' and relationId=b.relationId limit 0,1) tdmc, 
		(select deviceName from trafficdevicerelate where deviceType='2' and relationId=b.relationId limit 0,1) roadName, 
		(select deviceInfo from trafficdevicerelate where deviceType='2' and relationId=b.relationId limit 0,1) startPile,
		(select deviceName from trafficdevicerelate where deviceType='3' and relationId=b.relationId limit 0,1) tunnelName  
		 from (
		select a.*,
		(select relationId from trafficdevicerelate where deviceType='1' and deviceId=a.deviceId limit 0,1) relationId
		from trafficaccidentinfo a
		) b ) c where 1=1
		<isNotEmpty prepend='AND ' property='occurTimeStart'>
			(occurTime >= #occurTimeStart#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='occurTimeEnd'>
			(occurTime &lt;= #occurTimeEnd#  )
		</isNotEmpty>
		<isNotEmpty prepend="AND" property='accidentState'>
		     accidentState in
		     <iterate open="(" close=")" conjunction="," property="accidentState" >  
		        #accidentState[]#  
		    </iterate> 
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='accidentStateNotIn'>
			(accidentState != #accidentStateNotIn#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEsearch'>
			(tdmc like concat('%',#LIKEsearch# ,'%')   )
		</isNotEmpty>
		order by occurTime desc
		<isNotEmpty prepend=' ' property='start'>
			limit #start# ,#limit#
		</isNotEmpty>
	</select>
	
	<!--首页搜索统计总数据量-->
	<select id="count_TrafficHomePagetinfo" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from (
		select b.*,
		(select deviceName from trafficdevicerelate where deviceType='1' and relationId=b.relationId limit 0,1) tdmc, 
		(select deviceName from trafficdevicerelate where deviceType='2' and relationId=b.relationId limit 0,1) roadName, 
		(select deviceInfo from trafficdevicerelate where deviceType='2' and relationId=b.relationId limit 0,1) startPile,
		(select deviceName from trafficdevicerelate where deviceType='3' and relationId=b.relationId limit 0,1) tunnelName  
		 from (
		select a.*,
		(select relationId from trafficdevicerelate where deviceType='1' and deviceId=a.deviceId limit 0,1) relationId
		from trafficaccidentinfo a
		) b ) c  
		where 1=1
		<isNotEmpty prepend='AND ' property='occurTimeStart'>
			(occurTime >= #occurTimeStart#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='occurTimeEnd'>
			(occurTime &lt;= #occurTimeEnd#  )
		</isNotEmpty>
		<isNotEmpty prepend="AND" property='accidentState'>
		     accidentState in
		     <iterate open="(" close=")" conjunction="," property="accidentState" >  
		        #accidentState[]#  
		    </iterate> 
		</isNotEmpty>	
		<isNotEmpty prepend='AND ' property='accidentStateNotIn'>
			(accidentState != #accidentStateNotIn#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEsearch'>
			(tdmc like concat('%',#LIKEsearch# ,'%')   )
		</isNotEmpty>
	</select>
	
	<!--首页工作台中处理中和未处理数据量
		未处理tj_wcl  处理中tj_clz-->
	<select id="query_TrafficHomePagetCount" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select count(case when  accidentState ='0' then accidentState end) tj_wcl,
			   count(case when  accidentState ='2' then accidentState end) tj_clz
			   from trafficaccidentinfo
	</select>
	
	<!-- query objects totalcount -->
	<select id="count_Trafficaccidentinfo" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*)  
		 
		from trafficaccidentinfo 
 
		where 1=1
		<isNotEmpty prepend='AND ' property='accidentId'>
			(accidentId = #accidentId#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='deviceId'>
			(deviceId = #deviceId# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='eventType'>
			(eventType = #eventType# )
		</isNotEmpty>
		
		<isNotEmpty prepend="AND" property='accidentType'>
		     eventType in
		     <iterate open="(" close=")" conjunction="," property="accidentType" >  
		        #accidentType[]#  
		    </iterate> 
		</isNotEmpty>
			
		<isNotEmpty prepend='AND ' property='alarmLevel'>
			(alarmLevel = #alarmLevel# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='time_start'>
			(occurTime >= #time_start#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='time_end'>
			(occurTime &lt;= #time_end#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='createAccount'>
			(createAccount != #createAccount#  )
		</isNotEmpty>
		<isNotEmpty prepend="AND" property='accidentState'>
		     accidentState in
		     <iterate open="(" close=")" conjunction="," property="accidentState" >  
		        #accidentState[]#  
		    </iterate> 
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='accidentStateNotIn'>
			(accidentState != #accidentStateNotIn#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='search'>
			(tdmc like concat('%',#search# ,'%')   )
		</isNotEmpty>
		
		<isNotEmpty prepend="AND" property='tdbh'>
		     deviceId in
		     <iterate open="(" close=")" conjunction="," property="tdbh" >  
		        #tdbh[]#  
		    </iterate> 
		</isNotEmpty>
		
	</select>
<!-- 	<select id="count_Trafficaccidentinfo" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*)  
		 from (
		select a.*,
		(select relationId from trafficdevicerelate where deviceType='1' and deviceId=a.deviceId limit 0,1) relationId
		from trafficaccidentinfo a
		) b 
		where 1=1
		<isNotEmpty prepend='AND ' property='accidentId'>
			(accidentId = #accidentId#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='deviceId'>
			(deviceId = #deviceId# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='eventType'>
			(eventType = #eventType# )
		</isNotEmpty>
		
		<isNotEmpty prepend="AND" property='accidentType'>
		     eventType in
		     <iterate open="(" close=")" conjunction="," property="accidentType" >  
		        #accidentType[]#  
		    </iterate> 
		</isNotEmpty>
			
		<isNotEmpty prepend='AND ' property='alarmLevel'>
			(alarmLevel = #alarmLevel# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='time_start'>
			(occurTime >= #time_start#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='time_end'>
			(occurTime &lt;= #time_end#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='createAccount'>
			(createAccount != #createAccount#  )
		</isNotEmpty>
		<isNotEmpty prepend="AND" property='accidentState'>
		     accidentState in
		     <iterate open="(" close=")" conjunction="," property="accidentState" >  
		        #accidentState[]#  
		    </iterate> 
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='accidentStateNotIn'>
			(accidentState != #accidentStateNotIn#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='search'>
			(tdmc like concat('%',#search# ,'%')   )
		</isNotEmpty>
		
		<isNotEmpty prepend="AND" property='tdbh'>
		     deviceId in
		     <iterate open="(" close=")" conjunction="," property="tdbh" >  
		        #tdbh[]#  
		    </iterate> 
		</isNotEmpty>
		
	</select> -->
	
	<!-- batch add objects -->
	<insert id="batch_insert_Trafficaccidentinfo" parameterClass="java.util.List">
	 	<![CDATA[
          INSERT
      	]]>
      	<iterate conjunction=" " > 
			into trafficaccidentinfo(
			 <![CDATA[ 
				accidentId,accidentState,deviceId,deviceType,regionId,locationDesc,locationId,direction,eventId,eventSource,eventType,occurTime,occurAddress,adminDivision,alarmListId,alarmTime,alarmPhone,alarmPerson,alarmLevel,alarmContent,eventUrl,eventSmallUrl,eventBigUrl,longitude,latitude,vdId,channelId,planID,confirmAccount,confirmTime,createAccount,createTime,modifyAccount,modifyTime
			)values
			 ]]>  		 
			 <![CDATA[ 
				(
				#list[].accidentId#,#list[].accidentState#,#list[].deviceId#,#list[].deviceType#,#list[].regionId#,#list[].locationDesc#,#list[].locationId#,#list[].direction#,#list[].eventId#,#list[].eventSource#,#list[].eventType#,#list[].occurTime#,#list[].occurAddress#,#list[].adminDivision#,#list[].alarmListId#,#list[].alarmTime#,#list[].alarmPhone#,#list[].alarmPerson#,#list[].alarmLevel#,#list[].alarmContent#,#list[].eventUrl#,#list[].eventSmallUrl#,#list[].eventBigUrl#,#list[].longitude#,#list[].latitude#,#list[].vdId#,#list[].channelId#,#list[].planID#,#list[].confirmAccount#,#list[].confirmTime#,#list[].createAccount#,#list[].createTime#,#list[].modifyAccount#,#list[].modifyTime#
				)
			]]>    
    	</iterate> 
	</insert>
	
	
	<!-- 查询相机  id + 名称    -->
	<select id="get_Cameras" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select xh, tdmc from sbtdspsr where kz3 is not null     and kz3 != '1'
	</select>
	
	<!-- 统计  按月份统计 -->
	<select id="get_trafficCountByMonth" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select cast(DATE_FORMAT(str_to_date(OccurTime, '%Y-%m-%d %H:%i:%s'),'%Y%m') as char) sj,cast(count(accidentId) as char) as zs from TrafficAccidentInfo 
		where 1=1 
		<isNotEmpty prepend="AND" property="bjTime">
			alarmTime >= '$bjTime$' 
		</isNotEmpty>
		<isNotEmpty prepend="AND" property="bjTimeEnd">
			alarmTime &lt;= '$bjTimeEnd$'
		</isNotEmpty>	
		<isNotEmpty prepend="AND" property="states">
              accidentState in
              <iterate open="(" close=")" conjunction="," property="states" >  
                 #states[]#  
             </iterate> 
         </isNotEmpty>
         <isNotEmpty prepend="AND" property="eventType">
				eventType in 
				<iterate open="(" close=")" conjunction="," property="eventType">
					#eventType[]#
				</iterate>
		</isNotEmpty>
		<isNotEmpty prepend="AND" property="xj">
                 deviceId in
                 <iterate open="(" close=")" conjunction="," property="xj" >  
                    #xj[]#  
                </iterate> 
         </isNotEmpty>
	</select>
	
	<!-- 统计  按日统计 -->
	<select id="get_trafficCountByDay" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select cast(DATE_FORMAT(str_to_date(OccurTime, '%Y-%m-%d %H:%i:%s'),'%Y%m%d') as char) sj,
			cast(count(accidentId) as char) zs from TrafficAccidentInfo   
			where 1=1 
			<isNotEmpty prepend="AND" property="bjTime">
				alarmTime >= '$bjTime$' 
			</isNotEmpty>
			<isNotEmpty prepend="AND" property="bjTimeEnd">
				alarmTime &lt;= '$bjTimeEnd$'
			</isNotEmpty>	
			<isNotEmpty prepend="AND" property="states">
	              accidentState in
	              <iterate open="(" close=")" conjunction="," property="states" >  
	                 #states[]#  
	             </iterate> 
	         </isNotEmpty>
	         <isNotEmpty prepend="AND" property="eventType">
					eventType in 
					<iterate open="(" close=")" conjunction="," property="eventType">
						#eventType[]#
					</iterate>
			</isNotEmpty>
			<isNotEmpty prepend="AND" property="xj">
	                 deviceId in
	                 <iterate open="(" close=")" conjunction="," property="xj" >  
	                    #xj[]#  
	                </iterate> 
	         </isNotEmpty>
	</select>
	
	<!-- 统计  按小时统计 -->
	<select id="get_trafficCountByHour" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select cast(HOUR(str_to_date(OccurTime, '%Y-%m-%d %H:%i:%s')) as char) sj,cast(count(accidentId) as char) as zs from TrafficAccidentInfo  
		where 1=1
			<isNotEmpty prepend="AND" property="bjTime">
				alarmTime >= '$bjTime$' 
			</isNotEmpty>
			<isNotEmpty prepend="AND" property="bjTimeEnd">
				alarmTime &lt;= '$bjTimeEnd$'
			</isNotEmpty>	
			<isNotEmpty prepend="AND" property="states">
	              accidentState in
	              <iterate open="(" close=")" conjunction="," property="states" >  
	                 #states[]#  
	             </iterate> 
	         </isNotEmpty>
	         <isNotEmpty prepend="AND" property="eventType">
					eventType in 
					<iterate open="(" close=")" conjunction="," property="eventType">
						#eventType[]#
					</iterate>
			</isNotEmpty>
			<isNotEmpty prepend="AND" property="xj">
	                 deviceId in
	                 <iterate open="(" close=")" conjunction="," property="xj" >  
	                    #xj[]#  
	                </iterate> 
	         </isNotEmpty>
	</select>
	
	<!-- 预案查询   根据planId查询预案 -->
	<select id="get_bjya" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select planID,planName,planGrade,enableState,planExecMode,planStartTime 
		from trafficplanmanage where 1=1
		<isNotEmpty prepend="AND" property="planID">
				planID = #planID# 
		</isNotEmpty>
		
	</select>
	<!-- 大屏加载摄像头信息 -->
	<select id="query_listBigscreenInitCamere" resultClass="java.util.HashMap" parameterClass="java.util.Map">
			select b.*,
			(select roadName from trafficroadinfo where roadId=b.relationId limit 0,1) roadName,
			(select CONCAT(startPile,'--',endPile) as startPile from trafficroadinfo where roadId=b.relationId limit 0,1) startPile,
			(select deviceName from trafficdevicerelate where deviceType='9' AND roadId=b.relationId limit 0,1) tunnelName
			FROM
			(
			select a.xh,a.sbbh,a.tdbh,a.tdlx,a.tdmc,a.tdzt,a.jd,a.wd,a.xzbh,
			(select roadId from trafficdevicerelate where deviceType='10' AND deviceId=a.xh limit 0,1) relationId
			from sbtdspsr a where a.kz3 is not null	and a.kz3 != '1'
			) b
		<!-- 
		select xh,sbbh,tdbh,tdlx,tdmc,tdzt,jd,wd,xzbh,b.jql from sbtdspsr a
		left join (select deviceId,count(1) jql from trafficaccidentinfo 
		where accidentState='1' group by deviceId ) b
		on a.xh=b.deviceId 
		 -->
	</select>
	
	<!-- 大屏加载隧道信息 -->
	<select id="query_listBigscreenInitTunnel" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select tunnel.*,b.roadName,b.deviceInfo from (
			select a.tunnelId,a.tunnelNumber,a.tunnelName,a.upDirection,a.downDirection,a.roadMaterial,a.MaxVehicleNumber,a.longitude,a.latitude,a.remarks,
			(select roadId from trafficdevicerelate c where deviceType='9' AND c.deviceId=a.tunnelId limit 0,1) roadId
			from traffictunnelinfo a) tunnel
			left join 
			trafficdevicerelate b on b.roadId=tunnel.roadId AND b.deviceType='20'
			where 1=1
			<isNotEmpty prepend="AND" property="tunnelId">
				tunnelId = #tunnelId# 
		</isNotEmpty>
	</select>
	
	<!-- 大屏加载led情报板信息 -->
	<select id="query_listBigscreenInitLedBoard" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select * from trafficleddevice
	</select>
	
	<!-- 大屏加载诱导灯信息 -->
	<select id="query_listBigscreenInitTrafficLight" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select * from trafficlightdevice
	</select>
	
	<!-- 大屏加载警情信息 -->
	<select id="query_listBigscreenInitAlarm" resultClass="java.util.HashMap" parameterClass="java.util.Map">
		select accidentId,accidentState,
		(case accidentState when '0' then '未处理'  when '1' then '未处理' when '2' then '处理中' 
				when '3' then '已忽略' when '4' then '已完结' when '5' then '未处理' when '6' then '执行成功'
				when '7' then '执行失败' 
				else '处理中' END ) as accidentName,
		deviceId,eventId,eventSource,
		eventType,
		(case eventType when '1' then '交通事故'   when '5' then '路面损毁' 
			when '6' then '交通拥堵' 
			when '30' then '车辆逆行' when '31' then '非机动车闯入' 
			when '32' then '非法停车' when '33' then '车辆异常缓驶' 
			when '34' then '车辆横穿路面' when '35' then '车辆驶离路面' 
			when '36' then '隧道内火灾' when '37' then '能见度过低' 
			when '38' then '行人横穿路面' when '39' then '道路障碍物' 
			when '40' then '车辆禁行' 
		when '99' then '其他事件' else '其他事件' END ) as eventName,
		occurTime,alarmTime,alarmLevel,eventUrl,vdId,channelId,planID 
		from trafficaccidentinfo where accidentState in ('1','2') order by occurTime desc limit 30
	</select>
</sqlMap>











