2 天以前 684e4306a08feeae188070f264148e6765da8dcf
src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml
@@ -20,12 +20,19 @@
            t2.tax_exclusive_total_price,
            t3.inbound_num as quantityStock
        from  purchase_ledger t1
        left join sales_ledger_product t2 on t1.id = t2.sales_ledger_id and slp.type = 2
        left join sales_ledger_product t2 on t1.id = t2.sales_ledger_id and t2.type = 2
        left join procurement_record_storage t3 on t2.id = t3.sales_ledger_product_id
        where t1.purchase_contract_number = #{req.purchaseContractNumber}
        <if test="req.id != null and req.id != ''">
            and t3.id = #{req.id}
        </if>
        <where>
            <if test="req.purchaseLedgerId != null">
                and t1.id = #{req.purchaseLedgerId}
            </if>
            <if test="req.purchaseContractNumber != null and req.purchaseContractNumber != ''">
                and t1.purchase_contract_number = #{req.purchaseContractNumber}
            </if>
            <if test="req.id != null and req.id != ''">
                and t3.id = #{req.id}
            </if>
        </where>
        group by t2.id
    </select>
    <select id="listPage" resultType="com.ruoyi.procurementrecord.bean.dto.ProcurementPageDto">