mybatis返回新增对象的主键

加这两行就可以返回这个插入对象的自增的主键
keyProperty="id" useGeneratedKeys="true">
insert into seating_portrait (
system_producer
,system_type,
system_processer,
hostname,
system_version,
physical_memory,
mac_addr,
c_area,
run_time,
register_user,
dongdong_dir_size,
all_c_space,
ost_file_size,
disks,
ip,
c_used_rate ,
sn,start_time
) values (
#{system_producer}, #{system_type},#{system_processer},#{hostname},#{system_version},#{physical_memory},#{mac_addr},
#{c_area},#{run_time},#{register_user},#{dongdong_dir_size},#{all_c_space},#{ost_file_size},#{disks},#{ip}
,#{c_used_rate},#{sn},#{start_time}
)

转载于:https://www.cnblogs.com/leigepython/p/11188486.html

你可能感兴趣的:(java)