mybatis+mysql自动生成32位uuid主键策略

    <insert id="insert" parameterType="com.bd.pojo.Book" >
      
        <selectKey keyProperty="id" resultType="String" order="BEFORE">
            select  replace(uuid(),'-','')   from dual
        </selectKey>
         
        insert into thk_book (id, name)
        values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR})
      </insert>

猜你喜欢

转载自blog.csdn.net/quanaianzj/article/details/82894965
今日推荐