1.在mybatis的xml中加入
<insert id="insertUser" keyProperty="id" useGeneratedKeys="true" parameterType="com.UserAndOrder">
insert into Tuser(userName,passWord) values (#{userName},#{passWord} )
</insert>
<insert id="insertUser" keyProperty="id" useGeneratedKeys="true" parameterType="com.UserAndOrder">
insert into Tuser(userName,passWord) values (#{userName},#{passWord} )
</insert>