yuan
2026-08-15 a473bf206912b61eb30554e90a5cea4ad2eac642
src/main/resources/mapper/stock/StockInRecordMapper.xml
@@ -21,11 +21,11 @@
        pm.unit,
        u.nick_name as createBy,
        CASE
            WHEN TRIM(sir.record_type) = '7' THEN
            WHEN #{params.topParentProductId} = 3 AND TRIM(sir.record_type) = '7' THEN
                COALESCE(pl_by_product.purchase_contract_number, pl_direct.purchase_contract_number)
            WHEN TRIM(sir.record_type) = '10' THEN
            WHEN #{params.topParentProductId} = 3 AND TRIM(sir.record_type) = '10' THEN
                pl_by_quality.purchase_contract_number
            WHEN #{params.topParentProductId} = 276 THEN
            WHEN #{params.topParentProductId} = 1 THEN
                CASE
                    WHEN TRIM(sir.record_type) IN ('14', '15') THEN
                        sl_return.sales_contract_no
@@ -46,8 +46,7 @@
        LEFT JOIN product as p on pm.product_id = p.id
        LEFT JOIN sys_user as u on sir.create_user = u.user_id
        LEFT JOIN quality_inspect as qi_purchase on TRIM(sir.record_type) = '10' and sir.record_id = qi_purchase.id
        LEFT JOIN sales_ledger_product as slp on TRIM(sir.record_type) = '7' and slp.id = sir.record_id and slp.type = 2
        LEFT JOIN purchase_ledger as pl_by_product on TRIM(sir.record_type) = '7' and pl_by_product.id = slp.sales_ledger_id
        LEFT JOIN purchase_ledger as pl_by_product on TRIM(sir.record_type) = '7' and pl_by_product.id = sir.record_id
        LEFT JOIN purchase_ledger as pl_direct on TRIM(sir.record_type) = '7' and pl_direct.id = sir.record_id
        LEFT JOIN purchase_ledger as pl_by_quality on TRIM(sir.record_type) = '10' and pl_by_quality.id = qi_purchase.purchase_ledger_id
@@ -132,7 +131,7 @@
                and p.id in (select id from product_tree)
            </if>
        </where>
        order by sir.id desc
        order by sir.create_time desc
    </select>
    <select id="listStockInRecordExportData" resultType="com.ruoyi.stock.execl.StockInRecordExportData">
        SELECT
@@ -159,7 +158,7 @@
                and sir.record_type = #{params.recordType}
            </if>
        </where>
        order by sir.id desc
        order by sir.create_time desc
    </select>
    <select id="listPageAccountPurchase" resultType="com.ruoyi.account.bean.vo.purchase.PurchaseInboundVo">
        SELECT