自动化立体仓库 - WMS系统
luxiaotao1123
2021-08-27 8523da65331b827a42952c0ea7a09f15fe1a6f91
src/main/resources/mapper/LocDetlMapper.xml
@@ -83,4 +83,29 @@
        from asr_loc_detl
        where loc_no=#{locNo}
    </select>
    <select id="getStockStatis" resultMap="BaseResultMap">
        select a.mat_name,a.mat_no,sum(a.qty) qty  from
        (
        select
        ROW_NUMBER() over (order by c.appe_time,c.mat_no,c.loc_no) as row,
        c.*
        from asr_loc_detl c
        ) a where a.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
         <include refid="stockOutCondition"></include>
        group by a.mat_no,a.mat_name
    </select>
    <select id="getStockStatisCount" resultType="integer">
        select
        count(1)
        from asr_loc_detl a
    </select>
    <select id="getStockStatisExcel" resultMap="BaseResultMap">
     select
        ROW_NUMBER() over (order by a.mat_no, sum(a.qty) desc) as row
        , a.mat_no, a.mat_name
        , sum(a.qty) as qty
        from asr_loc_detl a
        where 1=1
        group by a.mat_no,a.mat_name
    </select>
</mapper>