Преглед изворни кода

岗位管理insert sql添加序列

Wang Zi Wen пре 2 година
родитељ
комит
0499e82a1d
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml

+ 3 - 0
ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml

@@ -87,6 +87,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</update>
  	
  	<insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
+		<selectKey keyProperty="postId" resultType="long" order="BEFORE">
+			SELECT seq_sys_post.NEXTVAL as postId FROM DUAL
+		</selectKey>
  		insert into sys_post(
  			<if test="postId != null and postId != 0">post_id,</if>
  			<if test="postCode != null and postCode != ''">post_code,</if>