添加如下红框中的代码即可,需要自己更改下keyProperty的值为要设置成uuid的属性名
<insert id="addUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="id">
<selectKey keyProperty="id" resultType="java.lang.String" order="BEFORE">
select replace(uuid(),'-','') from dual
</selectKey>
insert into sys_user ( id,username,password,name,birthday,gender,telephone,email ) values (#{id},#{username},#{password},#{name},#{birthday},#{gender},#{telephone},#{email})
</insert>