<insert id="insertSelective" parameterType="com.yxwl.model.po.BluetoothLock" useGeneratedKeys="true" keyProperty="id">
insert into bluetooth_lock
</insert>
其中 添加这两个属性即可
useGeneratedKeys="true"
keyProperty="id"
看java代码 ,这样就可以获取了
//插入并获取主键
lockMapper.insertSelective(lock);
int lockId = lock.getId();
心到抢票软件 https://www.xdticket.com/