Junjie
2024-07-05 62dc1e0176a62e023a361b76f4f59fa073d9eb8f
zy-asrs-common/src/main/resources/mapper/wms/LocDetlMapper.xml
@@ -117,4 +117,39 @@
        group by matnr,batch
    </select>
    <select id="selectSameDetl" resultType="java.lang.String">
        SELECT
            ld.loc_no
        FROM wms_loc_detl ld
                 LEFT JOIN common_loc_mast lm ON ld.loc_no = lm.loc_no and ld.host_id = lm.host_id
                 LEFT JOIN (
            select
                loc_no,
                count(1) as count
            from wms_loc_detl
            where 1=1
            and host_id = #{hostId}
            group by loc_no
        ) dual on dual.loc_no = lm.loc_no
        WHERE 1 = 1
          AND ld.matnr = #{matnr}
          <if test="batch">
              AND ld.batch = #{batch}
          </if>
          AND (lm.loc_sts = 'F')
          AND dual.count = 1
          AND lm.host_id = #{hostId}
        ORDER BY lm.modi_time ASC
    </select>
    <select id="getStockStatisExcel" resultType="com.zy.asrs.common.wms.entity.LocDetl">
        select
            ROW_NUMBER() over (order by sum(a.anfme) desc) as row
        , a.matnr
             , sum(a.anfme) as anfme
        from wms_loc_detl a
        where 1=1
        group by a.matnr
    </select>
</mapper>