• mybatis调用oracle存储过程例子.


    1.MYBATIS方法:

    <select id="getFlowNum" statementType="CALLABLE">
    <![CDATA[
    {call PRO_CFC_GETFLOWNUM(
    #{V_IN_RANDOM,mode=IN,jdbcType=VARCHAR},   
    #{V_IN_BUSCODE,mode=IN,jdbcType=VARCHAR},
    #{V_IN_REFRESHVAR,mode=IN,jdbcType=VARCHAR},
    #{V_O_FLOWNUM,mode=OUT,jdbcType=INTEGER}
    )}
    ]]>
    </select>

    2.MAPPER方法:

    public interface TbcommonflownumMapper  {

    Integer getFlowNum(Map<String, Object> map);

    }

    3.SERVICE方法:

    public Integer getFlowNum(String busCode, String refreshvar) {
    synchronized (this) {
    if(curnum!=null)curnum=null;
    Map<String,Object> map = new HashMap<String, Object>();
    map.put("V_IN_RANDOM", UUID.randomUUID().toString());//入参1  map的k值要和mybatis的变量名一致.
    map.put("V_IN_BUSCODE", busCode);     //入参2
    map.put("V_IN_REFRESHVAR", refreshvar);  //入参3
    TbcommonflownumMapper.getFlowNum(map);
    Object _curnum=map.get("V_O_FLOWNUM");  //过程出参值写在map里面.
    if(_curnum==null)return null;
    curnum=Integer.parseInt(_curnum.toString());
    return curnum;
    }
    }

  • 相关阅读:
    c++ 容器学习 理论
    TCP和UDP发送数据包的大小问题
    key.go
    election.go
    watch.go
    txn.go
    sort.go
    retry.go
    op.go
    maintenance.go
  • 原文地址:https://www.cnblogs.com/orac/p/6484540.html
Copyright © 2020-2023  润新知