自动化立体仓库 - WMS系统
#
zjj
2023-12-26 e81c1dcf8d2cd9a0095039670a1f34e28078fd97
src/main/resources/mapper/LocDetlMapper.xml
@@ -808,5 +808,32 @@
        group by a.matnr,a.[year],a.[month],a.[day],a.kun,a.up_down
        ) t
    </select>
    <select id="selectSameDetl" resultType="java.lang.String">
        SELECT
        ld.loc_no
        FROM asr_loc_detl ld
        LEFT JOIN asr_loc_mast lm ON ld.loc_no = lm.loc_no
        LEFT JOIN (
        select
        loc_no,
        count(1) as count
        from asr_loc_detl
        where 1=1
        group by loc_no
        ) dual on dual.loc_no = lm.loc_no
        WHERE 1 = 1
        <if test="matnr != null and matnr != ''">
            AND ld.matnr = #{matnr}
        </if>
        <if test="batch != null and batch != ''">
            AND ld.batch = #{batch}
        </if>
        <if test="grade != null and grade != ''">
            AND ld.brand = #{grade}
        </if>
        AND (lm.loc_sts = 'F')
        AND dual.count = 1
        ORDER BY lm.modi_time ASC
    </select>
</mapper>