mybatis 插入自增序列


<insert id="insertBzwzruku" parameterType="com.labway.portal.po.X_bzwz_ruku">
		<selectKey keyProperty="rkid" resultType="int" order="BEFORE">
			select
			SEQ_BZWZRU.nextval from dual
		</selectKey>
		insert into x_bzwz_ruku
		(rkid,
		bzwzname, bzwzywname , buynumber ,
		buydate , danjia , makedate ,
		youxiaodate, location, jddate, jddanwei
		,jdjieguo , jdyxdate
		)
		values( #{rkid},
		#{bzwzname} ,#{bzwzywname},
		#{buynumber},
		#{buydate,javaType=String,jdbcType=DATE,typeHandler=com.labway.portal.handler.LwDateTypeHandler},
		#{danjia},
		#{makedate,javaType=String,jdbcType=DATE,typeHandler=com.labway.portal.handler.LwDateTypeHandler},
		#{youxiaodate,javaType=String,jdbcType=DATE,typeHandler=com.labway.portal.handler.LwDateTypeHandler},
		#{location},
		#{jddate,javaType=String,jdbcType=DATE,typeHandler=com.labway.portal.handler.LwDateTypeHandler},
		#{jddanwei},
		#{jdjieguo},
		#{jdyxdate,javaType=String,jdbcType=DATE,typeHandler=com.labway.portal.handler.LwDateTypeHandler}
		)
	</insert>
	

注:mybatis本身没有自增需要写索引




你可能感兴趣的:(mybatis,插入自增序列)