自动化立体仓库 - WMS系统
1
zhang
2025-10-20 00860b3f449e5b3289f2809c199dd56ec75d46e3
src/main/resources/mapper/OrderDetlMapper.xml
@@ -68,7 +68,7 @@
        where 1=1
        and order_no = #{orderNo}
        and matnr = #{matnr}
        <if test="batch!=null">
        <if test="batch!=null and batch!='' ">
            and batch = #{batch}
        </if>
    </select>
@@ -133,7 +133,26 @@
            and order_no like '%' + #{orderNo} + '%'
        </if>
        and matnr = #{matnr}
        and batch = #{batch}
        <choose>
            <when test="batch != null and batch!=''  ">
                and batch = #{batch}
            </when>
            <otherwise>
                and (batch IS NULL OR batch = '')
            </otherwise>
        </choose>
    </select>
    <select id="selectCountToAsrByMatnr" resultType="java.lang.Long">
        SELECT ISNULL(SUM(anfme), 0) FROM asr_loc_detl WHERE matnr = #{matnr}
        <if test="batch!=null and batch!='' ">
            and batch = #{batch}
        </if>
    </select>
    <select id="selectCountToManByMatnr" resultType="java.lang.Long">
        SELECT ISNULL(SUM(anfme), 0) FROM man_loc_detl WHERE matnr = #{matnr}
        <if test="batch!=null and batch!='' ">
            and batch = #{batch}
        </if>
    </select>
    <update id="increase">
@@ -211,4 +230,36 @@
        </choose>
    </update>
    <update id="increaseAnfme">
        update man_order_detl
        set anfme = anfme + #{qty}
        where 1=1
        and order_id = #{orderId}
        and matnr = #{matnr}
        <choose>
            <when test="batch != null and batch != ''">
                and batch = #{batch}
            </when>
            <otherwise>
                and (batch IS NULL OR batch = '')
            </otherwise>
        </choose>
    </update>
    <update id="increaseWorkQtyByOrderNo">
        update man_order_detl
        set work_qty = work_qty + #{qty}
        where 1=1
        and order_no = #{orderNo}
        and matnr = #{matnr}
        <choose>
            <when test="batch != null and batch != ''">
                and batch = #{batch}
            </when>
            <otherwise>
                and (batch IS NULL OR batch = '')
            </otherwise>
        </choose>
    </update>
</mapper>