在Mapper接口里面
public List<Jsxx> qryJsxx(@Param("jsid")String jsid,@Param("jsm") String jsm,@Param("page")Page page);
在XML里面
<select id="qryJsxx" resultMap="JSXX_RESULT">
select
s.ID,
s.JSID,
s.JSM,
s.BZ
from 2013_PUB_JSXX s
where
<if test="jsid != null">
jsid=#{jsid}
</if>
<if test="jsid != null and jsm != null">
and
</if>
<if test="jsm != null">
jsm=#{jsm}
</if>
<if test=" page.order !=null and page.sort != null">
ORDER BY #{page.sort} #{page.order}
</if>
<if test=" page.rows !=null and page.page != null">limit #{page.page},#{page.rows}</if>
</select>