zwl
2025-07-09 958883d6f4dac68fcbbccadb4e7f87e963eee0e8
zy-asrs-common/src/main/resources/mapper/wms/LocDetlMapper.xml
@@ -23,11 +23,17 @@
        <if test="map.maktx!=null and map.maktx!='' ">
            and a.maktx like '%' + #{map.maktx} + '%'
        </if>
        <if test="map.zpallet!=null and map.zpallet!='' ">
            and a.zpallet like '%' + #{map.zpallet} + '%'
        </if>
        <if test="map.batch!=null and map.batch!='' ">
            and a.batch like '%' + #{map.batch} + '%'
        </if>
        <if test="map.anfme!=null and map.anfme!='' ">
            and a.anfme like '%' + #{map.anfme} + '%'
        </if>
        <if test="map.owner!=null and map.owner!='' ">
            and a.owner like '%' + #{map.owner} + '%'
        </if>
        <if test="map.startTime!=null and map.endTime!=null">
            and a.modi_time between #{map.startTime} and #{map.endTime}
@@ -67,6 +73,7 @@
        </if>
        and b.host_id = #{hostId}
        and b.loc_sts = 'F'
        and b.row1 in (1,2,3,4)
        order by b.row1
    </select>
@@ -108,6 +115,7 @@
        where 1=1
        and b.loc_sts = 'F'
        and b.host_id = #{map.hostId}
        and b.row1 in (1,2,3,4)
        <include refid="stockOutCondition"></include>
    </select>
@@ -142,4 +150,25 @@
        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>
    <select id="getStock" resultType="com.zy.asrs.common.domain.dto.ReportStockDto">
        select loc_no as locNo,count(loc_no) as anfme from
            (select matnr,count(matnr) counts,loc_no
             from wms_loc_detl where matnr IN
        <foreach item="item" collection="matnr" open="(" separator="," close=")">
        #{item, jdbcType=VARCHAR}
        </foreach> GROUP BY matnr,loc_no) aa
        GROUP BY aa.loc_no
        order by anfme desc
    </select>
</mapper>