1、xml文件
{call GYL_COMMON.GETGROUPNUM(
#{IN_PARAMETERID,jdbcType=VARCHAR,mode=IN},
#{IN_STEELID,jdbcType=VARCHAR,mode=IN},null,null,null,
#{OUT_GN,jdbcType=INTEGER,mode=OUT},
#{RST,jdbcType=CURSOR,mode=OUT,resultMap=BaseResultMap2,javaType=java.sql.ResultSet})}
2、parameter bean
public class ParamSPC {
String IN_PARAMETERID;
String IN_STEELID;
Integer OUT_GN;
List RST;
public String getIN_PARAMETERID() {
return IN_PARAMETERID;
}
public void setIN_PARAMETERID(String iN_PARAMETERID) {
IN_PARAMETERID = iN_PARAMETERID;
}
public String getIN_STEELID() {
return IN_STEELID;
}
public void setIN_STEELID(String iN_STEELID) {
IN_STEELID = iN_STEELID;
}
public Integer getOUT_GN() {
return OUT_GN;
}
public void setOUT_GN(Integer oUT_GN) {
OUT_GN = oUT_GN;
}
public List getRST() {
return RST;
}
public void setRST(List rST) {
RST = rST;
}
}
3、xxxMaper.java 中的方法
Object getGroupNum(ParamSPC param);
4、使用demo
SqlSession session = AllSqlMap.getInstance().openSession();
try {
TbSysUserMapper mapper = session.getMapper(TbSysUserMapper.class);
ParamSPC param = new ParamSPC();
param.setIN_PARAMETERID("010401"); // 填充 in 参数,out 参数不用任何处理
param.setIN_STEELID("65Mn棒带");
mapper.getGroupNum(param);
System.out.println(param.getOUT_GN()); // 获取计算结果
System.out.println(param.getRST().size());
session.commit(true);
} catch(Exception e){
e.printStackTrace();
session.rollback(true);
} finally {
session.close();
}