#
zhou zhou
2026-01-05 b4a8d50e3d97fc9e893b554a60134e4eceb012eb
src/main/resources/mapper/OutStockMapper.xml
@@ -61,7 +61,7 @@
        b.FAdd,b.Fflag_finish, a.Fname, a.Fmodel
        from OutStockBillEntry a left join OutStockBill b on a.FInterID = b.FInterID
        where 1=1
        and b.Fflag_finish != 1
        and b.Fflag_finish != 1 and a.FQty > a.FAmount
        <if test="FSourceBillNo!=null and FSourceBillNo!='' ">
            and a.FSourceBillNo = #{FSourceBillNo}
        </if>
@@ -77,6 +77,13 @@
        from OutStockBillEntry a
        left join OutStockBill b on a.FInterID = b.FInterID
        where 1=1
        and b.Fflag_finish != 1 and a.FQty > a.FAmount
        <if test="FSourceBillNo!=null and FSourceBillNo!='' ">
            and a.FSourceBillNo = #{FSourceBillNo}
        </if>
        <if test="FBillNo != null and FBillNo != ''">
            and b.FBillNo = #{FBillNo}
        </if>
    </select>
    <select id="queryMatnrWithBillNo" resultMap="OutStockResultMap">
@@ -84,7 +91,7 @@
        a.FOrderInterID,a.FAuxQty,a.FCommitQty,a.FAuxPrice,a.FDate,a.FNote, a.Fnumber, a.FSourceBillNo, b.FBillNo,
        b.FAdd
        from OutStockBillEntry a left join OutStockBill b on a.FInterID = b.FInterID
        where b.FBillNo = #{FBillNo}) t where 1 = 1
        where b.FBillNo = #{FBillNo} and b.Fflag_finish != 1 and a.FQty > a.FAmount) t where 1 = 1
    </select>
    <select id="queryMatWithLoc" resultMap="BaseResultMap">
@@ -93,8 +100,8 @@
        and b.loc_sts = 'F'
        and a.matnr = #{matnr}
        order by
        DATEPART(yyyy,a.modi_time),DATEPART(mm,a.modi_time),DATEPART(dd,a.modi_time)
        desc,
        DATEPART(yyyy,a.appe_time),DATEPART(mm,a.appe_time),DATEPART(dd,a.appe_time)
        ASC,
        case
        when (left(a.loc_no, 2) = '01') then 0
        when (left(a.loc_no, 2) = '02') then 1