ibatis查询oracle分页
开发采用spring+struts+ibatis+extjs,数据库用oracle
ibtais配置分页 模糊查询
Java代码
<sqlMap namespace="RYDM" >
<!--加载 分页对象-->
<typeAlias alias="page" type="com.portal.util.Page" />
<!--加载 实体对象-->
<typeAlias alias="abatorgenerated_RydmResult" type="com.portal.model.Rydm" />
<resultMap id="abatorgenerated_RydmResult" class="com.portal.model.Rydm" >
<result column="RYDM" property="rydm" jdbcType="VARCHAR" />
<result column="RYMC" property="rymc" jdbcType="VARCHAR" />
<result column="BMZDM" property="bmzdm" jdbcType="VARCHAR" />
<sql id="findByPageCondition">
<isNotEmpty property="objCondition">
<isNotEmpty property="objCondition.bmzdm">
bmzdm LIKE '%$objCondition.bmzdm$%'
</isNotEmpty>
<isNotEmpty property="objCondition.rymc">
AND rymc LIKE '%$objCondition.rymc$%'
</isNotEmpty>
</isNotEmpty>
</sql>
<select id="findByPage" parameterClass="page"
resultClass="abatorgenerated_RydmResult">
SELECT * FROM (SELECT row_.*, rownum rownum_ FROM
(select ry.* from RYDM ry
where 1=1
<dynamic prepend="AND">
<include refid="findByPageCondition" />
</dynamic>
)row_ WHERE rownum <= $limit$)row_ WHERE rownum_ >$start$
ORDER BY rydm
</select>
<select id="findByCount" parameterClass="page" resultClass="int">
SELECT COUNT(*) FROM RYDM ry where 1=1
<dynamic prepend="AND">
 
相关新闻>>
- 发表评论
-
- 最新评论 更多>>