mybatis调用带入参和出参的oracle存储过程
存储过程:
create or replace procedure Proc_GenerateSequence (
a VARCHAR,
b VARCHAR,
c VARCHAR,
d VARCHAR,
p_N_SEQUENCE out int ) is
nconfer int;
begin
dbms_output.put_line('此处省略...');
end Proc_GenerateSequence;
xml文件:
<select id="getPolicyno" statementType="CALLABLE" parameterType="java.util.Map">
Call Proc_GenerateSequence(
#{a,mode=IN,jdbcType=VARCHAR},
#{b,mode=IN,jdbcType=VARCHAR},
#{c,mode=IN,jdbcType=VARCHAR},
#{d,mode=IN,jdbcType=VARCHAR},
#{number,mode=OUT,jdbcType=VARCHAR})
</select>
dao层:
public interface AADao extends BaseMapper<AA> {
void getPolicyno(Map<String, String> map);
}
controller :
Map<String, String> map = new HashMap<String,String>();
map.put("a", a);
map.put("b", b);
map.put("c", c);
map.put("d", d);
gasChinaPlyInfoDao.getPolicyno(map);
String num = map.get("number");
ps:适用于mybatis项目