首页 > 代码库 > mybatis 插入自增序列

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本身没有自增需要写索引




本文出自 “大话程序” 博客,请务必保留此出处http://houqida.blog.51cto.com/8877896/1584686

mybatis 插入自增序列