@Autowired
private ITestDao testDao;
public String test(String test){
Map<String, Object> testParam = new HashMap<>(2);
//调用存储过程
testParam.put("test", test);
testDao.test(callParam);
result = (String) callParam.get("result");
return result;
}
public interface ITestDao {
void test(Map<String, Object> testParam);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.procedure.dao.ITestDao">
<select id="test" resultType="java.util.Map" statementType="CALLABLE">
{call Test(#{test,mode=IN,jdbcType=VARCHAR},#{result,mode=OUT,jdbcType=VARCHAR})}
</select>
</mapper>