mybatis中用标签处理SQL语句时,遇到pgsql中比较特殊的returning *。
当INSERT时会返回returning后的字段,但是在mybatis中使用@INSERT("${sql}")时会遇到如下错误
ps: Mapper method 'com.lingtu.mapper.EventMapper.insert' has an unsupported return type: class com.alibaba.fastjson.JSONObject
本次在mapper中的写法:
然@Insert标签并不能如愿返回JSONObject类型数据,所以我将标签修改为如下样式
成功返回参数