自动化立体仓库 - WMS系统
lsh
2024-12-16 78c42b85c2fc1a77c80ac0da78367f1021fb511f
src/main/resources/mapper/LocDetlMapper.xml
@@ -57,6 +57,44 @@
        </choose>
    </sql>
    <sql id="selectAllSql">
        <if test="locNo!=null and locNo!='' ">
            and t.loc_no like '%' + #{locNo} + '%'
        </if>
        <if test="matnr != null and matnr !='' ">
            and t.matnr like '%' + #{matnr} + '%'
        </if>
        <if test="owner != null">
            and t.owner =  #{owner}
        </if>
        <if test="payment != null">
            and t.payment = #{payment}
        </if>
    </sql>
    <select id="selectAllCount" resultType="java.lang.Integer" parameterType="com.zy.asrs.entity.result.LocDetlDTO">
        SELECT count(*) FROM (
        SELECT ROW_NUMBER() over(order by matnr) as row,* FROM (
        SELECT * FROM asr_loc_detl_all
        ) t
        WHERE 1=1
        <include refid="selectAllSql"></include>
        ) a
    </select>
    <select id="selectAllOwner" resultType="com.zy.asrs.entity.result.LocDetlAll" parameterType="com.zy.asrs.entity.result.LocDetlDTO">
        SELECT * FROM (
        SELECT ROW_NUMBER() over(order by matnr) as row,* FROM (
        SELECT * FROM asr_loc_detl_all
        ) t
        WHERE 1=1
        <include refid="selectAllSql"></include>
        ) a
        WHERE a.row BETWEEN ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
    </select>
    <select id="selectItem" resultMap="BaseResultMap">
        select top 1 *
        from asr_loc_detl
@@ -401,5 +439,19 @@
        and lm.row1 in (31,32)
        order by row1
    </select>
    <select id="getStockStatis2" resultType="com.zy.asrs.entity.LocDetl">
        select * from
        (
        select
        ROW_NUMBER() over (order by sum(a.anfme),a.batch desc) as row
        , a.matnr
        , a.batch
        , sum(a.anfme) as anfme
        from asr_loc_detl a
        where 1=1
        <include refid="stockOutCondition"></include>
        group by a.matnr,a.batch
        ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
    </select>
</mapper>