存储过程
CREATE OR REPLACE procedure "m_proc"(p_message out NVARCHAR2) AS ... BEGIN ... END;
Mybatis
<select id="refresh" statementType="CALLABLE" parameterType="Map"> {call m_proc(#{p_message, mode=OUT, jdbcType=VARCHAR})} </select>
Mapper接口定义
void refresh(Map<String, Object> map);
函数调用定义
Map<String, Object> params = new HashMap<>(); PmdeCrMapper.refresh(params); return params.get("p_message").toString();
注意:在获取输出信息时,map中key应和mybatis中定义占位符名相同
mybatis: {call m_proc(#{p_message, mode=OUT, jdbcType=VARCHAR})}
函数调用: return params.get("p_message").toString();