<insert id="insert" parameterType="user" useGeneratedKeys="true" keyProperty="userId">
insert into user (username,password,sex,createtime) values
(#{username},#{password},#{sex},#{createtime})
</insert>
<insert id="insert" parameterType="com.test.model.User">
<selectKey order="BEFORE" resultType="int" keyProperty="userId">
select seq_t_user_id.nextval userid from dual
</selectKey>
insert into t_user (user_id,username,password,sex,createtime) values
(#{userId},#{username},#{password},#{sex},#{createtime,jdbcType=VARCHAR})
</insert>