自动化立体仓库 - WMS系统
#
wang..123
2022-03-08 0621dc7f7121a8b2a2a785687ec1fc8d0a8d3d45
src/main/resources/mapper/LocDetlMapper.xml
@@ -57,6 +57,18 @@
        </if>
    </sql>
    <sql id="stockOutCondition1">
    <if test="mat_no!=null and mat_no!='' ">
        and mat_no like '%' + #{mat_no} + '%'
    </if>
    <if test="mat_name!=null and mat_name!='' ">
        and mat_name like '%' + #{mat_name} + '%'
    </if>
    <if test="str3!=null and str3!=''" >
        and str3 like '%'+#{str3}+'%'
    </if>
    </sql>
    <select id="getStockOutPage" resultMap="BaseResultMap">
        select * from
        (
@@ -96,15 +108,31 @@
        where loc_no=#{locNo}
    </select>
    <select id="getStockStatis" resultMap="BaseResultMap">
        select a.mat_name,a.mat_no,a.supplier,a.str3,sum(a.qty) qty  from
<!--        select a.mat_name,a.mat_no,a.supplier,a.str3,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,a.supplier,a.str3-->
        select * from
        (
        select ROW_NUMBER() over (order by a.mat_no) as row,
        a.mat_name,a.mat_no,a.supplier,a.str3,sum(a.qty) qty  from
        (
        select
        ROW_NUMBER() over (order by c.appe_time,c.mat_no,c.loc_no) as row,
        c.*
        mat_name,mat_no,supplier,str3,qty
        from asr_loc_detl c
        ) a where a.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
         <include refid="stockOutCondition"></include>
        where 1=1
        <include refid="stockOutCondition1"></include>
        ) a
        group by a.mat_no,a.mat_name,a.supplier,a.str3
        ) d
        where 1=1
        and row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
    </select>
    <select id="getStockStatisCount" resultType="integer">
        select