67,512
社区成员
发帖
与我相关
我的任务
分享
List<T> selectByExampleWithBLOBs(FilterExample example);
List<T> selectByExampleWithRowbounds(FilterExample example, RowBounds rowBounds);
xml中的代码是这样的 <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.excenergy.edba.filter.FilterExample" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed May 21 13:11:55 CST 2014.
-->
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from LOGIN_LOG
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select resultMap="BaseResultMap" parameterType="com.excenergy.edba.filter.FilterExample" id="selectByExampleWithRowbounds" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed May 21 13:11:55 CST 2014.
-->
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from LOGIN_LOG
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<sql id="Example_Where_Clause" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Wed May 21 13:11:55 CST 2014.
-->
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
这两段xml代码感觉没什么区别啊,为什么后者能实现分页功能limit #{start}, #{stop}