Map<String, Object> bindinfo = new HashMap<String, Object>();
bindinfo.put("loginid", loginid);
bindinfo.put("loginrole", loginrole);
bindinfo.put("cardnumber", cardnumber);
bindinfo.put("ret", new Integer("0"));//这是返回值
try{
//此处调用
session.selectOne("tscargo.entity.ILocation.insert_ts_comm_pay_member", bindinfo);
System.out.println("000000000000" + bindinfo.get("ret"));//取返回值
}catch(Exception e){
e.printStackTrace();
}
//以下是mybatis中的配置
<!-- 将t_fund_card表中记录插入到ts_comm_pay_member中,用存储过程:to_bind_card_ph -->
<select id="insert_ts_comm_pay_member" statementType="CALLABLE" parameterType="java.util.HashMap" >
{ call to_bind_card_ph(
#{loginid,mode=IN,jdbcType=INTEGER},
#{loginrole, mode=IN, jdbcType=INTEGER},
#{cardnumber, mode=IN, jdbcType=VARCHAR},
#{ret, mode=OUT, jdbcType=INTEGER}) }
</select>
//mysql存储过程的参数
IN userId int,IN userRole int,IN cardNo varchar(50),OUT ret int