src/main/resources/mapper/sales/ShippingInfoMapper.xml
@@ -24,14 +24,17 @@
        p.product_name,
        sl.customer_name,
        spd.totalQuantity,
        spd.batchNos,
        sor.outboundBatches
        FROM shipping_info s
        LEFT JOIN (select shipping_info_id,sum(quantity) totalQuantity from shipping_product_detail GROUP BY shipping_info_id) spd ON spd.shipping_info_id = s.id
        LEFT JOIN (select shipping_info_id, sum(quantity) totalQuantity,
                          GROUP_CONCAT(DISTINCT batch_no ORDER BY batch_no SEPARATOR ',') batchNos
                   from shipping_product_detail GROUP BY shipping_info_id) spd ON spd.shipping_info_id = s.id
        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 (select record_id,GROUP_CONCAT(outbound_batches SEPARATOR ',') AS outboundBatches
        left join (select record_id, GROUP_CONCAT(DISTINCT outbound_batches SEPARATOR ',') AS outboundBatches
                   from stock_out_record
                   where record_type='13'and approval_status=1
                   group by record_id)sor on sor.record_id= s.id
@@ -48,7 +51,7 @@
        <if test="req.expressNumber != null and req.expressNumber != ''">
            AND s.express_number LIKE CONCAT('%',#{req.expressNumber},'%')
        </if>
        order by create_time DESC
        order by shipping_no DESC
    </select>
    <select id="listAll" resultType="com.ruoyi.sales.pojo.ShippingInfo">
        SELECT
@@ -72,6 +75,7 @@
            slp.product_category,
            slp.specification_model,
            slp.unit,
            slp.product_model_id,
            sor.outbound_batches,
            sor.stock_out_num,
            sor.batch_no,
@@ -97,6 +101,7 @@
                si.id = #{shippingId}
            </if>
        </where>
        order by sor.id
    </select>
    <select id="getShippingInfoByCustomerName" resultType="com.ruoyi.sales.pojo.ShippingInfo">
        select * from shipping_info si