#
Junjie
2024-07-04 0c8c0da73efb15fc92c23c023acaed2d1860e0aa
zy-asrs-common/src/main/resources/mapper/wms/OrderDetlMapper.xml
@@ -17,6 +17,13 @@
        </if>
    </sql>
    <select id="selectWorkingDetls" resultType="com.zy.asrs.common.wms.entity.OrderDetl">
        select * from wms_order_detl
        where 1=1
        and order_id = #{orderId}
        and qty &lt; anfme
    </select>
    <select id="selectItem" resultType="com.zy.asrs.common.wms.entity.OrderDetl">
        select * from wms_order_detl
        where 1=1
@@ -45,4 +52,38 @@
        <include refid="pakOutPageCondition"></include>
    </select>
    <update id="increase">
        update wms_order_detl
        set qty = qty + #{qty}
        where 1=1
        and order_id = #{orderId}
        and matnr = #{matnr}
        and host_id = #{hostId}
        <choose>
            <when test="batch != null and batch != ''">
                and batch = #{batch}
            </when>
            <otherwise>
                and (batch IS NULL OR batch = '')
            </otherwise>
        </choose>
    </update>
    <update id="decrease">
        update wms_order_detl
        set qty = qty - #{qty}
        where 1=1
        and order_no = #{orderNo}
        and matnr = #{matnr}
        and host_id = #{hostId}
        <choose>
            <when test="batch != null and batch != ''">
                and batch = #{batch}
            </when>
            <otherwise>
                and (batch IS NULL OR batch = '')
            </otherwise>
        </choose>
    </update>
</mapper>