`
hunray
  • 浏览: 219464 次
  • 性别: Icon_minigender_1
  • 来自: 长沙
社区版块
存档分类
最新评论

ibatis3调用存储过程

    博客分类:
  • Java
阅读更多
映射文件:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
"http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">

<mapper namespace="procedure">   
    <select id="pSendSms" statementType="CALLABLE">   
    	<!-- #{var,mode=OUT,jdbcType=INTEGER}输出参数的写法 -->
		{call p_send_sms(#{in_dest_addr},#{in_fee_mobile},#{in_src_addr},#{in_busi_code},#{in_fee_type},#{in_fee_code},#{in_decoding},#{in_contents},#{in_link_id},#{in_cp_id},#{in_product_id})}   
	</select>   
</mapper>



调用代码:
	public void callProcedureForMonthly(String mobile_no){
		Map map = new HashMap();   
		map.put("in_dest_addr", mobile_no);   
        map.put("in_fee_mobile", mobile_no);   
        map.put("in_src_addr", "106580***");     
        map.put("in_busi_code", "HELP");   
        map.put("in_fee_type", "01");    
        map.put("in_fee_code", 0);   
        map.put("in_decoding", 15);    
        map.put("in_contents", "本条信息免费。");   
        map.put("in_link_id", "");    
        map.put("in_cp_id", "");   
        map.put("in_product_id", "");     

        getSqlSessionTemplate().selectOne("procedure.pSendSms", map);
	}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics