Mybatis 分页查询
<select id="getAllMateriel" resultType="Materiel" parameterType="Page"> Select *,(select count(*) from Materiel_Info)as total FROM ( select ROW_NUMBER()Over(order by MaterielCode desc) as rowId,* from Materiel_Info) as mytable <where> <if test="start !=null and end !=null"> rowId between #{start} and #{end} </if> <if test="materielCode != null and materielCode !=''"> AND materielCode like '%${materielCode}%' </if> <if test="materielName !=null and materielCode !=''"> AND materielName like '%${materielName}%' </if> <if test="spec !=null and spec !=''"> AND spec like '%${spec}%' </if> </where> <