mybatis中设置主键返回
<insert id="insertSelective" parameterType="com.nwow.pss.model.User" useGeneratedKeys="true" keyProperty="id">
xml文件中加入 加入useGeneratedKeys="true" keyProperty="id"
即可
tip:数据库中主键需要设置为自增
双引号要英文格式下的
<insert id="insertSelective" parameterType="com.nwow.pss.model.User" useGeneratedKeys="true" keyProperty="id">
xml文件中加入 加入useGeneratedKeys="true" keyProperty="id"
即可
tip:数据库中主键需要设置为自增
双引号要英文格式下的