mysql唯一主键生成代码

时间:2021-01-04 13:54:05

<insert id="insertPeople" parameterType="PeopleSchedule">
     <selectKey resultType="String" keyProperty="id" order="BEFORE">
            select replace(uuid(), '-', '') from dual
        </selectKey>
    insert into t_notebook_people (id,notebookId,userId) values (#{id},#{notebookId},#{userId})
    </insert>

select replace(uuid(), '-', '') from dual