代码如下:插入数据库的瞬时态返回吧 个人猜测。
@Service
public class UserService {
@Autowired
private UserMapper userMapper;
@Autowired
private UserMapperEx userMapperEx;
public List<User> getUser(){
return userMapper.selectByExample(null);
}
public int inserAndgetId(User user){
//int i = userMapperEx.insertAndgetId(user);
int insert = userMapper.insert(user);
System.out.println(user.getId());
return insert;
}
}
相关的拓展理解:
https://blog.csdn.net/rapier512/article/details/51198684