自增id问题

This commit is contained in:
liuhanqing
2025-05-20 10:59:48 +08:00
parent 00b4f8ea54
commit 007976b284
20 changed files with 6 additions and 24 deletions

View File

@@ -88,7 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where post_id = #{postId}
</update>
<insert id="insertPost" parameterType="SysPost" >
<insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
insert into sys_post(
<if test="postId != null and postId != 0">post_id,</if>
<if test="postCode != null and postCode != ''">post_code,</if>

View File

@@ -103,7 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where r.role_key=#{roleKey} and r.del_flag = '0'
</select>
<insert id="insertRole" parameterType="SysRole" >
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId" >
insert into sys_role(
<if test="roleId != null and roleId != 0">role_id,</if>
<if test="roleName != null and roleName != ''">role_name,</if>

View File

@@ -142,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select top 1 user_id, email from sys_user where email = #{email} and del_flag = '0'
</select>
<insert id="insertUser" parameterType="SysUser" >
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId" >
insert into sys_user(
<if test="userId != null and userId != 0">user_id,</if>
<if test="deptId != null and deptId != 0">dept_id,</if>