XML
<select id="testCall" parameterType="java.util.Map" resultType="java.util.Map" statementType="CALLABLE"> {CALL Prc_testcall_Common(#{age,mode=IN,jdbcType=INTEGER},#{name,mode=IN,jdbcType=VARCHAR},#{pnUserID,mode=IN,jdbcType=VARCHAR},#{piErrFlag,mode=OUT,jdbcType=INTEGER},#{psErrMsg,mode=OUT,jdbcType=VARCHAR})} </select>
SQL
CREATE DEFINER=dbtest@% PROCEDURE Prc_testcall_Common( IN age INT, IN name VARCHAR(20), IN pnUserID VARCHAR(20), OUT piErrFlag INT, -- 是否成功 OUT psErrMsg VARCHAR(200) -- 错误信息 ) BEGIN END
DAO mapper
public Map<String, Object> testCall(Map<String, Object> map);
java 调用
dsDao.testCall(map);