batis mysql 插入后返回id


<insert id="insertLQTWorkerJobDetial" parameterClass="java.util.HashMap">
	INSERT  into table_name(.....) VALUES (......) 
	<selectKey resultClass="long" keyProperty="id">  
	    select last_insert_id() as id from table_name limit 1 
	</selectKey>
</insert>

返回值为Long

你可能感兴趣的:(mysql)