日期:2014-05-20 浏览次数:20794 次
IN i_tableName VARCHAR(1024), IN i_searchFields VARCHAR(1024), IN i_pageIndex VARCHAR(10), IN i_pageSize VARCHAR(10), IN i_whereCondition VARCHAR(1024), IN i_orderString VARCHAR(200), OUT o_totalRows INT, OUT o_totalPages INT ....
CALL commonPage('core_user', '*', '1', '1', 'where 1=1', '', @rowsCount, @pagesCount);
<parameterMap id="pageParameter" type="Map"> <parameter property="i_tableName" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/> <parameter property="i_searchFields" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/> <parameter property="i_pageIndex" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/> <parameter property="i_pageSize" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/> <parameter property="i_whereCondition" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/> <parameter property="i_orderString" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/> <parameter property="o_totalRows" jdbcType="VARCHAR" javaType="java.lang.String" mode="OUT"/> <parameter property="o_totalPages" jdbcType="VARCHAR" javaType="java.lang.String" mode="OUT"/> </parameterMap>
<select id="getUserPageList" parameterMap= "pageView.pageParameter" resultType="User"> <![CDATA[ { CALL commonPage(?, ?, ?, ?, ?, ?, ?, ?)} ]]> </select>
Map<String, String> mp= new Map<String, String>(); mp.put("i_tableName", i_tableName); mp.put("i_searchFields", i_searchFields); mp.put("i_pageIndex", i_pageIndex); mp.put("i_pageSize", i_pageSize); mp.put("i_whereCondition", i_whereCondition); mp.put("i_orderString", i_orderString); mp.put("o_totalRows", "0"); mp.put("o_totalPages", "0"); .... public List<User> getUserPageList(PageParameter map) { return getSqlSessionTemplate().selectList("com.permissions.entity.User.getUserPageList", map.getMp()); }