|  |  | 
 |  |  |         <if test="specs!=null and specs!='' "> | 
 |  |  |             and a.specs like '%' + #{specs} + '%' | 
 |  |  |         </if> | 
 |  |  |         <if test="standby1!=null and standby1!='' "> | 
 |  |  |             and a.standby1 like '%' + #{standby1} + '%' | 
 |  |  |         </if> | 
 |  |  |         <if test="standby2!=null and standby2!='' "> | 
 |  |  |             and a.standby2 like '%' + #{standby2} + '%' | 
 |  |  |         </if> | 
 |  |  |     </sql> | 
 |  |  |  | 
 |  |  |     <select id="getStockOutPage" resultMap="BaseResultMap"> | 
 |  |  | 
 |  |  |             ROW_NUMBER() over (order by sum(a.anfme) desc) as row | 
 |  |  |             , a.matnr | 
 |  |  |             , a.batch | 
 |  |  |             , a.standby1 | 
 |  |  |             , a.standby2 | 
 |  |  |             , sum(a.anfme) as anfme | 
 |  |  |             from asr_loc_detl a | 
 |  |  |             where 1=1 | 
 |  |  |             <include refid="stockOutCondition"></include> | 
 |  |  |             group by a.matnr, a.batch | 
 |  |  |             group by a.matnr, a.batch, a.standby1, a.standby2 | 
 |  |  |          ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) | 
 |  |  |     </select> | 
 |  |  |  |