1. 插入返回主键
<!-- 跟普通的insert没有什么不同的地方 -->
<insert id="insert" parameterType="com.soft.mybatis.model.Customer">
<!-- 1 insert语句需要写id字段,并且 values里面也不能省略
2 selectKey 的order属性需要写成BEFORE 因为这样才能将生成的uuid主键放入到参数的model中-->
<selectKey keyProperty="id" order="BEFORE" resultType="String">
select uuid()
</selectKey>
insert into t_customer (id,c_name,c_sex,c_ceroNo,c_ceroType,c_age)
values (#{id},#{name},#{sex},#{ceroNo},#{ceroType},#{age})
</insert>