• Mybatis调用oracle存储过程


    <!-- 进出参数要一一致-->
    <parameterMap type="java.util.Map" id="oracleMap">
    <parameter property="in_str" mode="IN" jdbcType="VARCHAR"/>
    <parameter property="out_str" mode="OUT" jdbcType="VARCHAR"/>
    <parameter property="out_others" mode="OUT" jdbcType="VARCHAR"/>
    <parameter property="out_extra" mode="OUT" jdbcType="VARCHAR"/>
    </parameterMap>
    <select id="getDispatch" statementType="CALLABLE" parameterMap="oracleMap">
    {call xshtest.APP_DISPATCH(?,?,?,?)}
    </select>
    public int insertUserInfo(Map param){
            int i=0;
            String phone = String.valueOf(param.get("phone"));
            SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss");
            String timespan = sf.format(new Date());
            String random =  String.valueOf(Math.random());
            random = timespan+random.substring(random.length()-6,random.length());
            Map parMap = new HashMap();
            parMap.put("userName", phone);
            parMap.put("swapType","1000000001");
            parMap.put("queryId",random);
            Map map = new HashMap();
            map.put("in_str", JsonUtils.toJsonNf(parMap));
            map.put("out_str","");
            log.info("============"+map+"============");
            buyUserListMapper.getDispatch(map);
            Map loginInfo = JsonUtils.toObject(String.valueOf(map.get("out_str")),HashMap.class);
            log.info("============"+loginInfo+"============");
            if(null !=loginInfo && "00".equals(loginInfo.get("resultCode"))){
                param.put("userId",loginInfo.get("userId"));
               i =  buyUserListMapper.insertUserInfo(param);
            }
            return i;
        }
    void getDispatch(Map param);

  • 相关阅读:
    JavaScript变量存储浅析
    AngularJS学习篇(二十二)
    css目录
    html目录
    javascript目录
    第一篇 dom
    第五篇、css补充二
    第六篇 javascript面向对象
    第三篇 css属性
    jmeter之-图形监控
  • 原文地址:https://www.cnblogs.com/SimonHu1993/p/10025031.html
Copyright © 2020-2023  润新知