Your Site Title

Mybatis

返回ID

oracle 通过序列创建id, mysql 有自增字段

<insert id="insertSelective" useGeneratedKeys="true" keyProperty="sid" parameterType="com.teamsun.base.entity.SysProject">

    <selectKey resultType="java.lang.Long" keyProperty="sid" order="AFTER" >
      SELECT LAST_INSERT_ID() as sid
    </selectKey>

</insert>

Reference