zss
4 天以前 6beedcff97476af1d562fdb8c99b1a2e418c4e4a
src/main/resources/mapper/sales/ShippingInfoMapper.xml
@@ -19,14 +19,17 @@
        s.update_user,
        s.tenant_id,
        sl.sales_contract_no,
        slp.specification_model,
        pm.model as specification_model,
        pm.unit,
        p.product_name,
        sl.customer_name
        sl.customer_name,
        sor.outbound_batches
        FROM shipping_info s
        LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id
        LEFT JOIN sales_ledger_product slp ON s.sales_ledger_product_id = slp.id and slp.type = 1
        left join product_model pm on slp.product_model_id = pm.id
        left join product p on pm.product_id = p.id
        left join stock_out_record sor on sor.record_id= s.id and sor.record_type='13' and sor.approval_status=1
        WHERE 1=1
        <if test="req.salesContractNo != null and req.salesContractNo != ''">
            AND sl.sales_contract_no LIKE CONCAT('%',#{req.salesContractNo},'%')
@@ -61,6 +64,7 @@
    <select id="getReturnManagementDtoById" resultType="com.ruoyi.sales.dto.SalesLedgerProductDto">
        SELECT
        slp.*,
        si.shipping_no,
        GREATEST(slp.quantity - COALESCE(rs.total_return_num, 0), 0) AS un_quantity,
        COALESCE(rs.total_return_num, 0) AS total_return_num
        FROM shipping_info si
@@ -84,6 +88,6 @@
    <select id="getShippingInfoByCustomerName" resultType="com.ruoyi.sales.pojo.ShippingInfo">
        select * from shipping_info si
        left join sales_ledger sl on si.sales_ledger_id = sl.id
        where si.status = '已发货' and sl.customer_name = #{customerName}
        where  sl.customer_name = #{customerName}
    </select>
</mapper>