Procházet zdrojové kódy

岗位管理insert sql添加序列

Wang Zi Wen před 2 roky
rodič
revize
0499e82a1d

+ 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>