Map m = new HashMap(); m.put("v_instancename", instancename); m.put("v_almobjtype", alarmobjtype); m.put("v_almobj", alarmobjdn); m.put("result", ""); service.update("Workorder.updateAlarmInfoInstance", m);
ibatis spring配置略
XML代码:
<parameterMap class="java.util.Map" id="f_map"> <parameter property="result" jdbcType="VARCHAR" javaType="java.lang.String" mode="OUT" /> <parameter property="v_instancename" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/> <parameter property="v_almobjtype" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/> <parameter property="v_almobj" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/> </parameterMap> <procedure id="Workorder.updateAlarmInfoInstance" parameterMap="f_map"> <![CDATA[ {? = call F_createalarminfoinstancename(?,?,?)} ]]> </procedure>
Oracle 代码
CREATE OR REPLACE Function F_createalarminfoinstancename( v_instancename in varchar2 , v_almobjtype in varchar2, v_almobj in varchar2 ) return varchar2 is v_err varchar2(200); result varchar2(10); Begin result:='1'; update alm_alarminfo set instancename = v_instancename where alarmobjdn = v_almobj and alarmobjtype = v_almobjtype; commit; return result; End F_createalarminfoinstancename;