mybatis.xml配置:
<!-- 存错过程测试 传入map(多参数) 返回结果集 -->
<resultMap id="BaseResultMap_test" type="com.zd.model.system.UserManage" >
<id column="USER_ID" property="userId" />
<result column="USER_NAME" property="userName" />
<result column="USER_LOGIN" property="userLogin" />
<result column="USER_PASSWORD" property="userPassword" />
<result column="USER_TYPE" property="userType" />
<result column="USER_DEP_ID" property="userDepId" />
<result column="USER_POST_ID" property="userPostId" />
<result column="USER_FOREIGN_ID" property="userForeignId" />
<result column="USER_STATUS" property="userStatus"/>
<result column="UNIT_ID" property="unitId"/>
<result column="USER_CARD" property="userCard" />
<result column="USER_TEL" property="userTel" />
<result column="USER_MAIL" property="userMail" />
<result column="USER_ADDRESS" property="userAddress" />
<result column="LAST_LOGIN_TIME" property="lastLoginTime" />
<result column="LOGIN_IP" property="loginIp" />
<result column="REMARKS" property="remarks" />
</resultMap>
<select id="procedureTest2" statementType="CALLABLE" parameterType="java.util.Map">
<![CDATA[
CALL procedureTest_02(
#{user_login,mode=IN,jdbcType=VARCHAR},
#{result_data,mode=OUT,jdbcType=CURSOR,javaType=java.sql.ResultSet,resultMap=BaseResultMap_test}
)
]]>
</select>
存储过程:
create or replace procedure procedureTest_02(user_login in varchar2,result_data out sys_refcursor) as
sql_test varchar2(200);
begin
sql_test := 'select * from ZD_USER_MANAGE where USER_LOGIN ='''||user_login||''' ';
open result_data for sql_test;
end procedureTest_02;