<?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="Signbean" type="cn.vp.XXX.model.SignBean"/> -->	<typeAlias alias="Sign" type="cn.im.sign.SignBean"/>
	
	<sql id="condition_Sign">
		where 1=1
		<isNotEmpty prepend='AND ' property='LIKEid'>
			(id like '%$LIKEid$%'   )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='id'>
			(id = #id#  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEuser_id'>
			(user_id like '%$LIKEuser_id$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='user_id'>
			(user_id = #user_id# )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='LIKEsign_time'>
			(sign_time like '%$LIKEsign_time$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='sign_time'>
			(sign_time = #sign_time# )
		</isNotEmpty>

		<isNotEmpty prepend='AND ' property='LIKEjd'>
			(jd like '%$LIKEjd$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='jd'>
			(jd = #jd# )
		</isNotEmpty>		
		<isNotEmpty prepend='AND ' property='LIKEwd'>
			(wd like '%$LIKEwd$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='wd'>
			(wd = #wd# )
		</isNotEmpty>		
		<isNotEmpty prepend='AND ' property='LIKEuser_name'>
			(user_name like '%$LIKEuser_name$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='user_name'>
			(user_name = #user_name# )
		</isNotEmpty>		
		<isNotEmpty prepend='AND ' property='LIKEsign_address'>
			(sign_address like '%$LIKEsign_address$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='sign_address'>
			(sign_address = #sign_address# )
		</isNotEmpty>		
		<isNotEmpty prepend='AND ' property='LIKEremarks'>
			(remarks like '%$LIKEremarks$%'  )
		</isNotEmpty>
		<isNotEmpty prepend='AND ' property='remarks'>
			(remarks = #remarks# )
		</isNotEmpty>	
		
		<isNotEmpty property='tableparam'>
			$tableparam$
		</isNotEmpty>
		
		<isNotEmpty property='order'>
			$order$
		</isNotEmpty>
	</sql>
	
	<!-- add object -->
	<insert id="insert_Sign" parameterClass="java.util.Map">
		insert into 
		Sign(
		<dynamic prepend=" ">
			<isNotEmpty prepend=',' property='id'>id</isNotEmpty>
			<isNotEmpty prepend=',' property='user_id'>user_id</isNotEmpty>
			<isNotEmpty prepend=',' property='sign_time'>sign_time</isNotEmpty>
			<isNotEmpty prepend=',' property='jd'>jd</isNotEmpty>
			<isNotEmpty prepend=',' property='wd'>wd</isNotEmpty>
			<isNotEmpty prepend=',' property='user_name'>user_name</isNotEmpty>
			<isNotEmpty prepend=',' property='sign_address'>sign_address</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks'>remarks</isNotEmpty>
			<isNotEmpty prepend=',' property='xgry'>xgry</isNotEmpty>
			<isNotEmpty prepend=',' property='xgrq'>xgrq</isNotEmpty>
			<isNotEmpty prepend=',' property='cjry'>cjry</isNotEmpty>
			<isNotEmpty prepend=',' property='cjrq'>cjrq</isNotEmpty>
	</dynamic>
	    <![CDATA[ 
	        ) values ( 
	    ]]>  
	     <dynamic prepend=" "> 
			<isNotEmpty prepend=',' property='id'>#id#</isNotEmpty>
			<isNotEmpty prepend=',' property='user_id'>#user_id#</isNotEmpty>
			<isNotEmpty prepend=',' property='sign_time'>#sign_time#</isNotEmpty>
			<isNotEmpty prepend=',' property='jd'>#jd#</isNotEmpty>
			<isNotEmpty prepend=',' property='wd'>#wd#</isNotEmpty>
			<isNotEmpty prepend=',' property='user_name'>#user_name#</isNotEmpty>
			<isNotEmpty prepend=',' property='sign_address'>#sign_address#</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks'>#remarks#</isNotEmpty>
			 <isNotEmpty prepend=',' property='xgry'>#xgry#</isNotEmpty>
			 <isNotEmpty prepend=',' property='xgrq'>#xgrq#</isNotEmpty>
			 <isNotEmpty prepend=',' property='cjry'>#cjry#</isNotEmpty>
			 <isNotEmpty prepend=',' property='cjrq'>#cjrq#</isNotEmpty>

		 </dynamic>  
	    <![CDATA[ 
	        ) 
	    ]]> 
	</insert>
	
	<!-- edit object  -->
	<update id="update_Sign" parameterClass="java.util.Map">
		update Sign 
		<dynamic prepend="set ">   
			
			<isNotEmpty prepend=',' property='user_id'>user_id=#user_id#</isNotEmpty>
			<isNotEmpty prepend=',' property='sign_time'>sign_time=#sign_time#</isNotEmpty>
			<isNotEmpty prepend=',' property='jd'>jd=#jd#</isNotEmpty>
			<isNotEmpty prepend=',' property='wd'>wd=#wd#</isNotEmpty>
			<isNotEmpty prepend=',' property='user_name'>user_name=#user_name#</isNotEmpty>
			<isNotEmpty prepend=',' property='sign_address'>sign_address=#sign_address#</isNotEmpty>
			<isNotEmpty prepend=',' property='remarks'>remarks=#remarks#</isNotEmpty>
			<isNotEmpty prepend=',' property='xgry'>xgry=#xgry#</isNotEmpty>
			<isNotEmpty prepend=',' property='xgrq'>xgrq=#xgrq#</isNotEmpty>
			<isNotEmpty prepend=',' property='cjry'>cjry=#cjry#</isNotEmpty>
			<isNotEmpty prepend=',' property='cjrq'>cjrq=#cjrq#</isNotEmpty>
		</dynamic>
		where 1=1 
			<isNotEmpty prepend='AND ' property='XGTJid'> id = #XGTJid#</isNotEmpty>

	</update>
	
	<!-- delete object -->
	<delete id="delete_Sign" parameterClass="java.util.Map">
		delete from Sign 
		<include refid="condition_Sign"/>
	</delete>
	
	<!-- batch delete object -->
	<delete id="batch_delete_Sign" parameterClass="java.util.Map">
		delete from Sign 
		where 1=1
			<isNotEmpty prepend='AND ' property='keyword'>
			id  in (#keyword#)
			</isNotEmpty>
	</delete>
	
	<!-- query objects by page-->
	<select id="query_Sign" resultClass="java.util.HashMap" parameterClass="java.util.Map" remapResults="true">
		select * from Sign
		<include refid="condition_Sign"/>	
		<!-- <isNotEmpty prepend=' ' property='start'>
			limit #start# ,#limit#
		</isNotEmpty>	 -->	
	</select>
	
	<!-- query objects totalcount -->
	<select id="count_Sign" resultClass="java.lang.Integer" parameterClass="java.util.Map">
		select count(*) from Sign 
		<include refid="condition_Sign"/>			
	</select>
	
	<!-- batch add objects -->
	<insert id="batch_insert_Sign" parameterClass="java.util.List">
	 	<![CDATA[
          INSERT
      	]]>
      	<iterate conjunction=" " > 
			into Sign(
			 <![CDATA[ 
				id,user_id,sign_time,jd,wd,sign_address,remarks,xgry,xgrq,cjry,cjrq
			)values
			 ]]>  		 2
			 <![CDATA[ 
				(
				#list[].id#,#list[].user_id#,#list[].sign_time#,#list[].jd#,#list[].wd#,#list[].sign_address#,#list[].remarks#
				,#list[].xgry#
				,#list[].xgrq#
				,#list[].cjry#
				,#list[].cjrq#)
			]]>    
    	</iterate> 
	</insert>


</sqlMap>










