소스 검색

岗位管理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>