mybatis
一、自增主键回显与非自增主键回显
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into test.user(name, password, sex, age)
values (#{name}, #{password}, #{sex}, #{age})
</insert>
2、非自增主键回显(案例)
<insert id="insert">
<selectKey keyProperty="id" keyColumn="id" order="BEFORE" resultType="java.lang.Integer">
select max(id)+1 from user
</selectKey>
insert into test.user(id,name, password, sex, age)
values (#{id},#{name}, #{password}, #{sex}, #{age})
</insert>