if (!EmptyChecker.isEmpty(remarkContent)) {
Remark remark = new Remark().setContent(remarkContent).setCreatetime(LocalDateTime.now());
int insert = remarkMapper.insert(remark);
long remarkId = remark.getId(); // 获得插入后的主键id
complaint.setRemarkid(remarkId);
}
mybatisplus-插入一条数据,如何获得插入后的主键id
最新推荐文章于 2024-06-15 16:27:11 发布