自动化立体仓库 - WMS系统
野心家
2022-11-15 fb20f0cf9bc64c4cd3baf23d6c2b0e6a601d0705
src/main/resources/mapper/LocDetlMapper.xml
@@ -100,6 +100,9 @@
        <if test="startTime!=null and endTime!=null">
            and a.modi_time between #{startTime} and #{endTime}
        </if>
        <if test="crnNo!=null and crnNo!='' ">
            and b.crn_no=#{crnNo}
        </if>
    </sql>
    <select id="getStockOutPage" resultMap="BaseResultMap">
@@ -211,10 +214,18 @@
            and a.batch = #{batch}
        </if>
        <if test="orderNo != null and orderNo != ''">
            and a.orderNo = #{orderNo}
            and a.order_no = #{orderNo}
        </if>
        <if test="locNos != null and locNos.size > 0">
            and b.loc_no not in
            <foreach item="item" collection="locNos" index="index"  separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
        order by
        DATEPART(yyyy,a.modi_time),DATEPART(mm,a.modi_time),DATEPART(dd,a.modi_time)
        DATEPART(yyyy,a.modi_time),DATEPART(mm,a.modi_time),DATEPART(dd,a.modi_time), a.anfme
        desc,
        NEWID(),
        case
@@ -271,6 +282,18 @@
        desc
    </select>
    <select id="queryStockOther" resultMap="BaseResultMap">
            select a.*
    from asr_loc_detl a
    left join asr_loc_mast b on a.loc_no = b.loc_no
    where 1=1
    and b.loc_sts = 'F'
    and a.matnr=  #{matnr}
    <if test="locNo !=null and locNo !=''">
    and a.loc_no !=  #{locNo}
    </if>
    </select>
    <select id="queryStockAnfme" resultType="java.lang.Double">
        select sum(anfme) as count from man_loc_detl
         where 1=1
@@ -289,5 +312,24 @@
        where 1=1
        group by matnr,batch
    </select>
    <select id="sum" resultType="java.lang.Integer">
        SELECT SUM(anfme) FROM asr_loc_detl
    </select>
    <select id="unreason" resultMap="BaseResultMap">
        SELECT
            *
        FROM
            [dbo].[asr_loc_detl]
        WHERE
            DATALENGTH( batch ) != 11 or
            batch LIKE '%[a-z]%'
    </select>
    <select id="selectLocDetlSumQty" resultType="double">
        select SUM(anfme) anfme
        from asr_loc_detl
        where loc_no=#{locNo}
    </select>
</mapper>