自动化立体仓库 - WMS系统
lty
3 天以前 d907a822a940c7ec0fb7de0ca845472bda52229b
src/main/resources/mapper/OrderDetlMapper.xml
@@ -45,7 +45,6 @@
        <result column="update_by" property="updateBy" />
        <result column="update_time" property="updateTime" />
        <result column="memo" property="memo" />
    </resultMap>
    <select id="selectItem" resultMap="BaseResultMap">
@@ -53,6 +52,7 @@
        where 1=1
        and order_id = #{orderId}
        and matnr = #{matnr}
        and status &lt; 3
        <choose>
            <when test="batch != null and batch != ''">
                and batch = #{batch}
@@ -61,7 +61,16 @@
                and (batch IS NULL OR batch = '')
            </otherwise>
        </choose>
        <choose>
            <when test="barcode != null and barcode != ''">
                and barcode = #{barcode}
            </when>
            <otherwise>
                and (barcode IS NULL OR barcode = '')
            </otherwise>
        </choose>
    </select>
    <select id="selectItemByOrderNo" resultMap="BaseResultMap">
        select * from man_order_detl
@@ -143,7 +152,7 @@
    <update id="decrease">
        update man_order_detl
        set qty = qty - #{qty}
        set work_qty = work_qty - #{qty}
        where 1=1
        and order_no = #{orderNo}
        and matnr = #{matnr}
@@ -168,6 +177,23 @@
        INSERT INTO man_order_detl_log SELECT * FROM man_order_detl WHERE id = #{id}
    </insert>
    <update id="increaseQtyByOrderNo">
        update man_order_detl
        set qty = qty + #{qty}
        where 1=1
        and order_no = #{orderNo}
        and matnr = #{matnr}
        and barcode= #{barcode}
        <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 man_order_detl
        set work_qty = work_qty + #{workQty}
@@ -182,6 +208,14 @@
                and (batch IS NULL OR batch = '')
            </otherwise>
        </choose>
        <choose>
            <when test="barcode != null and barcode != ''">
                and barcode = #{barcode}
            </when>
            <otherwise>
                and (barcode IS NULL OR barcode = '')
            </otherwise>
        </choose>
    </update>
</mapper>