MyBatis调用Oracle的存储过程

 

Mapper.xml文件:

---------------------------------

<parameterMap type="map" id="classificationOfUser">
        <parameter property="in_query_value" jdbcType="VARCHAR" mode="IN" />
        <parameter property="in_query_type" jdbcType="DECIMAL" mode="IN" />
        <parameter property="out_code" jdbcType="VARCHAR" mode="OUT" />
        <parameter property="out_msg" jdbcType="VARCHAR" mode="OUT" />
    </parameterMap>

 

<select id="getClassificationOfUser" parameterMap="classificationOfUser" resultType="map" statementType="CALLABLE">
        {call rm.pg_hn_rm_for_ank.getUserInfo(?, ?, ?, ?)}
    </select>

 

 

Mapper.java

------------------

Map<String, Object> getClassificationOfUser(Map<String, Object> map);

 

 

Service.java

--------------------------------

public void initReportData(ReportExample reportExample, LoginInfoBean loginInfoBean) {
        if (reportExample.getReportId() != null && reportExample.getReportId().intValue() == 10026) {
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("in_query_value", reportExample.getAccessNumber());
            map.put("in_query_type", new Integer(1));
            map.put("out_code", null);
            map.put("out_msg", null);
            Map<String, Object> retVal = reportMapper.getClassificationOfUser(map);
            logger.debug(retVal);
        }

    }

你可能感兴趣的:(mybatis)