自动化立体仓库 - WMS系统
zyx
2023-10-26 d2756e02d9a9644ee20ced7d8d7ef7bf109126af
src/main/resources/mapper/LocDetlMapper.xml
@@ -44,6 +44,7 @@
        <result column="appe_user" property="appeUser" />
        <result column="appe_time" property="appeTime" />
        <result column="memo" property="memo" />
        <result column="stock_freeze" property="stockFreeze" />
    </resultMap>
    <sql id="batchSeq">
@@ -63,6 +64,14 @@
        where 1=1
        and loc_no = #{locNo}
        and matnr = #{matnr}
        <choose>
            <when test="suppCode != null and suppCode != ''">
                and supp_code = #{suppCode}
            </when>
<!--            <otherwise>-->
<!--                and (supp_code IS NULL OR supp_code = '')-->
<!--            </otherwise>-->
        </choose>
        <include refid="batchSeq"></include>
    </select>
@@ -314,12 +323,46 @@
            group by loc_no
        ) dual on dual.loc_no = lm.loc_no
        WHERE 1 = 1
        AND ld.maktx = #{matnr}
        AND (lm.row1 >= #{start} AND lm.row1 &lt;= #{end})
        AND ld.matnr = #{matnr}
        AND (lm.loc_sts = 'F')
        AND dual.count = 1
        ORDER BY lm.modi_time ASC
    </select>
    <select id="searchByLike" resultMap="BaseResultMap">
        select *
        from asr_loc_detl
        where
        1 = 1
        <if test="orderNo != null and orderNo != ''">
            and order_no like '%' + #{orderNo} + '%'
        </if>
        <if test="locNo != null and locNo != ''">
            and loc_no like '%' + #{locNo} + '%'
        </if>
        <if test="specs != null and specs != ''">
            and specs like '%' + #{specs} + '%'
        </if>
        <if test="matnr != null and matnr != ''">
            and matnr like '%' + #{matnr} + '%'
        </if>
        <if test="maktx != null and maktx != ''">
            and maktx like '%' + #{maktx} + '%';
        </if>
    </select>
    <select id="selectByLocNo" resultMap="BaseResultMap">
        select * from asr_loc_detl
        where 1=1
        and loc_no = #{locNo}
    </select>
    <update id="updateStockFreeze">
        update asr_loc_detl
        set stock_freeze = #{stockFreeze}
        , modi_time = getdate()
        where 1=1
        and loc_no = #{locNo}
        and matnr = #{matnr}
    </update>
</mapper>