- <code class="language-sql">Map<String, Object> map = new HashMap<String, Object>();
- map.put("id", "0");
- mapper.selectPosBy(map);
- return (List) map.get("poss");</code>
-
Map<String, Object> map = new HashMap<String, Object>();
-
map.put("id", "0");
-
mapper.selectPosBy(map);
-
return (List) map.get("poss");
存储过程:
-
create
or
replace
procedure getPosBy(
-
V_USERID
IN
NUMBER,
-
V_CURSOR
OUT SYS_REFCURSOR
-
)
is
-
begin
-
OPEN V_CURSOR
FOR
SELECT *
from tb_pos_recode;
-
end getPosBy;
Mapper.xml
-
<update id="selectPosBy" statementType="CALLABLE" parameterType="map">
-
<![CDATA[
-
call getPosBy(#{id,mode=IN,jdbcType=DECIMAL},
-
#{poss,mode=OUT,jdbcType=CURSOR,javaType=java.sql.ResultSet,resultMap=com.lsh.dao.mapper.TbPosRecodeMapper.result})
-
]]>
-
</update>
Dao层或者service层调用