MybatisPlus连接Oracle数据库,对应数据库表主键新增时从序列中取值
实体中添加为注解添加注解属性
/*** 编号id*/@TableId(value = "ID",type = IdType.INPUT)private Long id;
在Mapper文件中添加获取序列的方法
/*** 获取序列值* @return 返回序列值*/@Select("select s_med_bill_main.nextval from dual")public Long getNextVal();
调用MybatisPlus新增方法前进行负值即可
medBillMain.setId(medBillMainMapper.getNextVal());medBillMainMapper.insert(medBillMain);
