whycq
2024-10-28 f8a5192aa2797e83f5000ff9035f149b0a1b00a1
zy-asrs-common/src/main/resources/mapper/wms/OrderDetlMapper.xml
@@ -24,11 +24,19 @@
        and qty < anfme
    </select>
    <select id="selectDetls" resultType="com.zy.asrs.common.wms.entity.OrderDetl">
        select * from wms_order_detl
        where 1=1
          and order_id = #{orderId}
          and host_id = #{hostId}
    </select>
    <select id="selectItem" resultType="com.zy.asrs.common.wms.entity.OrderDetl">
        select * from wms_order_detl
        where 1=1
        and order_id = #{orderId}
        and matnr = #{matnr}
        and host_id = #{hostId}
        <choose>
            <when test="batch != null and batch != ''">
                and batch = #{batch}
@@ -86,7 +94,7 @@
    <update id="decrease">
        update wms_order_detl
        set qty = qty - #{qty}
        set work_qty = work_qty - #{qty}
        where 1=1
        and order_no = #{orderNo}
        and matnr = #{matnr}
@@ -107,6 +115,7 @@
        where 1=1
        and order_no = #{orderNo}
        and matnr = #{matnr}
        and host_id = #{hostId}
        <choose>
            <when test="batch != null and batch != ''">
                and batch = #{batch}
@@ -123,6 +132,24 @@
        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>
    <update id="increaseWorkQty">
        update wms_order_detl
        set work_qty = work_qty + #{workQty}
        where 1=1
        and order_id = #{orderId}
        and matnr = #{matnr}
        and host_id = #{hostId}
        <choose>
            <when test="batch != null and batch != ''">
                and batch = #{batch}